From nobody Sat Jun 1 08:43:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1654788141; cv=none; d=zohomail.com; s=zohoarc; b=ke+L1aeXPXGcYPIVdk+pOpWa2nA2UxVcQHmi0/I4jurnnDmPo3n1+MLOEYueTH240fE4oJR3dyha0mSQo+oQbKd5mAEeFXtqjxocsYphMLEn6hEwahjuu0gtP2Cygkgd13pYdsk16Ing4mazQk0NRwR5ZZJGmuPn0MtKFRn+Wsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654788141; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=trzpJFpw0R5JaTIOgzAPqPYdp7GgL1UH6Gy+vLKXiv0=; b=hCstI1xH3A4qGn4b7LCDEyfzEJCBthe1CyZPCPLEqDbXLbeWLp5ZLTw/w7oA2u1oudN9QyBs5dANqQAnEPGB/WXz+lUAHEcUJI2L9GnlxA8+uEbplTRMQoJNZPk48kLic3WNPqaWRxeuU91yDTNvNNwcdHX0nOymo7uniM0Wp/U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654788141345814.3188898062714; Thu, 9 Jun 2022 08:22:21 -0700 (PDT) Received: from localhost ([::1]:49504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzJzI-0005a2-AS for importer@patchew.org; Thu, 09 Jun 2022 11:22:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzIkJ-0001g0-Fd; Thu, 09 Jun 2022 10:02:47 -0400 Received: from esa6.hc3370-68.iphmx.com ([216.71.155.175]:31027) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzIkE-00082x-5Q; Thu, 09 Jun 2022 10:02:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1654783362; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=paGXb34Mhy13nhDQiM1CO7vzOLM/JRT2V7IsY1lUB2A=; b=NXB78+MRa0fbysS7wyMbVN+MowA6Xm3zv6+qo5oaB8pTtNEEwjlTqq9F WsT4VQXOLWCRiJmCoqxA7hA5qlqvhuzjWjlJS5Ot3HgkglE7HXuph+XQr 8KLn5rDcLjZ98hmUX1iBWg71I52KO1e8rB55QjGcszZE25tDKYCiS/39o s=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 73081444 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:yDQjv6tH1ffBN9/eKpWuyojwqOfnVI9eMUV32f8akzHdYApBsoF/q tZmKTyFaKuJZGr2L413O961oExXucDXy942GVRkpC4xEnkW+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZhSAgk/nOHNIQMcacUsxLbVYMpBwJ1FQywobVvqYy2YLjW13V6 YupyyHiEATNNwBcYzp8B52r8HuDjNyq0N/PlgVjDR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aV5oteYIsimQD101hICG8cqSj+P xG+85rsiMc6QxhIU3I9urgBEDtex7hHNtOkOss1NSZLW3bUQmTTL2KhLGKq1aLJ8S9zJ856U 4JSdkZNDSaNzZHZKjBjDVQa+xQo+W6zA== X-IronPort-AV: E=Sophos;i="5.91,287,1647316800"; d="scan'208";a="73081444" To: CC: Bernhard Beschow , Anthony PERARD , "Michael S. Tsirkin" , "Marcel Apfelbaum" , Paolo Bonzini , Richard Henderson , Eduardo Habkost , John Snow , Subject: [PULL 1/3] hw/ide/piix: Remove redundant "piix3-ide-xen" device class Date: Thu, 9 Jun 2022 15:02:00 +0100 Message-ID: <20220609140202.45227-2-anthony.perard@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609140202.45227-1-anthony.perard@citrix.com> References: <20220609140202.45227-1-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.71.155.175; envelope-from=prvs=1525abdf4=anthony.perard@citrix.com; helo=esa6.hc3370-68.iphmx.com X-Spam_score_int: -44 X-Spam_score: -4.5 X-Spam_bar: ---- X-Spam_report: (-4.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Reply-to: Anthony PERARD From: Anthony PERARD via X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1654788143700100001 Content-Type: text/plain; charset="utf-8" From: Bernhard Beschow Commit 0f8445820f11a69154309863960328dda3dc1ad4 'xen: piix reuse pci generic class init function' already resolved redundant code which in turn rendered piix3-ide-xen redundant. Signed-off-by: Bernhard Beschow Reviewed-by: Anthony PERARD Message-Id: <20220513180957.90514-2-shentey@gmail.com> Signed-off-by: Anthony PERARD --- hw/i386/pc_piix.c | 3 +-- hw/ide/piix.c | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 578e537b35..0e45521e74 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -246,8 +246,7 @@ static void pc_init1(MachineState *machine, if (pcmc->pci_enabled) { PCIDevice *dev; =20 - dev =3D pci_create_simple(pci_bus, piix3_devfn + 1, - xen_enabled() ? "piix3-ide-xen" : "piix3-i= de"); + dev =3D pci_create_simple(pci_bus, piix3_devfn + 1, "piix3-ide"); pci_ide_create_devs(dev); idebus[0] =3D qdev_get_child_bus(&dev->qdev, "ide.0"); idebus[1] =3D qdev_get_child_bus(&dev->qdev, "ide.1"); diff --git a/hw/ide/piix.c b/hw/ide/piix.c index ce89fd0aa3..2345fe9e1d 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -241,12 +241,6 @@ static const TypeInfo piix3_ide_info =3D { .class_init =3D piix3_ide_class_init, }; =20 -static const TypeInfo piix3_ide_xen_info =3D { - .name =3D "piix3-ide-xen", - .parent =3D TYPE_PCI_IDE, - .class_init =3D piix3_ide_class_init, -}; - /* NOTE: for the PIIX4, the IRQs and IOports are hardcoded */ static void piix4_ide_class_init(ObjectClass *klass, void *data) { @@ -272,7 +266,6 @@ static const TypeInfo piix4_ide_info =3D { static void piix_ide_register_types(void) { type_register_static(&piix3_ide_info); - type_register_static(&piix3_ide_xen_info); type_register_static(&piix4_ide_info); } =20 --=20 Anthony PERARD From nobody Sat Jun 1 08:43:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1654787854; cv=none; d=zohomail.com; s=zohoarc; b=KJyG/yHDCwegm7tVJH4dP0anCfZ1YpVe2xiQBGXeM1C/l/6YCDFTep6ImKb748kLk0648AoZgoKvMiwT+e/CFzqZVz8VCADUD1M5Y/7plKmfzDkNRRE8CK9B6RglpsOR59veyxWw+zkZsdev/Eb1U/9Bkr4GtvQfzgFyia96jkk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654787854; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=+qbdVW8vNTEt7lT1n8KxY6/dQE/dSw4yjXLEFfZzZOU=; b=mls+58h0fKmHc65MgioMpNP8ohtkkH0U+gwwdu8g0kOpSzycUhOXX4Xjtw10Rahtk0uNznGG29BPyRHqtCPDQUEvtmiVmNRKfs2Obzd+b4t/vXbPYzHiWYF+1FGkFO855PvCmScAluj96/IwIr/uvSBsc/5tVQ10X8NDL2bSlgI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16547878546611008.7038454772367; Thu, 9 Jun 2022 08:17:34 -0700 (PDT) Received: from localhost ([::1]:40794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzJuf-0007oF-38 for importer@patchew.org; Thu, 09 Jun 2022 11:17:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzIkD-0001T9-EN; Thu, 09 Jun 2022 10:02:41 -0400 Received: from esa6.hc3370-68.iphmx.com ([216.71.155.175]:31027) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzIkB-00082x-Cb; Thu, 09 Jun 2022 10:02:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1654783359; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GCi02nV81YV0tmImsGwUdNEFIjjd2D3ncf0k9Oyr2J0=; b=L47WN67td54gmRSoWYPK6gk0VeIP4NWNDNayuB988LdoyE7HW3gNMszP jH+t7441B7xh24GbfjCqgNt4PXpjEbdsCgbo7AeED78zGBJXSFmf0JKZx +rpRmeOgWQSI3T6IPu+7kC2IMX1C7QcvO6swmZYXOX0TV9jit3qmWLkm0 c=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 73081441 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:hxNNkKsJRYK5PaG/fUxY5bVxvefnVDteMUV32f8akzHdYApBsoF/q tZmKW6Cb62PNzakc95+b97l/EgO68eAyNNqTwM5+Xs0ESxB+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZhSAgk/nOHNIQMcacUsxLbVYMpBwJ1FQywobVvqYy2YLjW13V6 YupyyHiEATNNwBcYzp8B52r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yV X-IronPort-AV: E=Sophos;i="5.91,287,1647316800"; d="scan'208";a="73081441" To: CC: Bernhard Beschow , Anthony PERARD , John Snow , Subject: [PULL 2/3] hw/ide/piix: Add some documentation to pci_piix3_xen_ide_unplug() Date: Thu, 9 Jun 2022 15:02:01 +0100 Message-ID: <20220609140202.45227-3-anthony.perard@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609140202.45227-1-anthony.perard@citrix.com> References: <20220609140202.45227-1-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.71.155.175; envelope-from=prvs=1525abdf4=anthony.perard@citrix.com; helo=esa6.hc3370-68.iphmx.com X-Spam_score_int: -44 X-Spam_score: -4.5 X-Spam_bar: ---- X-Spam_report: (-4.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Reply-to: Anthony PERARD From: Anthony PERARD via X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1654787856838100001 Content-Type: text/plain; charset="utf-8" From: Bernhard Beschow The comment is based on commit message ae4d2eb273b167dad748ea4249720319240b1ac2 'xen-platform: add missing disk unplug option'. Since it seems to describe design decisions and limitations that still apply it seems worth having. Signed-off-by: Bernhard Beschow Reviewed-by: Anthony PERARD Message-Id: <20220513180957.90514-3-shentey@gmail.com> Signed-off-by: Anthony PERARD --- hw/ide/piix.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 2345fe9e1d..bc1b37512a 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -173,6 +173,17 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error= **errp) } } =20 +/* + * The Xen HVM unplug protocol [1] specifies a mechanism to allow guests to + * request unplug of 'aux' disks (which is stated to mean all IDE disks, + * except the primary master). + * + * NOTE: The semantics of what happens if unplug of all disks and 'aux' di= sks + * is simultaneously requested is not clear. The implementation assu= mes + * that an 'all' request overrides an 'aux' request. + * + * [1] https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Ddocs/misc/= hvm-emulated-unplug.pandoc + */ int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux) { PCIIDEState *pci_ide; --=20 Anthony PERARD From nobody Sat Jun 1 08:43:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1654783426; cv=none; d=zohomail.com; s=zohoarc; b=ThP6g0DIVl6y/kcIdgLDOy4sEPj2+8elhnM/0UlcFa2gbA59+ynBamkkwSeoyMuzfuoj9BcCblxRtHgaQSrJLPfCAIexXVFOBk8lz4E/XyyE9awH4HEoQ5d7Dj90mPgYK359C/464VQ7JiIpVHzO/5BuqkOUcoLpy/l1GI4hyy4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654783426; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s8LWudCHhI2ikIVT9GOGbnretVVeyOtWabEVCYibpCU=; b=Jijc7JaynuAY2s9t6qvuP2Mp9QGfx4w13oyWTRUAs9RIC90duxui/q9RVEDz1TgFZYSbZ0vbtz0/0oJ4J3Kz0LvD4NljL6zsO4jnciKUD3yyeQvPe141EsqYTPSIxoEJxh9Vm5tEsnCLjUKm+ehMWhqSE1a4xA5hdG/ASfLjOIU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1654783426258643.2439865849556; Thu, 9 Jun 2022 07:03:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.345547.571186 (Exim 4.92) (envelope-from ) id 1nzIkM-0001JT-6n; Thu, 09 Jun 2022 14:02:50 +0000 Received: by outflank-mailman (output) from mailman id 345547.571186; Thu, 09 Jun 2022 14:02:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzIkM-0001JM-3u; Thu, 09 Jun 2022 14:02:50 +0000 Received: by outflank-mailman (input) for mailman id 345547; Thu, 09 Jun 2022 14:02:48 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzIkK-0001J0-DE for xen-devel@lists.xenproject.org; Thu, 09 Jun 2022 14:02:48 +0000 Received: from esa5.hc3370-68.iphmx.com (esa5.hc3370-68.iphmx.com [216.71.155.168]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d5cae84f-e7fc-11ec-bd2c-47488cf2e6aa; Thu, 09 Jun 2022 16:02:46 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d5cae84f-e7fc-11ec-bd2c-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1654783366; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2U3jUoNslZi3eqK5NFra4Ihi53xzZqdKWsALmkjx8cU=; b=NuPnBJQTgBdyxhbZInEKjXdjsqqHls7O/OspTlhqigMK9vJtSbOke0ri j1BPhAA74O0kFO6iCuB12i7AIb+vaEZoha+JJN+goLBRErb6ySCgiiahk 9PP4myjiRZKVzPNNol8AyhUGKzdTHF+R1SBWGFX9/J2TGospXM2TSLMpi 8=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 5.1 X-MesageID: 72584691 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:/nEWgK+ZETWmMnB+WLlxDrUDJ36TJUtcMsCJ2f8bNWPcYEJGY0x3m jEdWDiPM/yNMGP9edF2aN+xpE1TusCAydVnQVFp/n88E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si+Fa+Sn9T8mvU2xbuKU5NTsY0idfic5DnZ44f5fs7Rh2NQw34DpW1jlV e7a+KUzBnf0g1aYDUpMg06zgEsHUCPa4W5wUvQWPJinjXeG/5UnJMt3yZKZdhMUdrJ8DO+iL 9sv+Znilo/vE7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 jur IronPort-HdrOrdr: A9a23:F79vfakFKVUIC4pgni6YLoKgTvnpDfIq3DAbv31ZSRFFG/Fxl6 iV88jzsiWE7gr5OUtQ/uxoV5PgfZqxz/NICMwqTNWftWrdyQ+VxeNZjbcKqgeIc0aVygce79 YET0EXMqyIMbEQt6jHCWeDf+rIuOP3k5yVuQ== X-IronPort-AV: E=Sophos;i="5.91,287,1647316800"; d="scan'208";a="72584691" From: Anthony PERARD To: CC: Bernhard Beschow , Anthony PERARD , Stefano Stabellini , Paul Durrant , Paolo Bonzini , "Richard Henderson" , Eduardo Habkost , "Michael S. Tsirkin" , "Marcel Apfelbaum" , John Snow , , Subject: [PULL 3/3] include/hw/ide: Unexport pci_piix3_xen_ide_unplug() Date: Thu, 9 Jun 2022 15:02:02 +0100 Message-ID: <20220609140202.45227-4-anthony.perard@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609140202.45227-1-anthony.perard@citrix.com> References: <20220609140202.45227-1-anthony.perard@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1654783430007100001 From: Bernhard Beschow This function was declared in a generic and public header, implemented in a device-specific source file but only used in xen_platform. Given its 'aux' parameter, this function is more xen-specific than piix-specific. Also, the hardcoded magic constants seem to be generic and related to PCIIDEState and IDEBus rather than piix. Therefore, move this function to xen_platform, unexport it, and drop the "piix3" in the function name as well. Signed-off-by: Bernhard Beschow Reviewed-by: Paul Durrant Acked-by: Anthony PERARD Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20220513180957.90514-4-shentey@gmail.com> Signed-off-by: Anthony PERARD --- hw/i386/xen/xen_platform.c | 48 +++++++++++++++++++++++++++++++++++++- hw/ide/piix.c | 46 ------------------------------------ include/hw/ide.h | 3 --- 3 files changed, 47 insertions(+), 50 deletions(-) diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index 72028449ba..a64265cca0 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -26,6 +26,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "hw/ide.h" +#include "hw/ide/pci.h" #include "hw/pci/pci.h" #include "hw/xen/xen_common.h" #include "migration/vmstate.h" @@ -134,6 +135,51 @@ static void pci_unplug_nics(PCIBus *bus) pci_for_each_device(bus, 0, unplug_nic, NULL); } =20 +/* + * The Xen HVM unplug protocol [1] specifies a mechanism to allow guests to + * request unplug of 'aux' disks (which is stated to mean all IDE disks, + * except the primary master). + * + * NOTE: The semantics of what happens if unplug of all disks and 'aux' di= sks + * is simultaneously requested is not clear. The implementation assu= mes + * that an 'all' request overrides an 'aux' request. + * + * [1] https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Ddocs/misc/= hvm-emulated-unplug.pandoc + */ +static void pci_xen_ide_unplug(DeviceState *dev, bool aux) +{ + PCIIDEState *pci_ide; + int i; + IDEDevice *idedev; + IDEBus *idebus; + BlockBackend *blk; + + pci_ide =3D PCI_IDE(dev); + + for (i =3D aux ? 1 : 0; i < 4; i++) { + idebus =3D &pci_ide->bus[i / 2]; + blk =3D idebus->ifs[i % 2].blk; + + if (blk && idebus->ifs[i % 2].drive_kind !=3D IDE_CD) { + if (!(i % 2)) { + idedev =3D idebus->master; + } else { + idedev =3D idebus->slave; + } + + blk_drain(blk); + blk_flush(blk); + + blk_detach_dev(blk, DEVICE(idedev)); + idebus->ifs[i % 2].blk =3D NULL; + idedev->conf.blk =3D NULL; + monitor_remove_blk(blk); + blk_unref(blk); + } + } + qdev_reset_all(dev); +} + static void unplug_disks(PCIBus *b, PCIDevice *d, void *opaque) { uint32_t flags =3D *(uint32_t *)opaque; @@ -147,7 +193,7 @@ static void unplug_disks(PCIBus *b, PCIDevice *d, void = *opaque) =20 switch (pci_get_word(d->config + PCI_CLASS_DEVICE)) { case PCI_CLASS_STORAGE_IDE: - pci_piix3_xen_ide_unplug(DEVICE(d), aux); + pci_xen_ide_unplug(DEVICE(d), aux); break; =20 case PCI_CLASS_STORAGE_SCSI: diff --git a/hw/ide/piix.c b/hw/ide/piix.c index bc1b37512a..9a9b28078e 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -173,52 +173,6 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error= **errp) } } =20 -/* - * The Xen HVM unplug protocol [1] specifies a mechanism to allow guests to - * request unplug of 'aux' disks (which is stated to mean all IDE disks, - * except the primary master). - * - * NOTE: The semantics of what happens if unplug of all disks and 'aux' di= sks - * is simultaneously requested is not clear. The implementation assu= mes - * that an 'all' request overrides an 'aux' request. - * - * [1] https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Ddocs/misc/= hvm-emulated-unplug.pandoc - */ -int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux) -{ - PCIIDEState *pci_ide; - int i; - IDEDevice *idedev; - IDEBus *idebus; - BlockBackend *blk; - - pci_ide =3D PCI_IDE(dev); - - for (i =3D aux ? 1 : 0; i < 4; i++) { - idebus =3D &pci_ide->bus[i / 2]; - blk =3D idebus->ifs[i % 2].blk; - - if (blk && idebus->ifs[i % 2].drive_kind !=3D IDE_CD) { - if (!(i % 2)) { - idedev =3D idebus->master; - } else { - idedev =3D idebus->slave; - } - - blk_drain(blk); - blk_flush(blk); - - blk_detach_dev(blk, DEVICE(idedev)); - idebus->ifs[i % 2].blk =3D NULL; - idedev->conf.blk =3D NULL; - monitor_remove_blk(blk); - blk_unref(blk); - } - } - qdev_reset_all(dev); - return 0; -} - static void pci_piix_ide_exitfn(PCIDevice *dev) { PCIIDEState *d =3D PCI_IDE(dev); diff --git a/include/hw/ide.h b/include/hw/ide.h index c5ce5da4f4..60f1f4f714 100644 --- a/include/hw/ide.h +++ b/include/hw/ide.h @@ -8,9 +8,6 @@ ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq, DriveInfo *hd0, DriveInfo *hd1); =20 -/* ide-pci.c */ -int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux); - /* ide-mmio.c */ void mmio_ide_init_drives(DeviceState *dev, DriveInfo *hd0, DriveInfo *hd1= ); =20 --=20 Anthony PERARD