From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXPyF-0001lM-ME for qemu-devel@nongnu.org; Tue, 19 Jan 2010 21:06:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXPyA-0001ka-LG for qemu-devel@nongnu.org; Tue, 19 Jan 2010 21:06:58 -0500 Received: from [199.232.76.173] (port=52647 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXPyA-0001kV-HK for qemu-devel@nongnu.org; Tue, 19 Jan 2010 21:06:54 -0500 Received: from mail2.shareable.org ([80.68.89.115]:51001) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NXPyA-0000T1-6A for qemu-devel@nongnu.org; Tue, 19 Jan 2010 21:06:54 -0500 Date: Wed, 20 Jan 2010 02:06:52 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH v2 1/4] Make CDROM a read-only drive Message-ID: <20100120020652.GH11920@shareable.org> References: <1263739695-13043-1-git-send-email-nsprei@redhat.com> <1263739695-13043-2-git-send-email-nsprei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1263739695-13043-2-git-send-email-nsprei@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Naphtali Sprei Cc: qemu-devel@nongnu.org Naphtali Sprei wrote: > } > (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", When I have anything to say, I usually ask for more comments, but in this case, I think the code would be perfectly clear without it. -- Jamie