From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaRe1-0006Vs-5u for qemu-devel@nongnu.org; Mon, 19 Nov 2012 08:44:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TaRdy-0002uB-4I for qemu-devel@nongnu.org; Mon, 19 Nov 2012 08:44:13 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:45193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaRdx-0002qp-Ro for qemu-devel@nongnu.org; Mon, 19 Nov 2012 08:44:10 -0500 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 Nov 2012 13:44:08 -0000 Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qAJDhwow60227586 for ; Mon, 19 Nov 2012 13:43:58 GMT Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qAJDi4Z1031683 for ; Mon, 19 Nov 2012 06:44:05 -0700 Message-ID: <50AA37A3.4080002@de.ibm.com> Date: Mon, 19 Nov 2012 14:44:03 +0100 From: Christian Borntraeger MIME-Version: 1.0 References: <1352708530-28863-1-git-send-email-borntraeger@de.ibm.com> <1352708530-28863-2-git-send-email-borntraeger@de.ibm.com> <3BAFCBD6-D1BB-4270-BB16-DCEC6B124350@suse.de> In-Reply-To: <3BAFCBD6-D1BB-4270-BB16-DCEC6B124350@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/1] Support default block interfaces per QEMUMachine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Kevin Wolf , Peter Maydell , Anthony Liguori , Igor Mitsyanko , qemu-devel qemu-devel , Markus Armbruster , Jens Freimann , Stefan Hajnoczi , Cornelia Huck , =?ISO-8859-1?Q?Andreas_F=E4r?= =?ISO-8859-1?Q?ber?= , Einar Lueck On 19/11/12 14:36, Alexander Graf wrote: > > On 12.11.2012, at 09:22, Christian Borntraeger wrote: > >> There are QEMUMachines that have neither IF_IDE nor IF_SCSI as a >> default/standard interface to their block devices / drives. Therfore, >> this patch introduces a new field default_block per QEMUMachine struct. >> The prior use_scsi field becomes thereby obsolete and is replaced through >> .default_block = DEFAULT_SCSI. >> >> Based on an initial patch from Einar Lueck >> >> Signed-off-by: Christian Borntraeger >> --- >> blockdev.c | 4 ++-- >> blockdev.h | 29 ++++++++++++++++++++++++++++- >> hw/boards.h | 3 ++- >> hw/device-hotplug.c | 2 +- >> hw/highbank.c | 2 +- >> hw/leon3.c | 1 - >> hw/mips_jazz.c | 4 ++-- >> hw/pc_sysfw.c | 2 +- >> hw/puv3.c | 1 - >> hw/realview.c | 7 ++++--- >> hw/s390-virtio.c | 16 +--------------- >> hw/spapr.c | 2 +- >> hw/sun4m.c | 24 ++++++++++++------------ >> hw/versatilepb.c | 4 ++-- >> hw/vexpress.c | 4 ++-- >> hw/xilinx_zynq.c | 2 +- >> vl.c | 20 +++++++++++--------- >> 17 files changed, 71 insertions(+), 56 deletions(-) >> >> diff --git a/blockdev.c b/blockdev.c >> index e73fd6e..aca3c14 100644 >> --- a/blockdev.c >> +++ b/blockdev.c >> @@ -275,7 +275,7 @@ static bool do_check_io_limits(BlockIOLimit *io_limits) >> return true; >> } >> >> -DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi) >> +DriveInfo *drive_init(QemuOpts *opts, BlockDefault block_default) >> { >> const char *buf; >> const char *file = NULL; >> @@ -325,7 +325,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi) >> return NULL; >> } >> } else { >> - type = default_to_scsi ? IF_SCSI : IF_IDE; >> + type = block_if_from_default(block_default); >> } >> >> max_devs = if_max_devs[type]; >> diff --git a/blockdev.h b/blockdev.h >> index 5f27b64..aba6d77 100644 >> --- a/blockdev.h >> +++ b/blockdev.h >> @@ -24,6 +24,33 @@ typedef enum { >> IF_COUNT >> } BlockInterfaceType; >> >> +/* For machine default interface. */ >> +typedef enum { >> + DEFAULT_IDE = 0, >> + DEFAULT_SCSI, >> + DEFAULT_FLOPPY, >> + DEFAULT_PFLASH, >> + DEFAULT_MTD, >> + DEFAULT_SD, >> + DEFAULT_VIRTIO, >> + DEFAULT_XEN >> +} BlockDefault; > > Why a new enum? Can't we just reuse the IF_ ones? > > Also, traditionally Markus has had very strong opinions on anything IF_ and -drive related. It's probably a good idea to get him in the loop :). > > Alex Review feedback from the first cycle. Anthony wanted to make the default (field is not specified at all) a sane default, which means IDE must be 0.