mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +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 */
|
||||
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
|
||||
virBufferAddLit(&buf, "devtype=cdrom,");
|
||||
virBufferAddLit(&buf, "devtype=cdrom");
|
||||
|
||||
/*
|
||||
* target
|
||||
@ -1081,7 +1081,8 @@ xenFormatXLDisk(virConfValuePtr list, virDomainDiskDefPtr disk)
|
||||
if (xenFormatXLDiskSrc(disk->src, &target) < 0)
|
||||
goto cleanup;
|
||||
|
||||
virBufferAsprintf(&buf, "target=%s", target);
|
||||
if (target)
|
||||
virBufferAsprintf(&buf, ",target=%s", target);
|
||||
|
||||
if (virBufferCheckError(&buf) < 0)
|
||||
goto cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user