From: "Ján Tomko" <jtomko@redhat.com>
To: Julia Suvorova <jusual@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org, "Laine Stump" <laine@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>
Subject: Re: [PATCH] pcie_root_port: Add disable_hotplug option
Date: Tue, 18 Feb 2020 18:24:12 +0100 [thread overview]
Message-ID: <20200218172412.GB577946@lpt> (raw)
In-Reply-To: <20200218161717.386723-1-jusual@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2656 bytes --]
On Tue, Feb 18, 2020 at 05:17:17PM +0100, Julia Suvorova wrote:
>Make hot-plug/hot-unplug on PCIe Root Ports optional to allow libvirt
>to manage it and restrict unplug for the entire machine. This is going
>to prevent user-initiated unplug in guests (Windows mostly).
>Usage:
> -device pcie-root-port,disable-hotplug=true,...
>
>Discussion related:
> https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg00530.html
>
>Signed-off-by: Julia Suvorova <jusual@redhat.com>
>---
> hw/core/machine.c | 1 +
> hw/pci-bridge/pcie_root_port.c | 3 ++-
> hw/pci-bridge/xio3130_downstream.c | 2 +-
> hw/pci/pcie.c | 8 ++++++--
> include/hw/pci/pcie.h | 2 +-
> include/hw/pci/pcie_port.h | 1 +
> 6 files changed, 12 insertions(+), 5 deletions(-)
>
>diff --git a/hw/core/machine.c b/hw/core/machine.c
>index 84812a1d1c..5ff698ac3c 100644
>--- a/hw/core/machine.c
>+++ b/hw/core/machine.c
>@@ -36,6 +36,7 @@ GlobalProperty hw_compat_4_2[] = {
> { "usb-redir", "suppress-remote-wake", "off" },
> { "qxl", "revision", "4" },
> { "qxl-vga", "revision", "4" },
>+ { "pcie-root-port-base", "disable-hotplug", "false" },
> };
> const size_t hw_compat_4_2_len = G_N_ELEMENTS(hw_compat_4_2);
>
>diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c
>index 0ba4e4dea4..d6a080bee8 100644
>--- a/hw/pci-bridge/pcie_root_port.c
>+++ b/hw/pci-bridge/pcie_root_port.c
>@@ -94,7 +94,7 @@ static void rp_realize(PCIDevice *d, Error **errp)
>
> pcie_cap_arifwd_init(d);
> pcie_cap_deverr_init(d);
>- pcie_cap_slot_init(d, s->slot);
>+ pcie_cap_slot_init(d, s);
> pcie_cap_root_init(d);
>
> pcie_chassis_create(s->chassis);
>@@ -147,6 +147,7 @@ static Property rp_props[] = {
> DEFINE_PROP_BIT(COMPAT_PROP_PCP, PCIDevice, cap_present,
> QEMU_PCIE_SLTCAP_PCP_BITNR, true),
> DEFINE_PROP_BOOL("disable-acs", PCIESlot, disable_acs, false),
>+ DEFINE_PROP_BOOL("disable-hotplug", PCIESlot, disable_hotplug, false),
> DEFINE_PROP_END_OF_LIST()
> };
>
>diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
>index 153a4acad2..04aae72cd6 100644
>--- a/hw/pci-bridge/xio3130_downstream.c
>+++ b/hw/pci-bridge/xio3130_downstream.c
>@@ -94,7 +94,7 @@ static void xio3130_downstream_realize(PCIDevice *d, Error **errp)
> }
> pcie_cap_flr_init(d);
> pcie_cap_deverr_init(d);
>- pcie_cap_slot_init(d, s->slot);
>+ pcie_cap_slot_init(d, s);
> pcie_cap_arifwd_init(d);
>
The corresponding entry in xio3130_downstream_props[] is missing.
> pcie_chassis_create(s->chassis);
Jano
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2020-02-18 17:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-18 16:17 [PATCH] pcie_root_port: Add disable_hotplug option Julia Suvorova
2020-02-18 17:15 ` Igor Mammedov
2020-02-18 17:18 ` Laine Stump
2020-02-18 18:40 ` Julia Suvorova
2020-02-19 3:02 ` Laine Stump
2020-02-19 3:47 ` Michael S. Tsirkin
2020-02-19 12:21 ` Julia Suvorova
2020-02-21 15:45 ` Michael S. Tsirkin
2020-02-21 12:03 ` Daniel P. Berrangé
2020-02-18 17:24 ` Ján Tomko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200218172412.GB577946@lpt \
--to=jtomko@redhat.com \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=jusual@redhat.com \
--cc=laine@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).