Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIfzX-0005CX-H8 for qemu-devel@nongnu.org; Thu, 10 Dec 2009 05:11:23 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIfzS-00058N-3A for qemu-devel@nongnu.org; Thu, 10 Dec 2009 05:11:22 -0500 Received: from [199.232.76.173] (port=49969 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIfzQ-00057x-VK for qemu-devel@nongnu.org; Thu, 10 Dec 2009 05:11:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45590) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NIfzQ-0007nr-J9 for qemu-devel@nongnu.org; Thu, 10 Dec 2009 05:11:16 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBAABFEf007607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Dec 2009 05:11:15 -0500 From: Gerd Hoffmann Date: Thu, 10 Dec 2009 11:11:07 +0100 Message-Id: <1260439868-15061-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1260439868-15061-1-git-send-email-kraxel@redhat.com> References: <1260439868-15061-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [FOR 0.12 PATCH 3/4] scsi: fix drive hotplug. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann This patch fills the DriveInfo->unit after hotplugging a scsi disk. It makes a difference when auto-assigning a scsi id, where unit was left filled with '-1' instead of the actual scsi id. With this patch applied the the drive naming logic in drive_init() works as good as it did in previous releases. Which means it works fine with a single scsi bus. Signed-off-by: Gerd Hoffmann --- 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