From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Anthony Liguori" <aliguori@us.ibm.com>,
"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
"Luiz Capitulino" <lcapitulino@redhat.com>,
"Joel Schopp" <jschopp@linux.vnet.ibm.com>,
=?UTF-8?q?Herv=C3=A9=20Poussineau?= <hpoussin@reactos.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
=?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>,
"David Gibson" <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL v2 11/21] pci: Cleanup configuration for pci-hotplug.c
Date: Tue, 25 Jun 2013 18:41:24 +0300 [thread overview]
Message-ID: <1372174719-6564-12-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1372174719-6564-1-git-send-email-mst@redhat.com>
From: David Gibson <david@gibson.dropbear.id.au>
pci-hotplug.c and the CONFIG_PCI_HOTPLUG variable which controls its
compilation are misnamed. They're not about PCI hotplug in general, but
rather about the pci_add/pci_del interface which are now deprecated in
favour of the more general device_add/device_del interface. This patch
therefore renames them to pci-hotplug-old.c and CONFIG_PCI_HOTPLUG_OLD.
CONFIG_PCI_HOTPLUG=y was listed twice in {i386,x86_64}-softmmu.make for no
particular reason, so we clean that up too. In addition it was included in
ppc64-softmmu.mak for which the old hotplug interface was never used and is
unsuitable, so we remove that too.
Most of pci-hotplug.c was additionaly protected by #ifdef TARGET_I386. The
small piece which wasn't is only called from the pci_add and pci_del hooks
in hmp-commands.hx, which themselves were protected by #ifdef TARGET_I386.
This patch therefore also removes the #ifdef from pci-hotplug-old.c,
and changes the ifdefs in hmp-commands.hx to use CONFIG_PCI_HOTPLUG_OLD.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
default-configs/i386-softmmu.mak | 3 +--
default-configs/ppc64-softmmu.mak | 2 --
default-configs/x86_64-softmmu.mak | 3 +--
hmp-commands.hx | 4 ++--
hw/pci/Makefile.objs | 2 +-
hw/pci/{pci-hotplug.c => pci-hotplug-old.c} | 6 +++---
6 files changed, 8 insertions(+), 12 deletions(-)
rename hw/pci/{pci-hotplug.c => pci-hotplug-old.c} (98%)
diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index 03deca2..4a0fc9c 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -28,11 +28,10 @@ CONFIG_APPLESMC=y
CONFIG_I8259=y
CONFIG_PFLASH_CFI01=y
CONFIG_TPM_TIS=$(CONFIG_TPM)
-CONFIG_PCI_HOTPLUG=y
+CONFIG_PCI_HOTPLUG_OLD=y
CONFIG_MC146818RTC=y
CONFIG_PAM=y
CONFIG_PCI_PIIX=y
-CONFIG_PCI_HOTPLUG=y
CONFIG_WDT_IB700=y
CONFIG_PC_SYSFW=y
CONFIG_XEN_I386=$(CONFIG_XEN)
diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak
index 884ea8a..d7140c4 100644
--- a/default-configs/ppc64-softmmu.mak
+++ b/default-configs/ppc64-softmmu.mak
@@ -44,7 +44,5 @@ CONFIG_XILINX_ETHLITE=y
CONFIG_OPENPIC=y
CONFIG_PSERIES=$(CONFIG_FDT)
CONFIG_E500=$(CONFIG_FDT)
-# For pSeries
-CONFIG_PCI_HOTPLUG=y
# For PReP
CONFIG_MC146818RTC=y
diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
index 599b630..10bb0c6 100644
--- a/default-configs/x86_64-softmmu.mak
+++ b/default-configs/x86_64-softmmu.mak
@@ -28,11 +28,10 @@ CONFIG_APPLESMC=y
CONFIG_I8259=y
CONFIG_PFLASH_CFI01=y
CONFIG_TPM_TIS=$(CONFIG_TPM)
-CONFIG_PCI_HOTPLUG=y
+CONFIG_PCI_HOTPLUG_OLD=y
CONFIG_MC146818RTC=y
CONFIG_PAM=y
CONFIG_PCI_PIIX=y
-CONFIG_PCI_HOTPLUG=y
CONFIG_WDT_IB700=y
CONFIG_PC_SYSFW=y
CONFIG_XEN_I386=$(CONFIG_XEN)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 915b0d1..d1cdcfb 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1077,7 +1077,7 @@ STEXI
Add drive to PCI storage controller.
ETEXI
-#if defined(TARGET_I386)
+#if defined(CONFIG_PCI_HOTPLUG_OLD)
{
.name = "pci_add",
.args_type = "pci_addr:s,type:s,opts:s?",
@@ -1093,7 +1093,7 @@ STEXI
Hot-add PCI device.
ETEXI
-#if defined(TARGET_I386)
+#if defined(CONFIG_PCI_HOTPLUG_OLD)
{
.name = "pci_del",
.args_type = "pci_addr:s",
diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
index a7fb9d0..720f438 100644
--- a/hw/pci/Makefile.objs
+++ b/hw/pci/Makefile.objs
@@ -8,4 +8,4 @@ common-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o
common-obj-$(CONFIG_NO_PCI) += pci-stub.o
common-obj-$(CONFIG_ALL) += pci-stub.o
-obj-$(CONFIG_PCI_HOTPLUG) += pci-hotplug.o
+common-obj-$(CONFIG_PCI_HOTPLUG_OLD) += pci-hotplug-old.o
diff --git a/hw/pci/pci-hotplug.c b/hw/pci/pci-hotplug-old.c
similarity index 98%
rename from hw/pci/pci-hotplug.c
rename to hw/pci/pci-hotplug-old.c
index 12287d1..b3c233c 100644
--- a/hw/pci/pci-hotplug.c
+++ b/hw/pci/pci-hotplug-old.c
@@ -1,5 +1,7 @@
/*
- * QEMU PCI hotplug support
+ * Deprecated PCI hotplug interface support
+ * This covers the old pci_add / pci_del command, whereas the more general
+ * device_add / device_del commands are now preferred.
*
* Copyright (c) 2004 Fabrice Bellard
*
@@ -34,7 +36,6 @@
#include "sysemu/blockdev.h"
#include "qapi/error.h"
-#if defined(TARGET_I386)
static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon,
const char *devaddr,
const char *opts_str)
@@ -257,7 +258,6 @@ void pci_device_hot_add(Monitor *mon, const QDict *qdict)
} else
monitor_printf(mon, "failed to add %s\n", opts);
}
-#endif
static int pci_device_hot_remove(Monitor *mon, const char *pci_addr)
{
--
MST
next prev parent reply other threads:[~2013-06-25 15:41 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-25 15:40 [Qemu-devel] [PULL v2 00/21] pci,kvm,misc enhancements Michael S. Tsirkin
2013-06-25 15:40 ` [Qemu-devel] [PULL v2 01/21] range: add Range structure Michael S. Tsirkin
2013-06-25 15:40 ` [Qemu-devel] [PULL v2 03/21] pc: pass PCI hole ranges to Guests Michael S. Tsirkin
2013-06-25 15:40 ` [Qemu-devel] [PULL v2 04/21] pc_piix: cleanup init compat handling Michael S. Tsirkin
2013-06-25 15:40 ` [Qemu-devel] [PULL v2 05/21] e1000: cleanup process_tx_desc Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 06/21] kvm: zero-initialize KVM_SET_GSI_ROUTING input Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 07/21] kvm: skip system call when msi route is unchanged Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 08/21] MAINTAINERS: s/Marcelo/Paolo/ Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 09/21] pvpanic: initialization cleanup Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 10/21] pvpanic: fix fwcfg for big endian hosts Michael S. Tsirkin
2013-06-25 15:41 ` Michael S. Tsirkin [this message]
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 12/21] pci: Move pci_read_devaddr to pci-hotplug-old.c Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 13/21] pci: Abolish pci_find_root_bus() Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 14/21] pci: Use helper to find device's root bus in pci_find_domain() Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 15/21] pci: Replace pci_find_domain() with more general pci_root_bus_path() Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 16/21] pci: Add root bus argument to pci_get_bus_devfn() Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 17/21] pci: Add root bus parameter to pci_nic_init() Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 18/21] pci: Simpler implementation of primary PCI bus Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 19/21] pci: Remove domain from PCIHostBus Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 20/21] pci: Fold host_buses list into PCIHostState functionality Michael S. Tsirkin
2013-06-25 15:41 ` [Qemu-devel] [PULL v2 21/21] net: add support of mac-programming over macvtap in QEMU side Michael S. Tsirkin
2013-06-28 13:45 ` Eric Blake
2013-06-25 15:42 ` [Qemu-devel] [PULL v2 02/21] pci: store PCI hole ranges in guestinfo structure Michael S. Tsirkin
2013-06-25 21:48 ` [Qemu-devel] [PULL v2 00/21] pci,kvm,misc enhancements Anthony Liguori
2013-06-28 14:06 ` Eric Blake
2013-06-28 17:26 ` Markus Armbruster
2013-06-28 17:25 ` Markus Armbruster
2013-06-28 17:44 ` Anthony Liguori
2013-07-04 8:59 ` Michael S. Tsirkin
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=1372174719-6564-12-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=hpoussin@reactos.org \
--cc=jschopp@linux.vnet.ibm.com \
--cc=lcapitulino@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.vnet.ibm.com \
/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).