From: Naphtali Sprei <nsprei@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/3] Make CDROM a read-only drive
Date: Thu, 14 Jan 2010 16:33:17 +0200 [thread overview]
Message-ID: <4B4F2B2D.5040401@redhat.com> (raw)
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
reply other threads:[~2010-01-14 14:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B4F2B2D.5040401@redhat.com \
--to=nsprei@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).