Skip to contentSkip to conversation

Make CDROM a read-only drive

PATCH Superseded Naphtali Sprei 1 participant 1 message Jan 14, 2010

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Make CDROM a read-only drive

---
 vl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
vl.c +4 -0
index 06cb40d..4f19505 100644
@@ -2234,6 +2234,10 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
         (void)bdrv_set_read_only(dinfo->bdrv, 1);
     }
 
+    if (media == MEDIA_CDROM) {
+        (void)bdrv_set_read_only(dinfo->bdrv, 1);
+    }
+
     if (bdrv_open2(dinfo->bdrv, file, bdrv_flags, drv) < 0) {
         fprintf(stderr, "qemu: could not open disk image %s: %s\n",
                         file, strerror(errno));
Signature · 1 line
1.6.3.3