* [Qemu-devel] [PATCH] drive: allow rerror, werror and readonly for if=none
@ 2010-05-26 8:44 Gerd Hoffmann
2010-05-26 9:53 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Gerd Hoffmann @ 2010-05-26 8:44 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
When creating guest disks the qdev way using ...
-drive if=none,id=$name,args
-device $driver,drive=$name
it is not possible to specify rerror, werror and readonly arguments
for drive as drive_init allows/blocks them based on the interface (if=)
specified and none isn't white-listed there.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
vl.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/vl.c b/vl.c
index 328395e..71346ac 100644
--- a/vl.c
+++ b/vl.c
@@ -950,7 +950,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
on_write_error = BLOCK_ERR_STOP_ENOSPC;
if ((buf = qemu_opt_get(opts, "werror")) != NULL) {
- if (type != IF_IDE && type != IF_SCSI && type != IF_VIRTIO) {
+ if (type != IF_IDE && type != IF_SCSI && type != IF_VIRTIO && type != IF_NONE) {
fprintf(stderr, "werror is no supported by this format\n");
return NULL;
}
@@ -963,7 +963,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
on_read_error = BLOCK_ERR_REPORT;
if ((buf = qemu_opt_get(opts, "rerror")) != NULL) {
- if (type != IF_IDE && type != IF_VIRTIO) {
+ if (type != IF_IDE && type != IF_VIRTIO && type != IF_NONE) {
fprintf(stderr, "rerror is no supported by this format\n");
return NULL;
}
@@ -1111,7 +1111,7 @@ DriveInfo *drive_init(QemuOpts *opts, void *opaque,
/* CDROM is fine for any interface, don't check. */
ro = 1;
} else if (ro == 1) {
- if (type != IF_SCSI && type != IF_VIRTIO && type != IF_FLOPPY) {
+ if (type != IF_SCSI && type != IF_VIRTIO && type != IF_FLOPPY && type != IF_NONE) {
fprintf(stderr, "qemu: readonly flag not supported for drive with this interface\n");
return NULL;
}
--
1.6.6.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-26 9:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 8:44 [Qemu-devel] [PATCH] drive: allow rerror, werror and readonly for if=none Gerd Hoffmann
2010-05-26 9:53 ` Kevin Wolf
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).