From patchwork Wed May 26 08:44:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 53598 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3F2D1B7D1D for ; Wed, 26 May 2010 19:27:57 +1000 (EST) Received: from localhost ([127.0.0.1]:34993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHCu3-0001gN-2v for incoming@patchwork.ozlabs.org; Wed, 26 May 2010 05:27:55 -0400 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 Received: from zweiblum.home.kraxel.org (vpn1-7-204.ams2.redhat.com [10.36.7.204]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4Q8iiUO014762; Wed, 26 May 2010 04:44:45 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 2397C7012B; Wed, 26 May 2010 10:44:44 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 26 May 2010 10:44:44 +0200 Message-Id: <1274863484-15147-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH] drive: allow rerror, werror and readonly for if=none X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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; }