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.
/* devtype */
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
- virBufferAddLit(&buf, "devtype=cdrom,");
+ virBufferAddLit(&buf, "devtype=cdrom");
/*
* target
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;