提交 f95560b3 编写于 作者: J Jiri Denemark

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.
上级 c0fab871
......@@ -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"/>
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册