From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXbyE-0008Jn-3H for qemu-devel@nongnu.org; Wed, 20 Jan 2010 09:55:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXbyD-0008IN-77 for qemu-devel@nongnu.org; Wed, 20 Jan 2010 09:55:45 -0500 Received: from [199.232.76.173] (port=54361 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXbyC-0008I6-TB for qemu-devel@nongnu.org; Wed, 20 Jan 2010 09:55:45 -0500 Received: from qw-out-1920.google.com ([74.125.92.145]:55210) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXbyC-00042e-Cb for qemu-devel@nongnu.org; Wed, 20 Jan 2010 09:55:44 -0500 Received: by qw-out-1920.google.com with SMTP id 4so180798qwk.4 for ; Wed, 20 Jan 2010 06:55:43 -0800 (PST) Message-ID: <4B57196D.9060805@codemonkey.ws> Date: Wed, 20 Jan 2010 08:55:41 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2 1/4] Make CDROM a read-only drive References: <1263739695-13043-1-git-send-email-nsprei@redhat.com> <1263739695-13043-2-git-send-email-nsprei@redhat.com> In-Reply-To: <1263739695-13043-2-git-send-email-nsprei@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Naphtali Sprei Cc: qemu-devel@nongnu.org On 01/17/2010 08:48 AM, Naphtali Sprei wrote: > Signed-off-by: Naphtali Sprei > Applied. Thanks. Regards, Anthony Liguori > --- > vl.c | 7 +++++++ > 1 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/vl.c b/vl.c > index 06cb40d..76ef8ca 100644 > --- a/vl.c > +++ b/vl.c > @@ -2233,6 +2233,13 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque, > } > (void)bdrv_set_read_only(dinfo->bdrv, 1); > } > + /* > + * cdrom is read-only. Set it now, after above interface checking > + * since readonly attribute not explicitly required, so no error. > + */ > + 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", >