From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>,
Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 10/13] Clean up pci_drive_hot_add()'s use of BlockInterfaceType
Date: Fri, 7 Dec 2012 12:39:09 +0100 [thread overview]
Message-ID: <1354880352-9597-11-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1354880352-9597-1-git-send-email-stefanha@redhat.com>
From: Markus Armbruster <armbru@redhat.com>
pci_drive_hot_add() parameter type has the wrong type: int instead of
BlockInterfaceType. It's actually redundant, so we can just drop it.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
hw/device-hotplug.c | 11 ++++-------
hw/pci-hotplug.c | 7 +++----
sysemu.h | 3 +--
3 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/hw/device-hotplug.c b/hw/device-hotplug.c
index eec0fe3..6d9c080 100644
--- a/hw/device-hotplug.c
+++ b/hw/device-hotplug.c
@@ -49,18 +49,16 @@ DriveInfo *add_init_drive(const char *optstr)
}
#if !defined(TARGET_I386)
-int pci_drive_hot_add(Monitor *mon, const QDict *qdict,
- DriveInfo *dinfo, int type)
+int pci_drive_hot_add(Monitor *mon, const QDict *qdict, DriveInfo *dinfo)
{
/* On non-x86 we don't do PCI hotplug */
- monitor_printf(mon, "Can't hot-add drive to type %d\n", type);
+ monitor_printf(mon, "Can't hot-add drive to type %d\n", dinfo->type);
return -1;
}
#endif
void drive_hot_add(Monitor *mon, const QDict *qdict)
{
- int type;
DriveInfo *dinfo = NULL;
const char *opts = qdict_get_str(qdict, "opts");
@@ -72,14 +70,13 @@ void drive_hot_add(Monitor *mon, const QDict *qdict)
monitor_printf(mon, "Parameter addr not supported\n");
goto err;
}
- type = dinfo->type;
- switch (type) {
+ switch (dinfo->type) {
case IF_NONE:
monitor_printf(mon, "OK\n");
break;
default:
- if (pci_drive_hot_add(mon, qdict, dinfo, type)) {
+ if (pci_drive_hot_add(mon, qdict, dinfo)) {
goto err;
}
}
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index 0ca5546..3bcfdcc 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -111,15 +111,14 @@ static int scsi_hot_add(Monitor *mon, DeviceState *adapter,
return 0;
}
-int pci_drive_hot_add(Monitor *mon, const QDict *qdict,
- DriveInfo *dinfo, int type)
+int pci_drive_hot_add(Monitor *mon, const QDict *qdict, DriveInfo *dinfo)
{
int dom, pci_bus;
unsigned slot;
PCIDevice *dev;
const char *pci_addr = qdict_get_str(qdict, "pci_addr");
- switch (type) {
+ switch (dinfo->type) {
case IF_SCSI:
if (pci_read_devaddr(mon, pci_addr, &dom, &pci_bus, &slot)) {
goto err;
@@ -135,7 +134,7 @@ int pci_drive_hot_add(Monitor *mon, const QDict *qdict,
}
break;
default:
- monitor_printf(mon, "Can't hot-add drive to type %d\n", type);
+ monitor_printf(mon, "Can't hot-add drive to type %d\n", dinfo->type);
goto err;
}
diff --git a/sysemu.h b/sysemu.h
index f5ac664..c1b370b 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -145,8 +145,7 @@ extern unsigned int nb_prom_envs;
/* pci-hotplug */
void pci_device_hot_add(Monitor *mon, const QDict *qdict);
-int pci_drive_hot_add(Monitor *mon, const QDict *qdict,
- DriveInfo *dinfo, int type);
+int pci_drive_hot_add(Monitor *mon, const QDict *qdict, DriveInfo *dinfo);
void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict);
/* generic hotplug */
--
1.8.0.1
next prev parent reply other threads:[~2012-12-07 11:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-07 11:38 [Qemu-devel] [PULL 00/13] Trivial patches for 2 to 7 November Stefan Hajnoczi
2012-12-07 11:39 ` [Qemu-devel] [PATCH 01/13] sd: Send debug printfery to stderr not stdout Stefan Hajnoczi
2012-12-07 11:39 ` [Qemu-devel] [PATCH 02/13] configure: Remove stray debug output Stefan Hajnoczi
2012-12-07 11:39 ` [Qemu-devel] [PATCH 03/13] Fix spelling (prefered -> preferred) Stefan Hajnoczi
2012-12-07 11:39 ` [Qemu-devel] [PATCH 04/13] Fix comments (adress -> address, layed -> laid, wierd -> weird) Stefan Hajnoczi
2012-12-07 11:39 ` [Qemu-devel] [PATCH 05/13] s390x: Spelling fixes (endianess -> endianness, occured -> occurred) Stefan Hajnoczi
2012-12-07 11:39 ` [Qemu-devel] [PATCH 06/13] target-alpha: Remove t0, t1 from CPUAlphaState Stefan Hajnoczi
2012-12-07 11:39 ` [Qemu-devel] [PATCH 07/13] target-m68k: Remove t1 from CPUM68KState Stefan Hajnoczi
2012-12-07 11:39 ` [Qemu-devel] [PATCH 08/13] target-sparc: Remove t0, t1 from CPUSPARCState Stefan Hajnoczi
2012-12-07 11:39 ` [Qemu-devel] [PATCH 09/13] arm: a9mpcore: remove un-used ptimer_iomem field Stefan Hajnoczi
2012-12-07 11:39 ` Stefan Hajnoczi [this message]
2012-12-07 11:39 ` [Qemu-devel] [PATCH 11/13] Fix spelling in comments and documentation Stefan Hajnoczi
2012-12-07 11:39 ` [Qemu-devel] [PATCH 12/13] qemu-options: Fix space at EOL Stefan Hajnoczi
2012-12-07 11:39 ` [Qemu-devel] [PATCH 13/13] pc_sysfw: Plug memory leak on pc_fw_add_pflash_drv() error path Stefan Hajnoczi
2012-12-10 16:58 ` [Qemu-devel] [PULL 00/13] Trivial patches for 2 to 7 November Anthony Liguori
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=1354880352-9597-11-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@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).