From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53981 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHCsg-0001b3-Q0 for qemu-devel@nongnu.org; Wed, 26 May 2010 05:26:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHCsf-0005lX-Ea for qemu-devel@nongnu.org; Wed, 26 May 2010 05:26:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7726) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHCsf-0005lB-5S for qemu-devel@nongnu.org; Wed, 26 May 2010 05:26:29 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4Q8ijGg028001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 26 May 2010 04:44:46 -0400 From: Gerd Hoffmann Date: Wed, 26 May 2010 10:44:44 +0200 Message-Id: <1274863484-15147-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH] 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: qemu-devel@nongnu.org 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 --- 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