[PATCH libvirt v1] conf: verify for duplicate hostdevs

Michal Prívozník mprivozn at redhat.com
Thu Jul 1 14:40:53 UTC 2021


On 7/1/21 10:31 AM, Shalini Chellathurai Saroja wrote:
> 
> On 6/30/21 4:49 PM, Michal Prívozník wrote:
>> On 6/18/21 12:46 PM, Shalini Chellathurai Saroja wrote:
>>> It is possible to define/edit(in shut off state) a domain XML with
>>> same hostdev device repeated more than once, as shown below. This
>>> behavior is not expected. So, this patch fixes it.
>>>
>>> vser1:
>>> <domain type='kvm'>
>>> [...]
>>>    <devices>
>>>   [...]
>>>      <hostdev mode='subsystem' type='mdev' managed='no'
>>> model='vfio-ccw'>
>>>        <source>
>>>          <address uuid='8e782fea-e5f4-45fa-a0f9-024cf66e5009'/>
>>>        </source>
>>>        <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0005'/>
>>>      </hostdev>
>>>      <hostdev mode='subsystem' type='mdev' managed='no'
>>> model='vfio-ccw'>
>>>        <source>
>>>          <address uuid='8e782fea-e5f4-45fa-a0f9-024cf66e5009'/>
>>>        </source>
>>>        <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0006'/>
>>>      </hostdev>
>>> [...]
>>>    </devices>
>>> </domain>
>>>
>>> $ virsh define vser1
>>> Domain 'vser1' defined from vser1
>>>
>>> Signed-off-by: Shalini Chellathurai Saroja <shalini at linux.ibm.com>
>>> Reviewed-by: Bjoern Walk <bwalk at linux.ibm.com>
>>> Reviewed-by: Boris Fiuczynski <fiuczy at linux.ibm.com>
>>> ---
>>>   src/conf/domain_conf.c                        |  2 +-
>>>   src/conf/domain_conf.h                        |  2 +
>>>   src/conf/domain_validate.c                    | 21 ++++++++++
>>>   src/libvirt_private.syms                      |  1 +
>>>   .../hostdev-mdev-duplicate.err                |  1 +
>>>   .../hostdev-mdev-duplicate.xml                | 41 +++++++++++++++++++
>>>   .../hostdev-pci-duplicate.err                 |  1 +
>>>   .../hostdev-pci-duplicate.xml                 | 40 ++++++++++++++++++
>>>   .../hostdev-scsi-duplicate.err                |  1 +
>>>   .../hostdev-scsi-duplicate.xml                | 40 ++++++++++++++++++
>>>   .../hostdev-usb-duplicate.err                 |  1 +
>>>   .../hostdev-usb-duplicate.xml                 | 40 ++++++++++++++++++
>>>   tests/qemuxml2argvtest.c                      |  8 ++++
>>>   13 files changed, 198 insertions(+), 1 deletion(-)
>>>   create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-duplicate.err
>>>   create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-duplicate.xml
>>>   create mode 100644 tests/qemuxml2argvdata/hostdev-pci-duplicate.err
>>>   create mode 100644 tests/qemuxml2argvdata/hostdev-pci-duplicate.xml
>>>   create mode 100644 tests/qemuxml2argvdata/hostdev-scsi-duplicate.err
>>>   create mode 100644 tests/qemuxml2argvdata/hostdev-scsi-duplicate.xml
>>>   create mode 100644 tests/qemuxml2argvdata/hostdev-usb-duplicate.err
>>>   create mode 100644 tests/qemuxml2argvdata/hostdev-usb-duplicate.xml

<snip/>

>> So let's do the following, I'll merge it
>> tomorrow, after the release so that we give users the longest window
>> possible to complain.
>>
>> Reviewed-by: Michal Privoznik <mprivozn at redhat.com>
> ok, thank you Michal.

Pushed now.

Michal




More information about the libvir-list mailing list