[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] libxl: don't add cache mode for empty drives



qemu commit 91a097e7 forbids specifying the cache mode for empty
drives. Attempting to create a domain with an empty qdisk cdrom
results in

qemu-system-x86_64: -drive if=ide,index=1,readonly=on,media=cdrom,
   cache=writeback,id=ide-832: Must specify either driver or file

Change libxl to only emit cache mode when a cdrom target is specified.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
 tools/libxl/libxl_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index fd12844..df1207b 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -1368,11 +1368,11 @@ static int libxl__build_device_model_args_new(libxl__gc 
*gc,
 
             if (disks[i].is_cdrom) {
                 drive = libxl__sprintf(gc,
-                         
"if=ide,index=%d,readonly=%s,media=cdrom,cache=writeback,id=ide-%i",
+                         "if=ide,index=%d,readonly=%s,media=cdrom,id=ide-%i",
                          disk, disks[i].readwrite ? "off" : "on", dev_number);
 
                 if (target_path)
-                    drive = libxl__sprintf(gc, "%s,file=%s,format=%s",
+                    drive = libxl__sprintf(gc, 
"%s,file=%s,format=%s,cache=writeback",
                                            drive, target_path, format);
             } else {
                 /*
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.