Received: from [140.186.70.92] (port=59059 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OI2ht-0007Su-0j for qemu-devel@nongnu.org; Fri, 28 May 2010 12:46:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OI2hr-0008GQ-Gi for qemu-devel@nongnu.org; Fri, 28 May 2010 12:46:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49371) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OI2hr-0008GH-AR for qemu-devel@nongnu.org; Fri, 28 May 2010 12:46:47 -0400 From: Kevin Wolf Date: Fri, 28 May 2010 18:46:05 +0200 Message-Id: <1275065173-24045-7-git-send-email-kwolf@redhat.com> In-Reply-To: <1275065173-24045-1-git-send-email-kwolf@redhat.com> References: <1275065173-24045-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 06/14] drive: allow rerror, werror and readonly for if=none List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: 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 Signed-off-by: Kevin Wolf --- vl.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vl.c b/vl.c index 417554f..7121cd0 100644 --- a/vl.c +++ b/vl.c @@ -953,7 +953,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; } @@ -966,7 +966,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; } @@ -1114,7 +1114,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