From patchwork Tue Jan 28 18:57:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13953046 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F550C0218A for ; Tue, 28 Jan 2025 18:57:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcqm2-0006p3-Dk; Tue, 28 Jan 2025 13:57:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcqlw-0006oM-BM for qemu-devel@nongnu.org; Tue, 28 Jan 2025 13:57:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcqlu-0000k3-OO for qemu-devel@nongnu.org; Tue, 28 Jan 2025 13:57:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738090633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l5FbHGBl+0zBGytJJJxn/pmQWmcnl8/OQLZN/pvKkjg=; b=VimwZ+rNsoQNcMCQ9sT0ImeE1rKuK4cvboApiy3iUZtZgdnZrXKBARwZqqKDoQbQrkHTeV mi5EiJFHokgRbpfEgqEyN1i52zx6BSvjWHX1JBTVNRN6gWqneqktajwwsXRqFT3jFLUr9y m2ScD/dx3Ue2wUlgHbwndtsTwZQHMYU= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-549-6b4iiOXJM0G2aKhWWKNTPA-1; Tue, 28 Jan 2025 13:57:12 -0500 X-MC-Unique: 6b4iiOXJM0G2aKhWWKNTPA-1 X-Mimecast-MFC-AGG-ID: 6b4iiOXJM0G2aKhWWKNTPA Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-38a684a0971so2726824f8f.2 for ; Tue, 28 Jan 2025 10:57:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738090631; x=1738695431; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l5FbHGBl+0zBGytJJJxn/pmQWmcnl8/OQLZN/pvKkjg=; b=Zi8UdLEpUFMhIO6vjvCn06LRc/mXyEd5W7jWXJ87xTOL2zaaFU6EM20VF+O48H/T1z ud627RPSwMajfGx7w7QgpZfKkppAmgvrlCZyVg+To9QFyifoChzDlehGAQcUYqVkaNix UMrfKP/W59C2nixOrFMwF7ewsfsszAoS7ky3XppW80zlJkQkgo7lKq1y06SB06YNo9O7 4Ls5a5n49GsXcYiXqUcgR1CqCYy49j1KUwf54CxZ71vgEGpsHv/cSOLcbIxGnAqddZlp wYA/eIrHozk5yCj/biGs7dTGv1k8CjmI1fGWOMUb0IepLx8jR+PxnBCPJjcHUvNcqSlO WMvA== X-Gm-Message-State: AOJu0YzEy1uZLdPk0Bq2kORl0qNTzu/+xi9RXSh5uYTJmCz2j8gmdXsc ASf6UTmXFB/To4/ZHUbtKO5grFYR1ahqRetwQyiQyWTVWbPP0S4nBHDYiWeKiB3gvbeY/o7YdA9 5kOdS8m70+bxpdEgmTcMr/8H0etR5gL8iqiwljCZoq2UCZ9UXgeF0hMS4MOD1VjhjDGHWDsXJQK bzcm2oUjVfC+poq29DBQYBkowuHRCmwcWhYg4= X-Gm-Gg: ASbGnctGu6Noa62XLcpIK4gPNEqakRPmjbRn3bvWaBzDCwahdOO2hsRQ2YRglbcEETd prJoZNXt5Xg9wVdXqqlvDDVn1fJOjayjaO8awWoMv89vim/zcjAGYPAqBFUgv+4NjxstYcEylsR sDa088XF8mRyi+vZpqFQCS9Ut0by6FOiz1ZdsrKzPUzxkNY/1hdwyzyvXAg3fpd9zQiQeE4aZI2 PmH4wbmoxFBAMwWTpPEX2Rq7TF8NJ5gFhJ/CDe6C/EWgrOv8EUV0KCrd4UMj8fdeXVTozeuoM1R I20Ij1U4wO1SREi2wRL0NqwIn68vMT4OxofoW+rMZOm+jpB903Vy9TSEVzHY5DMaQg== X-Received: by 2002:a5d:6d86:0:b0:38b:ef22:d8c3 with SMTP id ffacd0b85a97d-38c5209395cmr155562f8f.35.1738090631561; Tue, 28 Jan 2025 10:57:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlbqXLRBeD5JrbGGp92zVuF3Tt4hGcMgt8SRuYnkIv6AGBUBh9tA5Gc+3vli+RhQ2n+7BFIg== X-Received: by 2002:a5d:6d86:0:b0:38b:ef22:d8c3 with SMTP id ffacd0b85a97d-38c5209395cmr155525f8f.35.1738090631116; Tue, 28 Jan 2025 10:57:11 -0800 (PST) Received: from localhost (p200300cbc73fce001be76d7f3cc3563d.dip0.t-ipconnect.de. [2003:cb:c73f:ce00:1be7:6d7f:3cc3:563d]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-38c2a17d74esm15252942f8f.37.2025.01.28.10.57.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jan 2025 10:57:10 -0800 (PST) From: David Hildenbrand To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, David Hildenbrand , Eduardo Habkost , Marcel Apfelbaum , Richard Henderson , Ilya Leoshkevich , Halil Pasic , Christian Borntraeger , Eric Farman , Thomas Huth , "Michael S. Tsirkin" , Cornelia Huck , Boris Fiuczynski , Michal Privoznik , Mario Casquero Subject: [PATCH v2 1/2] virtio-mem-pci: Allow setting nvectors, so we can use MSI-X Date: Tue, 28 Jan 2025 19:57:04 +0100 Message-ID: <20250128185705.1609038-2-david@redhat.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250128185705.1609038-1-david@redhat.com> References: <20250128185705.1609038-1-david@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=dhildenb@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.3, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Let's do it similar as virtio-balloon-pci. With this change, we can use virtio-mem-pci on s390x, although plugging will still fail until properly wired up in the machine. No need to worry about transitional/non_transitional devices, because they don't exist for virtio-mem. Signed-off-by: David Hildenbrand Reviewed-by: Thomas Huth --- hw/core/machine.c | 1 + hw/virtio/virtio-mem-pci.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index 8f396ef803..7b74cde10a 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -41,6 +41,7 @@ GlobalProperty hw_compat_9_2[] = { { "virtio-balloon-pci", "vectors", "0" }, { "virtio-balloon-pci-transitional", "vectors", "0" }, { "virtio-balloon-pci-non-transitional", "vectors", "0" }, + { "virtio-mem-pci", "vectors", "0" }, }; const size_t hw_compat_9_2_len = G_N_ELEMENTS(hw_compat_9_2); diff --git a/hw/virtio/virtio-mem-pci.c b/hw/virtio/virtio-mem-pci.c index 1b4e9a3284..6cc5f0fd3b 100644 --- a/hw/virtio/virtio-mem-pci.c +++ b/hw/virtio/virtio-mem-pci.c @@ -22,6 +22,10 @@ static void virtio_mem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) VirtIOMEMPCI *mem_pci = VIRTIO_MEM_PCI(vpci_dev); DeviceState *vdev = DEVICE(&mem_pci->vdev); + if (vpci_dev->nvectors == DEV_NVECTORS_UNSPECIFIED) { + vpci_dev->nvectors = 2; + } + virtio_pci_force_virtio_1(vpci_dev); qdev_realize(vdev, BUS(&vpci_dev->bus), errp); } @@ -152,6 +156,13 @@ static void virtio_mem_pci_set_requested_size(Object *obj, Visitor *v, object_property_set(OBJECT(&pci_mem->vdev), name, v, errp); } +static const Property virtio_mem_pci_class_properties[] = { + DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, + VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, + DEV_NVECTORS_UNSPECIFIED), +}; + static void virtio_mem_pci_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); @@ -164,6 +175,7 @@ static void virtio_mem_pci_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_MISC, dc->categories); pcidev_k->revision = VIRTIO_PCI_ABI_VERSION; pcidev_k->class_id = PCI_CLASS_OTHERS; + device_class_set_props(dc, virtio_mem_pci_class_properties); mdc->get_addr = virtio_mem_pci_get_addr; mdc->set_addr = virtio_mem_pci_set_addr; From patchwork Tue Jan 28 18:57:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13953048 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14696C02192 for ; Tue, 28 Jan 2025 18:58:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcqmF-0006rq-Kf; Tue, 28 Jan 2025 13:57:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcqlz-0006p6-En for qemu-devel@nongnu.org; Tue, 28 Jan 2025 13:57:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tcqlx-0000kT-UJ for qemu-devel@nongnu.org; Tue, 28 Jan 2025 13:57:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738090637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5r4VjtxsT+ISp+Ezj4VWQLthp0p3MA/bNODm6gM6dI8=; b=Y+rLag5dZVEOplcHaUkIeC24hVjcpWx6Eqoag4fQUbNEFlXTT2jIK7/NahV8QNk1TSZilk ibidxotY3CmmOB8WiCK24l1ZLDg958v4CTmqOxmqpZ3IZXZ66PN4ODZqCpMBvWh5GRMr/r tcmboDf0vy1DiFs9z7aKTYZ93tP0v2I= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-lO_DOY08McmZbOBI0hUyxA-1; Tue, 28 Jan 2025 13:57:15 -0500 X-MC-Unique: lO_DOY08McmZbOBI0hUyxA-1 X-Mimecast-MFC-AGG-ID: lO_DOY08McmZbOBI0hUyxA Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3860bc1d4f1so3635678f8f.2 for ; Tue, 28 Jan 2025 10:57:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738090634; x=1738695434; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5r4VjtxsT+ISp+Ezj4VWQLthp0p3MA/bNODm6gM6dI8=; b=Qj1avUxlcr6ILcsGkGEyMZE68dy6JoWNyqHctcUw/hQ6rvWK3Hlq7Phvm4ZgerFtR7 bvPvCMcpuJposTT0pS6pOkM+w/XWvTI6nck+LF+BH3GcOyrHguYL5tQRob+JLx0WNyRg iimqnq+kCNMfF3ipd4Ywa1Y0/Jze8ifCVEd/VNLekK7wUkoa95d/ChKDrdt755IBojw7 DVa/2vArAU7Jica/w3uU07weS6Ux94eVhDtv2i78qMg1IAiPDZscSpw0+53B4ahn8W1M 6xRUhmVHq585+17KJlnVlnWK+M34yGYiNsHRe/z0A02kTW0it1OoFJbWoe3u+GPvJZtU rgqw== X-Gm-Message-State: AOJu0YyH5W21UmjYlfIqUoqNRXNQYQSbozsVa/WskxmQQkiDQc3cyBrT ClSMpvyAmIdEKCnnMBCLrKXEWqTE7uiJs3tp6Pv8deUrfrvY7j78VezcQNGuCF+cvd9VunEPJVh CtYfwgY1Qqf97SiWKGjvi7JOcrGTmK2IUZrcHQBnlXewWTqqZ/3iGTkcrvujl+yjNiGDupl2+wc U+bKZlP3G3q44G0kqyp97y7JrNjZO2gaKooME= X-Gm-Gg: ASbGncujW596N9ZMvE+NqZvF83CBXMsWaJylHeTiaygj4BWPWImxRDeafZk++9s4Jrq MbiDnxq7hmYP4yHXLnU/d8uDwv9QEqrnMeAdLVO61O0eMxvxnmpx00d9hoElQzCMkPKBeERRMwX D6nel7V3A0c4vsEJbtEpgwmTmm+k9/zMJ8t4g9ZdBBeFJSPPtUHXNQ5sebkyKgvx0TV3yhdqxkm gO6FY5Oeas49xFjz7ZNbkAZ39wPSptRPxX2Gf3w4PTHrquF5Fs30FxaP7fVUuA8rDgahV22UmQy 0qShyuinoffCFk9VoIzNYI7T3AdiGbtkV9yDhUfc9Mt5UN4xlNRfXP8JQ8Sc4rOMWg== X-Received: by 2002:a05:6000:1f88:b0:385:e176:4420 with SMTP id ffacd0b85a97d-38c5194da70mr139236f8f.10.1738090634737; Tue, 28 Jan 2025 10:57:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IH9pQX8CoKHCCCA6Sd7jiAnyizjLVsWHWsEmtV0ur2kZWocXGbBR78Wb5PpMEKIg/B+Gr6wyg== X-Received: by 2002:a05:6000:1f88:b0:385:e176:4420 with SMTP id ffacd0b85a97d-38c5194da70mr139203f8f.10.1738090634320; Tue, 28 Jan 2025 10:57:14 -0800 (PST) Received: from localhost (p200300cbc73fce001be76d7f3cc3563d.dip0.t-ipconnect.de. [2003:cb:c73f:ce00:1be7:6d7f:3cc3:563d]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-38c2a1c4e49sm15089889f8f.98.2025.01.28.10.57.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jan 2025 10:57:13 -0800 (PST) From: David Hildenbrand To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, David Hildenbrand , Eduardo Habkost , Marcel Apfelbaum , Richard Henderson , Ilya Leoshkevich , Halil Pasic , Christian Borntraeger , Eric Farman , Thomas Huth , "Michael S. Tsirkin" , Cornelia Huck , Boris Fiuczynski , Michal Privoznik , Mario Casquero Subject: [PATCH v2 2/2] s390x/s390-virtio-ccw: Support plugging PCI-based virtio memory devices Date: Tue, 28 Jan 2025 19:57:05 +0100 Message-ID: <20250128185705.1609038-3-david@redhat.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250128185705.1609038-1-david@redhat.com> References: <20250128185705.1609038-1-david@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=dhildenb@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.3, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Let's just wire it up, unlocking virtio-mem-pci support on s390x. While at it, drop the "return;" in s390_machine_device_unplug_request(), to make it look like the other handlers. Reviewed-by: Thomas Huth Signed-off-by: David Hildenbrand --- hw/s390x/s390-virtio-ccw.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 3af613d4e9..71f3443a53 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -554,8 +554,7 @@ static void s390_machine_device_pre_plug(HotplugHandler *hotplug_dev, if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_CCW)) { virtio_ccw_md_pre_plug(VIRTIO_MD_CCW(dev), MACHINE(hotplug_dev), errp); } else if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_PCI)) { - error_setg(errp, - "PCI-attached virtio based memory devices not supported"); + virtio_md_pci_pre_plug(VIRTIO_MD_PCI(dev), MACHINE(hotplug_dev), errp); } } @@ -566,7 +565,8 @@ static void s390_machine_device_plug(HotplugHandler *hotplug_dev, if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { s390_cpu_plug(hotplug_dev, dev, errp); - } else if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_CCW)) { + } else if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_CCW) || + object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_PCI)) { /* * At this point, the device is realized and set all memdevs mapped, so * qemu_maxrampagesize() will pick up the page sizes of these memdevs @@ -580,7 +580,11 @@ static void s390_machine_device_plug(HotplugHandler *hotplug_dev, " initial memory"); return; } - virtio_ccw_md_plug(VIRTIO_MD_CCW(dev), MACHINE(hotplug_dev), errp); + if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_CCW)) { + virtio_ccw_md_plug(VIRTIO_MD_CCW(dev), MACHINE(hotplug_dev), errp); + } else { + virtio_md_pci_plug(VIRTIO_MD_PCI(dev), MACHINE(hotplug_dev), errp); + } } } @@ -589,10 +593,12 @@ static void s390_machine_device_unplug_request(HotplugHandler *hotplug_dev, { if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { error_setg(errp, "CPU hot unplug not supported on this machine"); - return; } else if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_CCW)) { virtio_ccw_md_unplug_request(VIRTIO_MD_CCW(dev), MACHINE(hotplug_dev), errp); + } else if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_PCI)) { + virtio_md_pci_unplug_request(VIRTIO_MD_PCI(dev), MACHINE(hotplug_dev), + errp); } } @@ -601,7 +607,9 @@ static void s390_machine_device_unplug(HotplugHandler *hotplug_dev, { if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_CCW)) { virtio_ccw_md_unplug(VIRTIO_MD_CCW(dev), MACHINE(hotplug_dev), errp); - } + } else if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_PCI)) { + virtio_md_pci_unplug(VIRTIO_MD_PCI(dev), MACHINE(hotplug_dev), errp); + } } static CpuInstanceProperties s390_cpu_index_to_props(MachineState *ms,