[libvirt] [PATCHv4 1/9] Allow omitting USB port

Ján Tomko jtomko at redhat.com
Mon Jul 18 15:46:12 UTC 2016


On Wed, Jul 13, 2016 at 04:43:18PM -0400, John Ferlan wrote:
>
>
>On 07/01/2016 11:38 AM, Ján Tomko wrote:
>> We were requiring a USB port path in the schema, but not enforcing it.
>> Omitting the USB port would lead to libvirt formatting it as (null).
>> Such domain cannot be started and will disappear after libvirtd restart
>> (since it cannot parse back the XML).
>>
>> Only format the port if it has been specified and mark it as optional
>> in the XML schema.
>> ---
>>  docs/schemas/domaincommon.rng                      |  8 +++--
>>  src/conf/domain_conf.c                             |  5 ++-
>>  src/qemu/qemu_command.c                            |  3 +-
>>  .../qemuxml2argv-usb-port-missing.args             | 26 ++++++++++++++++
>>  .../qemuxml2argv-usb-port-missing.xml              | 25 +++++++++++++++
>>  tests/qemuxml2argvtest.c                           |  3 ++
>>  .../qemuxml2xmlout-usb-port-missing.xml            | 36 ++++++++++++++++++++++
>>  tests/qemuxml2xmltest.c                            |  1 +
>>  8 files changed, 100 insertions(+), 7 deletions(-)
>>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-port-missing.args
>>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-usb-port-missing.xml
>>  create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-usb-port-missing.xml
>>
>
>As pointed out to me during the LUKS changes, if your "data" XML is
>essentially the same as your output XML, you could make a file link from
>output to data. See the *gic* files for an example. All I did was copy
>the output to data, removed output, and then recreated output as file
>link to data. It's not a "requirement" and it doesn't really matter to
>me, but I think in the effort to reduce the size of things is what
>started that. Of course, it's hard to know without tripping across it a
>few times...

I believe there are quite a few cases like that and they deserve a
separate cleanup.

Even with a symlink we would end up checking the validity twice in
virschematest.

Jan




More information about the libvir-list mailing list