mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 23:25:24 +00:00
xl: don't output (null) target in domxml-to-native
When converting a domain xml containing a CDROM device without any attached source, don't add a target=(null) to the libxl config disk definition: xen doesn't like it at all and would fail to start the domain.
This commit is contained in:
parent
df93b5f5f5
commit
8126d87078
@ -1068,7 +1068,7 @@ xenFormatXLDisk(virConfValuePtr list, virDomainDiskDefPtr disk)
|
|||||||
|
|
||||||
/* devtype */
|
/* devtype */
|
||||||
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
|
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
|
||||||
virBufferAddLit(&buf, "devtype=cdrom,");
|
virBufferAddLit(&buf, "devtype=cdrom");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* target
|
* target
|
||||||
@ -1081,7 +1081,8 @@ xenFormatXLDisk(virConfValuePtr list, virDomainDiskDefPtr disk)
|
|||||||
if (xenFormatXLDiskSrc(disk->src, &target) < 0)
|
if (xenFormatXLDiskSrc(disk->src, &target) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
virBufferAsprintf(&buf, "target=%s", target);
|
if (target)
|
||||||
|
virBufferAsprintf(&buf, ",target=%s", target);
|
||||||
|
|
||||||
if (virBufferCheckError(&buf) < 0)
|
if (virBufferCheckError(&buf) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user