Skip to contentSkip to conversation

libxl: don't add cache mode for qdisk cdrom drives

PATCH In review Jim Fehlig 3 participants 5 messages Apr 28, 2016 – May 15, 2016

lore
Share & tools
lore

Jim Fehlig

author
#0 lore raw

PATCH v2 1/1 libxl: don't add cache mode for qdisk cdrom drives

qemu commit 91a097e7 forbids specifying cache mode for empty drives. Attempting to create a domain with an empty qdisk cdrom drive 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

libxl only allows an empty 'target=' for cdroms. By default, cdroms are readonly (see the 'access' parameter in xl-disk-configuration.txt) and forced to readonly by any tools (e.g. xl) using libxlutil's xlu_disk_parse() function. With cdroms always marked readonly, explicitly specifying the cache mode for cdrom drives can be dropped. The drive's 'readonly=on' option can also be set unconditionally.

---

V2:
Drop explicitly setting cache mode since cdrom devices are readonly.
Unconditionally add 'readonly=on' drive option for cdroms.

 tools/libxl/libxl_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/libxl/libxl_dm.c +2 -2
index fd12844..959e292 100644
@@ -1368,8 +1368,8 @@ 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",
-                         disk, disks[i].readwrite ? "off" : "on", dev_number);
+                         "if=ide,index=%d,readonly=on,media=cdrom,id=ide-%i",
+                         disk, dev_number);
 
                 if (target_path)
                     drive = libxl__sprintf(gc, "%s,file=%s,format=%s",
Signature · 7 lines
1.8.0.1


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw
Quoted 7 lines · Jim Fehlig

qemu commit 91a097e7 forbids specifying cache mode for empty drives. Attempting to create a domain with an empty qdisk cdrom drive 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

We need to fix this one way or another.

Quoted 8 lines

libxl only allows an empty 'target=' for cdroms. By default, cdroms are readonly (see the 'access' parameter in xl-disk-configuration.txt) and forced to readonly by any tools (e.g. xl) using libxlutil's xlu_disk_parse() function. With cdroms always marked readonly, explicitly specifying the cache mode for cdrom drives can be dropped. The drive's 'readonly=on' option can also be set unconditionally.

CC Stefano who made the change to use writeback in e9a327bbbcab127625b0917a2780cb3601a81d01 . Also CC Anthony.

Ian, Stefano and Anthony, do you have opinion on this patch?

Quoted 28 lines

---

V2:
Drop explicitly setting cache mode since cdrom devices are readonly.
Unconditionally add 'readonly=on' drive option for cdroms.

 tools/libxl/libxl_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/libxl/libxl_dm.c +2 -2
index fd12844..959e292 100644
@@ -1368,8 +1368,8 @@ 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",
-                         disk, disks[i].readwrite ? "off" : "on", dev_number);
+                         "if=ide,index=%d,readonly=on,media=cdrom,id=ide-%i",
+                         disk, dev_number);
 
                 if (target_path)
                     drive = libxl__sprintf(gc, "%s,file=%s,format=%s",
Signature · 1 line
1.8.0.1

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 18 lines · Wei Liu
Quoted 7 lines · Jim Fehlig

qemu commit 91a097e7 forbids specifying cache mode for empty drives. Attempting to create a domain with an empty qdisk cdrom drive 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

We need to fix this one way or another.

Quoted 7 lines

libxl only allows an empty 'target=' for cdroms. By default, cdroms are readonly (see the 'access' parameter in xl-disk-configuration.txt) and forced to readonly by any tools (e.g. xl) using libxlutil's xlu_disk_parse() function. With cdroms always marked readonly, explicitly specifying the cache mode for cdrom drives can be dropped. The drive's 'readonly=on' option can also be set unconditionally.

Quoted 6 lines
Quoted 1 line

CC Stefano who made the change to use writeback in e9a327bbbcab127625b0917a2780cb3601a81d01 . Also CC Anthony.

Ian, Stefano and Anthony, do you have opinion on this patch?

It looks good to me. We could consider to backport it, given that we only have a loose relationship with QEMU and older versions of Xen could end up running with newer versions of QEMU.

Quoted 22 lines
Quoted 22 lines

V2:
Drop explicitly setting cache mode since cdrom devices are readonly.
Unconditionally add 'readonly=on' drive option for cdroms.

 tools/libxl/libxl_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/libxl/libxl_dm.c +2 -2
index fd12844..959e292 100644
@@ -1368,8 +1368,8 @@ 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",
-                         disk, disks[i].readwrite ? "off" : "on", dev_number);
+                         "if=ide,index=%d,readonly=on,media=cdrom,id=ide-%i",
+                         disk, dev_number);
 
Quoted 11 lines
Quoted 5 lines
tools/libxl/libxl_dm.c +0 -0
                 if (target_path)
                     drive = libxl__sprintf(gc, "%s,file=%s,format=%s",
Signature · 1 line
1.8.0.1

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#3 lore raw
Quoted 18 lines · Stefano Stabellini
Quoted 17 lines · Wei Liu
Quoted 7 lines · Jim Fehlig

qemu commit 91a097e7 forbids specifying cache mode for empty drives. Attempting to create a domain with an empty qdisk cdrom drive 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

We need to fix this one way or another.

Quoted 7 lines

libxl only allows an empty 'target=' for cdroms. By default, cdroms are readonly (see the 'access' parameter in xl-disk-configuration.txt) and forced to readonly by any tools (e.g. xl) using libxlutil's xlu_disk_parse() function. With cdroms always marked readonly, explicitly specifying the cache mode for cdrom drives can be dropped. The drive's 'readonly=on' option can also be set unconditionally.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

CC Stefano who made the change to use writeback in e9a327bbbcab127625b0917a2780cb3601a81d01 . Also CC Anthony.

Ian, Stefano and Anthony, do you have opinion on this patch?

It looks good to me. We could consider to backport it, given that we only have a loose relationship with QEMU and older versions of Xen could end up running with newer versions of QEMU.

Wei,

Will this patch make 4.7? It allows empty cdroms with freshly released QEMU 2.6 :-).

Regards,
Jim

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
Quoted 23 lines · Jim Fehlig
Quoted 22 lines · Stefano Stabellini
Quoted 21 lines · Wei Liu
Quoted 7 lines · Jim Fehlig

qemu commit 91a097e7 forbids specifying cache mode for empty drives. Attempting to create a domain with an empty qdisk cdrom drive 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

We need to fix this one way or another.

Quoted 8 lines

libxl only allows an empty 'target=' for cdroms. By default, cdroms are readonly (see the 'access' parameter in xl-disk-configuration.txt) and forced to readonly by any tools (e.g. xl) using libxlutil's xlu_disk_parse() function. With cdroms always marked readonly, explicitly specifying the cache mode for cdrom drives can be dropped. The drive's 'readonly=on' option can also be set unconditionally.

CC Stefano who made the change to use writeback in e9a327bbbcab127625b0917a2780cb3601a81d01 . Also CC Anthony.

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

Ian, Stefano and Anthony, do you have opinion on this patch?

It looks good to me. We could consider to backport it, given that we only have a loose relationship with QEMU and older versions of Xen could end up running with newer versions of QEMU.

Wei,

Will this patch make 4.7? It allows empty cdroms with freshly released QEMU 2.6 :-).

Yes, it's on my radar. I wanted to give some time for other people to look at it.

Now two weeks has passed, I've queued it up for committing.

Wei.

Quoted 3 lines

Regards,
Jim

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel