From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIfEV-00012X-Oj for qemu-devel@nongnu.org; Thu, 10 Dec 2009 04:22:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIfEQ-00010R-KV for qemu-devel@nongnu.org; Thu, 10 Dec 2009 04:22:47 -0500 Received: from [199.232.76.173] (port=33829 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIfEQ-00010N-Bp for qemu-devel@nongnu.org; Thu, 10 Dec 2009 04:22:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30572) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NIfEP-0003kU-KU for qemu-devel@nongnu.org; Thu, 10 Dec 2009 04:22:41 -0500 Message-ID: <4B20BDD0.5060901@redhat.com> Date: Thu, 10 Dec 2009 10:22:24 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [ANNOUNCE][Call-For-Testing] Release 0.12.0-rc1 of QEMU References: <4B1C3377.1020509@linux.vnet.ibm.com> <20091209165605.GT21885@redhat.com> In-Reply-To: <20091209165605.GT21885@redhat.com> Content-Type: multipart/mixed; boundary="------------070700050805040807020909" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Anthony Liguori , "qemu-devel@nongnu.org" This is a multi-part message in MIME format. --------------070700050805040807020909 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 12/09/09 17:56, Daniel P. Berrange wrote: > There's a small bug in SCSI drive hotplug where QEMU is not assigning > unique block device names when you leave the name unspecified > > $ /home/berrange/usr/qemu-0.12/bin/qemu -vnc :1 -monitor stdio -device lsi > QEMU 0.11.91 monitor - type 'help' for more information > (qemu) drive_add 0:0:4 file=/home/berrange/mcdboot.img,if=scsi > OK bus 0, unit 0 > (qemu) drive_add 0:0:4 file=/home/berrange/mcdboot.img,if=scsi > OK bus 0, unit 1 > (qemu) drive_add 0:0:4 file=/home/berrange/mcdboot.img,if=scsi > OK bus 0, unit 2 > (qemu) drive_add 0:0:4 file=/home/berrange/mcdboot.img,if=scsi > OK bus 0, unit 3 > (qemu) info block > ide1-cd0: type=cdrom removable=1 locked=0 [not inserted] > floppy0: type=floppy removable=1 locked=0 [not inserted] > sd0: type=floppy removable=1 locked=0 [not inserted] > scsi0-hd0: type=hd removable=0 file=/home/berrange/mcdboot.img ro=1 drv=raw encrypted=0 > scsi0-hd0: type=hd removable=0 file=/home/berrange/mcdboot.img ro=1 drv=raw encrypted=0 > scsi0-hd0: type=hd removable=0 file=/home/berrange/mcdboot.img ro=1 drv=raw encrypted=0 > scsi0-hd0: type=hd removable=0 file=/home/berrange/mcdboot.img ro=1 drv=raw encrypted=0 > (qemu) > > Notice they are all 'scsi0-hd0', instead of scsi0-hd1, scsi0-hd2, etc Fix attached. Note that the whole auto-naming only works reliable if you limit yourself to a single scsi bus (in any qemu version out there). I strongly recommend to simply name the drives yourself using id=. Works in 0.12 and IIRC in 0.11 too. cheers, Gerd --------------070700050805040807020909 Content-Type: text/plain; name="0001-scsi-drive-hotplug.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-scsi-drive-hotplug.patch" >>From bd87046b51df2c15e5017e79155045a4e2b7f83b Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 10 Dec 2009 10:13:59 +0100 Subject: [PATCH] scsi drive hotplug --- hw/pci-hotplug.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index 7e5c51d..9e8e6ed 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -93,6 +93,7 @@ static int scsi_hot_add(DeviceState *adapter, DriveInfo *dinfo, int printinfo) */ dinfo->unit = qemu_opt_get_number(dinfo->opts, "unit", -1); scsidev = scsi_bus_legacy_add_drive(scsibus, dinfo, dinfo->unit); + dinfo->unit = scsidev->id; if (printinfo) qemu_error("OK bus %d, unit %d\n", scsibus->busnr, scsidev->id); -- 1.6.5.2 --------------070700050805040807020909--