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:
parent
c0fab87106
commit
f95560b3fe
@ -1654,6 +1654,14 @@
|
|||||||
</optional>
|
</optional>
|
||||||
<interleave>
|
<interleave>
|
||||||
<element name="source">
|
<element name="source">
|
||||||
|
<optional>
|
||||||
|
<attribute name="missing">
|
||||||
|
<choice>
|
||||||
|
<value>yes</value>
|
||||||
|
<value>no</value>
|
||||||
|
</choice>
|
||||||
|
</attribute>
|
||||||
|
</optional>
|
||||||
<choice>
|
<choice>
|
||||||
<group>
|
<group>
|
||||||
<ref name="usbproduct"/>
|
<ref name="usbproduct"/>
|
||||||
|
@ -12102,6 +12102,11 @@ virDomainHostdevSourceFormat(virBufferPtr buf,
|
|||||||
if (def->source.subsys.u.usb.autoAddress &&
|
if (def->source.subsys.u.usb.autoAddress &&
|
||||||
(flags & VIR_DOMAIN_XML_MIGRATABLE))
|
(flags & VIR_DOMAIN_XML_MIGRATABLE))
|
||||||
virBufferAddLit(buf, " autoAddress='yes'");
|
virBufferAddLit(buf, " autoAddress='yes'");
|
||||||
|
|
||||||
|
if (def->missing &&
|
||||||
|
!(flags & VIR_DOMAIN_XML_INACTIVE))
|
||||||
|
virBufferAddLit(buf, " missing='yes'");
|
||||||
|
|
||||||
virBufferAddLit(buf, ">\n");
|
virBufferAddLit(buf, ">\n");
|
||||||
|
|
||||||
virBufferAdjustIndent(buf, 2);
|
virBufferAdjustIndent(buf, 2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user