[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] read-only: allow read-only CDROM with any interface
From: |
Naphtali Sprei |
Subject: |
[Qemu-devel] [PATCH] read-only: allow read-only CDROM with any interface |
Date: |
Sun, 21 Mar 2010 17:33:53 +0200 |
Signed-off-by: Naphtali Sprei <address@hidden>
---
vl.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/vl.c b/vl.c
index 2e38b77..d3863d7 100644
--- a/vl.c
+++ b/vl.c
@@ -1255,19 +1255,16 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
bdrv_flags &= ~BDRV_O_NATIVE_AIO;
}
- if (ro == 1) {
+ if (media == MEDIA_CDROM) {
+ ro = 1;
+ }
+ if (ro == 1 &&
+ media != MEDIA_CDROM) { /* CDROM is fine for any interface, don't
check */
if (type != IF_SCSI && type != IF_VIRTIO && type != IF_FLOPPY) {
fprintf(stderr, "qemu: readonly flag not supported for drive with
this interface\n");
return NULL;
}
}
- /*
- * cdrom is read-only. Set it now, after above interface checking
- * since readonly attribute not explicitly required, so no error.
- */
- if (media == MEDIA_CDROM) {
- ro = 1;
- }
bdrv_flags |= ro ? 0 : BDRV_O_RDWR;
if (bdrv_open2(dinfo->bdrv, file, bdrv_flags, drv) < 0) {
--
1.6.3.3
- [Qemu-devel] [PATCH] read-only: allow read-only CDROM with any interface,
Naphtali Sprei <=