]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
libxl: correct xenstore entry for empty cdrom
authorJuergen Gross <jgross@suse.com>
Wed, 15 Feb 2017 11:11:12 +0000 (12:11 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 5 Apr 2017 13:16:22 +0000 (14:16 +0100)
Specifying an empty cdrom device will result in a Xenstore entry

params = aio:(null)

as the physical device path isn't existing. This lets a domain booted
via OVMF hang as OVMF is checking for "aio:" only in order to detect
the empty cdrom case.

Use an empty string for the physical device path in this case. As a
cdrom device for HVM is always backed by qdisk we only need to cover this
backend.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl.c

index 0386f28e0d975f6f083970a7b3aa7efb92892324..acf714e1f918010bc6b573fb70ed2c0aef316f55 100644 (file)
@@ -2255,7 +2255,8 @@ static void device_disk_add(libxl__egc *egc, uint32_t domid,
             case LIBXL_DISK_BACKEND_QDISK:
                 flexarray_append(back, "params");
                 flexarray_append(back, GCSPRINTF("%s:%s",
-                              libxl__device_disk_string_of_format(disk->format), disk->pdev_path));
+                              libxl__device_disk_string_of_format(disk->format),
+                              disk->pdev_path ? : ""));
                 if (libxl_defbool_val(disk->colo_enable)) {
                     flexarray_append(back, "colo-host");
                     flexarray_append(back, libxl__sprintf(gc, "%s", disk->colo_host));