From patchwork Wed Oct 14 13:30:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 35964 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 A4701B7B74 for ; Thu, 15 Oct 2009 00:34:48 +1100 (EST) Received: from localhost ([127.0.0.1]:50361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1My401-0001ox-W0 for incoming@patchwork.ozlabs.org; Wed, 14 Oct 2009 09:34:42 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1My3wB-0008BS-7n for qemu-devel@nongnu.org; Wed, 14 Oct 2009 09:30:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1My3w7-000897-1X for qemu-devel@nongnu.org; Wed, 14 Oct 2009 09:30:42 -0400 Received: from [199.232.76.173] (port=32891 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1My3w6-00088q-JI for qemu-devel@nongnu.org; Wed, 14 Oct 2009 09:30:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37664) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1My3w5-0000rX-Ks for qemu-devel@nongnu.org; Wed, 14 Oct 2009 09:30:38 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9EDUaso030928 for ; Wed, 14 Oct 2009 09:30:36 -0400 Received: from zweiblum.home.kraxel.org (vpn1-5-6.ams2.redhat.com [10.36.5.6]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id n9EDUWPi014951; Wed, 14 Oct 2009 09:30:32 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id CE825700FC; Wed, 14 Oct 2009 15:30:31 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 14 Oct 2009 15:30:31 +0200 Message-Id: <1255527031-19008-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [STABLE PATCH] hotplug: fix scsi hotplug. 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 Well, partly just papering over the issues. But without proper scsi bus infrastructure we hardly can do better. Changes: * Avoid auto-attach by setting the bus number to -1. * Ignore the unit value calculated by drive_init(). * Explicitly attach the devices to the adapter. * Add sanity checks. Don't allow attaching scsi drives to your network device. * Kill the bus+unit printing. The values are bogus, and we can't easily figure the correct ones. I doubt this ever worked correctly with multiple scsi adapters present in the system. Should come more close to the expected behavior now ... Oh, and pc-bios/bios.bin needs a update too, otherwise pci hotplug doesn't work at all. Signed-off-by: Gerd Hoffmann Tested-by: Dustin Kirkland --- hw/pci-hotplug.c | 24 +++++++++++++++++++----- pc-bios/bios.bin | Bin 131072 -> 131072 bytes 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin index e4323c0504f8f4faf72d56e288c0d457b37bf442..542beddc6fa9c267893283c919158be28f61cb05 100644 GIT binary patch delta 18924 zcmb7r4|r77weLAIlVmdabA~X10723=Sn*HIASfe6W0FY_iA@QEREW^NcE0vr+EP1% zzFxygJc*s%#Hitqy%EvQm;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Ym(G`0|H>yJ2=oTnA*@exTjG2uic#|_v-kGTjjyI4p}RL1HR zGl+w4Nc*Z2BKM)_$t`o~+oIb|>fX$MThv%aZE>IyZ{U=m`3kGxJ@etK3iy%Ju&=+u z!GboM`dIjyBKiu1B$aCXc%649=p#BRY7@Wb?b&4e>%2cPF}9EQJx*lyBX>3X9uw$U zIPpbZc9h!_*`N;bzeg7`^^^AVk8JwF_qAW*$IU6N(W&_|T3t2&@4$!jV(9LIUwUXpCaEWW zOYGZ)xyZ!we5c<+cB&fA+KbQp7)X-XkS|iX>)1s*C)+8NDZt)_>8XFmCA|_dpo7-* zE@V9a6QAK+ubi;W5#F=>d4InEY{&lx{I>x+Zk@sX@KyKuH7&x4&NE9tdoOk8#ciIo z&0az9tZis%SZ#Jp@B7N?m8IpyRnA3^3hUY$JWcDxSq;0&Z0p)*(SsG2l~vCB7O!vd ztY5daesSl@JFBcs6_u}k=g!sQt7q%)vRWRzt@9@N*3W*WY~@!TsJE}b_r3;4{h&j# zulL{AAllbAuWBhTEi3-)#HT7dx5_ojJ?p)zS_FIZs#P_7+#*zdSJ3EDTZS=)ET4K%c^WTQa8I|#^i{rZ+wEu!`f4!xDeH*DIlaRW_TxAj3H!t)6t z$}Cq=VF4MQ#y^V;_g_YaJ5Pr9lVn&wL58L2&m!aYzl@CA^JFx9k__7?$mnaTdHB!R zlsocOF^&MCYTcH@>>eKk&-#HM=VI dh>st)-StJcd+#@ni!a<%Mz>$AsTHmq`G3#B*wX+2 diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index d0f2911..8bedea2 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -52,9 +52,10 @@ void drive_hot_add(Monitor *mon, const char *pci_addr, const char *opts) { int dom, pci_bus; unsigned slot; - int drive_idx, type, bus; + int drive_idx, type; int success = 0; PCIDevice *dev; + char buf[128]; if (pci_read_devaddr(mon, pci_addr, &dom, &pci_bus, &slot)) { return; @@ -74,11 +75,19 @@ void drive_hot_add(Monitor *mon, const char *pci_addr, const char *opts) return; } type = drives_table[drive_idx].type; - bus = drive_get_max_bus (type); switch (type) { case IF_SCSI: + if (!dev->qdev.info || strcmp(dev->qdev.info->name, "lsi53c895a") != 0) { + monitor_printf(mon, "Device is not a scsi adapter\n"); + break; + } success = 1; + drives_table[drive_idx].bus = -1; + drives_table[drive_idx].unit = -1; + if (get_param_value(buf, sizeof(buf), "unit", opts)) { + drives_table[drive_idx].unit = atoi(buf); + } lsi_scsi_attach(&dev->qdev, drives_table[drive_idx].bdrv, drives_table[drive_idx].unit); break; @@ -87,9 +96,7 @@ void drive_hot_add(Monitor *mon, const char *pci_addr, const char *opts) } if (success) - monitor_printf(mon, "OK bus %d, unit %d\n", - drives_table[drive_idx].bus, - drives_table[drive_idx].unit); + monitor_printf(mon, "OK\n"); return; } @@ -130,7 +137,14 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon, switch (type) { case IF_SCSI: + drives_table[drive_idx].bus = -1; + drives_table[drive_idx].unit = -1; + if (get_param_value(buf, sizeof(buf), "unit", opts)) { + drives_table[drive_idx].unit = atoi(buf); + } dev = pci_create("lsi53c895a", devaddr); + lsi_scsi_attach(&dev->qdev, drives_table[drive_idx].bdrv, + drives_table[drive_idx].unit); break; case IF_VIRTIO: dev = pci_create("virtio-blk-pci", devaddr);