* [Qemu-devel] [PATCH 1/3] Make CDROM a read-only drive
@ 2010-01-14 14:33 Naphtali Sprei
0 siblings, 0 replies; only message in thread
From: Naphtali Sprei @ 2010-01-14 14:33 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>
---
vl.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/vl.c b/vl.c
index 06cb40d..4f19505 100644
--- a/vl.c
+++ b/vl.c
@@ -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));
--
1.6.3.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-01-14 14:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-14 14:33 [Qemu-devel] [PATCH 1/3] Make CDROM a read-only drive Naphtali Sprei
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.