From patchwork Fri Oct 21 12:37:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 9388831 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B814A607F0 for ; Fri, 21 Oct 2016 12:40:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9C812A174 for ; Fri, 21 Oct 2016 12:40:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DF802A17A; Fri, 21 Oct 2016 12:40:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 78ACA2A174 for ; Fri, 21 Oct 2016 12:40:57 +0000 (UTC) Received: from localhost ([::1]:60567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxZ84-0000Va-NQ for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Oct 2016 08:40:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxZ7a-0000Oa-F0 for qemu-devel@nongnu.org; Fri, 21 Oct 2016 08:40:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxZ7Z-0003bH-Df for qemu-devel@nongnu.org; Fri, 21 Oct 2016 08:40:26 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::7]:63634) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bxZ7Z-0003Z2-7d for qemu-devel@nongnu.org; Fri, 21 Oct 2016 08:40:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1477053624; l=1944; s=domk; d=aepfle.de; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Date: Subject:Cc:To:From; bh=yqOr2+s5mbel6I8fo5SRNVcLBH3iNqa22/Axy7hEZH8=; b=K7M99DcuNlAINiMPOXFxbl73aZOZTNKWlhLvQae4NtVI3FRRLtY3N1HNki5j+bltDmP IyRMS4xdHc6/UGPyrWyG07dzQ3j97pnwcavEe/OiMiaAwKQoJs2xrSjAh//d1Yk07IHA+ eLvcGV8JerfdcFG56JBlsvHoQxMCXFjfb5M= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+zrwiavkK6tmQaLfsxs2aAREi5Yt4MyXrh8Jgq7VYwmVYUFv6zcflDcaeFe0wBrcvSQ== X-RZG-CLASS-ID: mo00 Received: from aepfle.de ([2001:a62:126b:cbff:2a0:d1ff:fec8:8ecb]) by smtp.strato.de (RZmta 39.6 AUTH) with ESMTPSA id x09a61s9LCbEfEI (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Fri, 21 Oct 2016 14:37:14 +0200 (CEST) From: Olaf Hering To: Stefano Stabellini , Anthony Perard Date: Fri, 21 Oct 2016 14:37:06 +0200 Message-Id: <20161021123707.18302-2-olaf@aepfle.de> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161021123707.18302-1-olaf@aepfle.de> References: <20161021123707.18302-1-olaf@aepfle.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::7 Subject: [Qemu-devel] [PATCH v3 1/2] xen_platform: unplug also SCSI disks X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Olaf Hering , Eduardo Habkost , "Michael S. Tsirkin" , qemu-devel@nongnu.org, xen-devel@lists.xenproject.org, Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Using 'vdev=sd[a-o]' will create an emulated LSI controller, which can be used by the emulated BIOS to boot from disk. If the HVM domU has also PV driver the disk may appear twice in the guest. To avoid this an unplug of the emulated hardware is needed, similar to what is done for IDE and NIC drivers already. Since the SCSI controller provides only disks the entire controller can be unplugged at once. Impact of the change for classic and pvops based guest kernels: vdev=sda:disk0 before: pvops: disk0=pv xvda + emulated sda classic: disk0=pv sda + emulated sdq after: pvops: disk0=pv xvda classic: disk0=pv sda vdev=hda:disk0, vdev=sda:disk1 before: pvops: disk0=pv xvda disk1=emulated sda classic: disk0=pv hda disk1=pv sda + emulated sdq after: pvops: disk0=pv xvda disk1=not accessible by blkfront, index hda==index sda classic: disk0=pv hda disk1=pv sda vdev=hda:disk0, vdev=sda:disk1, vdev=sdb:disk2 before: pvops: disk0=pv xvda disk1=emulated sda disk2=pv xvdb + emulated sdb classic: disk0=pv hda disk1=pv sda + emulated sdq disk2=pv sdb + emulated sdr after: pvops: disk0=pv xvda disk1=not accessible by blkfront, index hda==index sda disk2=pv xvdb classic: disk0=pv hda disk1=pv sda disk2=pv sda Signed-off-by: Olaf Hering Reviewed-by: Stefano Stabellini --- hw/i386/xen/xen_platform.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index f85635c..91d8a7a 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -114,6 +114,10 @@ static void unplug_disks(PCIBus *b, PCIDevice *d, void *o) PCI_CLASS_STORAGE_IDE && strcmp(d->name, "xen-pci-passthrough") != 0) { pci_piix3_xen_ide_unplug(DEVICE(d)); + } else if (pci_get_word(d->config + PCI_CLASS_DEVICE) == + PCI_CLASS_STORAGE_SCSI + && strcmp(d->name, "xen-pci-passthrough") != 0) { + object_unparent(OBJECT(d)); } }