mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
Allow <source> for type=block to have no dev
Currently the XML parser already allows the following syntax: <disk type='block' device='cdrom'> <source startupPolicy='optional'/> <target dev='hda' bus='ide'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> But it if the dev value is NULL then it would not have the leading "<source ", resulting in invalid XML.
This commit is contained in:
parent
caf6589233
commit
4b5652d0dc
@ -1140,9 +1140,11 @@
|
|||||||
<interleave>
|
<interleave>
|
||||||
<optional>
|
<optional>
|
||||||
<element name="source">
|
<element name="source">
|
||||||
|
<optional>
|
||||||
<attribute name="dev">
|
<attribute name="dev">
|
||||||
<ref name="absFilePath"/>
|
<ref name="absFilePath"/>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
</optional>
|
||||||
<optional>
|
<optional>
|
||||||
<ref name="startupPolicy"/>
|
<ref name="startupPolicy"/>
|
||||||
</optional>
|
</optional>
|
||||||
|
@ -14207,8 +14207,8 @@ virDomainDiskSourceDefFormat(virBufferPtr buf,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VIR_DOMAIN_DISK_TYPE_BLOCK:
|
case VIR_DOMAIN_DISK_TYPE_BLOCK:
|
||||||
virBufferEscapeString(buf, " <source dev='%s'",
|
virBufferAddLit(buf, " <source");
|
||||||
def->src);
|
virBufferEscapeString(buf, " dev='%s'", def->src);
|
||||||
if (def->startupPolicy)
|
if (def->startupPolicy)
|
||||||
virBufferEscapeString(buf, " startupPolicy='%s'",
|
virBufferEscapeString(buf, " startupPolicy='%s'",
|
||||||
startupPolicy);
|
startupPolicy);
|
||||||
|
Loading…
Reference in New Issue
Block a user