From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbX3K-0007sU-EL for qemu-devel@nongnu.org; Thu, 22 Nov 2012 08:42:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbX3E-0001HP-Jn for qemu-devel@nongnu.org; Thu, 22 Nov 2012 08:42:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:23108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbX3E-0001HJ-Am for qemu-devel@nongnu.org; Thu, 22 Nov 2012 08:42:44 -0500 From: Markus Armbruster References: <1353421834-44687-1-git-send-email-borntraeger@de.ibm.com> <87k3tdc0cc.fsf@blackfin.pond.sub.org> Date: Thu, 22 Nov 2012 14:42:36 +0100 In-Reply-To: <87k3tdc0cc.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Thu, 22 Nov 2012 13:02:11 +0100") Message-ID: <873901zrcj.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCHv3] Support default block interfaces per QEMUMachine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: Kevin Wolf , Peter Maydell , Anthony Liguori , Igor Mitsyanko , qemu-devel , Alexander Graf , Jens Freimann , Stefan Hajnoczi , Cornelia Huck , Andreas Faerber , Einar Lueck Markus Armbruster writes: > Christian Borntraeger writes: > >> There are QEMUMachines that have neither IF_IDE nor IF_SCSI as a >> default/standard interface to their block devices / drives. Therefore, >> this patch introduces a new field default_block_type per QEMUMachine >> struct. The prior use_scsi field becomes thereby obsolete and is >> replaced through .default_block_type = IF_SCSI. >> >> This patch also changes the default for s390x to IF_VIRTIO and >> removes an early hack that converts IF_IDE drives. > > Recommend to do this in a separate patch. > >> Other parties have already claimed interest (e.g. IF_SD for exynos) >> >> To create a sane default, for machines that dont specify a >> default_block_type, this patch makes IF_IDE = 0 and IF_NONE = 1. >> I checked all users of IF_NONE (blockdev.c and ww/device-hotplug.c) > > Typo: hw/ > >> as well as IF_IDE and it seems that it is ok to change the defines - >> in other words, I found no obvious (to me) assumption in the code >> regarding IF_NONE==0. > > Checking for IF_NONE and IF_IDE is not enough; we have to check that > BlockInterfaceType values are never used in a way that's broken by this > change, such as C89 initializers and implicit comparisons to zero. > > I just did that, and couldn't find anything. Almost missed this one: it changes this error message of monitor command drive_add: (qemu) drive_add 0 if=ide Can't hot-add drive to type 1 to Can't hot-add drive to type 0 I don't think we care. Yes, the error message sucks. [...]