From patchwork Fri Sep 2 09:43:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olaf Hering X-Patchwork-Id: 9310639 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 EB75E60756 for ; Fri, 2 Sep 2016 09:46:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBDBB292CD for ; Fri, 2 Sep 2016 09:46:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D04C729452; Fri, 2 Sep 2016 09:46:02 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A737A292CD for ; Fri, 2 Sep 2016 09:46:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfl12-00050U-9h; Fri, 02 Sep 2016 09:44:04 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfl10-000507-DV for xen-devel@lists.xenproject.org; Fri, 02 Sep 2016 09:44:02 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 51/8B-03271-1E949C75; Fri, 02 Sep 2016 09:44:01 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRWlGSWpSXmKPExsUSuHLSbd2Hnif DDc78Y7X4vmUykwOjx+EPV1gCGKNYM/OS8isSWDP+PDcumC9YseNbRAPjfp4uRi4OFoHFzBLf 3zewdDFyckgI+EosX3wLyOYAskUknvxPA6kRErjLJLHtxAVGkBo2ASWJvQePg9kiAjES+79sZ wexmQW+MkocfuAMYgsL2Ej0vP/MDGKzCKhKfHq3iAnE5hUwlpi+/BgzxC45iUvbvjCD7OIUMJ H4eBBsjBBQScOeZewQ5YISJ2c+YYEYLy/RvHU28wRG/llIUrOQpBYwMq1i1ChOLSpLLdI1MtJ LKspMzyjJTczM0TU0MNbLTS0uTkxPzUlMKtZLzs/dxAgMtHoGBsYdjFNP+B1ilORgUhLlfW1/ MlyILyk/pTIjsTgjvqg0J7X4EKMMB4eSBO9hD6CcYFFqempFWmYOMORh0hIcPEoivBLAsBfiL S5IzC3OTIdInWLU5dg2b+8VJiGWvPy8VClxXn6QIgGQoozSPLgRsPi7xCgrJczLyMDAIMRTkF qUm1mCKv+KUZyDUUmY9w/IJTyZeSVwm14BHcEEdETJteMgR5QkIqSkGhiZPwQ93hCaq/j5QLN EPVPIRrevXpp7tx1aW/KJT8NqRouiPM90Tk6+5wWb33M7XdVUuy+x4/myhlVmQq9Kcz+tmftn 32PZW4xze4PKt27SV+l8+PeB1Qe5NJPlvtbnHoqaKufuTNlxoa1Hkv/20dcrN4oJqHE+d1VVu WW4QMm1cr2yh6JIj6gSS3FGoqEWc1FxIgCvF1YBugIAAA== X-Env-Sender: olaf@aepfle.de X-Msg-Ref: server-8.tower-31.messagelabs.com!1472809440!58686284!1 X-Originating-IP: [81.169.146.219] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11143 invoked from network); 2 Sep 2016 09:44:01 -0000 Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.219) by server-8.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 2 Sep 2016 09:44:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1472809440; l=1944; s=domk; d=aepfle.de; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Date: Subject:Cc:To:From; bh=DzopBbOQbr1sRRKCe7ro7sPwoHoh/kYaIr5JoPLg64w=; b=LrOZxqb0zf+Nsg3c1aFZQJD7fB6DJr0rky1eK6QRjOn+1UCb6pvAOwgbIq+jmDUR3dy QiMwlJr5PslOJxTruetuSJdJ84nQAfEm+XvCuV1ELqs+kvx3Li0Br7tH0YqGaKDbMNGDM +uTnTnPgqBR7bou36na52zAQMLCaC6a0hQM= X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWtqWFmrC5F/k8z92bXikQ== X-RZG-CLASS-ID: mo00 Received: from aepfle.de (aftr-185-17-206-179.dynamic.mnet-online.de [185.17.206.179]) by smtp.strato.de (RZmta 38.13 DYNA|AUTH) with ESMTPSA id v01914s829i0PTs (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, 2 Sep 2016 11:44:00 +0200 (CEST) From: Olaf Hering To: Stefano Stabellini , Anthony Perard Date: Fri, 2 Sep 2016 11:43:53 +0200 Message-Id: <20160902094354.25935-2-olaf@aepfle.de> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160902094354.25935-1-olaf@aepfle.de> References: <20160902094354.25935-1-olaf@aepfle.de> MIME-Version: 1.0 Cc: Olaf Hering , Eduardo Habkost , "Michael S. Tsirkin" , qemu-devel@nongnu.org, xen-devel@lists.xenproject.org, Paolo Bonzini , Richard Henderson Subject: [Xen-devel] [PATCH v2 1/2] xen_platform: unplug also SCSI disks X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-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 --- 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 aa78393..53be3c7 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)); } }