1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 07:59:00 +00:00

conf: Mark missing optional USB devices in domain XML

When startupPolicy set for a USB devices allows such device to be
missing, there was no way this could be detected from domain XML. With
this patch, libvirt emits a new missing='yes' attribute for such devices
when active domain XML is generated.
This commit is contained in:
Jiri Denemark 2012-10-11 22:33:46 +02:00
parent c0fab87106
commit f95560b3fe
2 changed files with 13 additions and 0 deletions

View File

@ -1654,6 +1654,14 @@
</optional>
<interleave>
<element name="source">
<optional>
<attribute name="missing">
<choice>
<value>yes</value>
<value>no</value>
</choice>
</attribute>
</optional>
<choice>
<group>
<ref name="usbproduct"/>

View File

@ -12102,6 +12102,11 @@ virDomainHostdevSourceFormat(virBufferPtr buf,
if (def->source.subsys.u.usb.autoAddress &&
(flags & VIR_DOMAIN_XML_MIGRATABLE))
virBufferAddLit(buf, " autoAddress='yes'");
if (def->missing &&
!(flags & VIR_DOMAIN_XML_INACTIVE))
virBufferAddLit(buf, " missing='yes'");
virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 2);