From: Daniel P. Berrange Date: Mon, 1 Feb 2010 17:21:05 +0000 (+0000) Subject: Tweak USB hostdevice XML handling X-Git-Tag: v0.7.6~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23d6abd23b33b91c7c0a26eead81d23662b2c8ca;p=thirdparty%2Flibvirt.git Tweak USB hostdevice XML handling When attaching a USB host device based on vendor/product, libvirt will resolve the vendor/product into a device/bus pair. This means that when printing XML we should allow device/bus info to be printed at any time if present * src/conf/domain_conf.c, docs/schemas/domain.rng: Allow USB device bus info alongside vendor/product --- diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng index 827ff6f191..bb6d00d7c1 100644 --- a/docs/schemas/domain.rng +++ b/docs/schemas/domain.rng @@ -1179,7 +1179,12 @@ - + + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b434fc5d00..766993c586 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5244,11 +5244,12 @@ virDomainHostdevDefFormat(virConnectPtr conn, def->source.subsys.u.usb.vendor); virBufferVSprintf(buf, " \n", def->source.subsys.u.usb.product); - } else { + } + if (def->source.subsys.u.usb.bus || + def->source.subsys.u.usb.device) virBufferVSprintf(buf, "
\n", def->source.subsys.u.usb.bus, def->source.subsys.u.usb.device); - } } else if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) { virBufferVSprintf(buf, "
\n", def->source.subsys.u.pci.domain,