From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 4/9] Convert virtio_init_pci() to pci_register_device_2()
Date: Thu, 22 Jan 2009 20:31:00 +0100 [thread overview]
Message-ID: <1232652665-1710-4-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <87ocxzrvqb.fsf@pike.pond.sub.org>
From: Markus Armbruster <armbru@pond.sub.org>
This is in preparation of pci=... support for virtio devices.
---
hw/virtio-balloon.c | 2 +-
hw/virtio-blk.c | 2 +-
hw/virtio-console.c | 2 +-
hw/virtio-net.c | 3 ++-
hw/virtio.c | 5 ++---
hw/virtio.h | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c
index 0765516..0b9f7c9 100644
--- a/hw/virtio-balloon.c
+++ b/hw/virtio-balloon.c
@@ -171,7 +171,7 @@ void *virtio_balloon_init(PCIBus *bus)
{
VirtIOBalloon *s;
- s = (VirtIOBalloon *)virtio_init_pci(bus, "virtio-balloon",
+ s = (VirtIOBalloon *)virtio_init_pci("virtio-balloon", "",
PCI_VENDOR_ID_REDHAT_QUMRANET,
PCI_DEVICE_ID_VIRTIO_BALLOON,
0, VIRTIO_ID_BALLOON,
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index e654cc5..f3a0dcb 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -224,7 +224,7 @@ void *virtio_blk_init(PCIBus *bus, BlockDriverState *bs)
int cylinders, heads, secs;
static int virtio_blk_id;
- s = (VirtIOBlock *)virtio_init_pci(bus, "virtio-blk",
+ s = (VirtIOBlock *)virtio_init_pci("virtio-blk", "",
PCI_VENDOR_ID_REDHAT_QUMRANET,
PCI_DEVICE_ID_VIRTIO_BLOCK,
0, VIRTIO_ID_BLOCK,
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index deae76d..77ac940 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -125,7 +125,7 @@ void *virtio_console_init(PCIBus *bus, CharDriverState *chr)
{
VirtIOConsole *s;
- s = (VirtIOConsole *)virtio_init_pci(bus, "virtio-console",
+ s = (VirtIOConsole *)virtio_init_pci("virtio-console", "",
6900, 0x1003,
0, VIRTIO_ID_CONSOLE,
0x03, 0x80, 0x00,
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 54c0030..3c7afb6 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -320,7 +320,8 @@ void virtio_net_init(PCIBus *bus, NICInfo *nd, int devfn)
VirtIONet *n;
static int virtio_net_id;
- n = (VirtIONet *)virtio_init_pci(bus, "virtio-net", 6900, 0x1000,
+ n = (VirtIONet *)virtio_init_pci("virtio-net", "",
+ 6900, 0x1000,
0, VIRTIO_ID_NET,
0x02, 0x00, 0x00,
sizeof(struct virtio_net_config),
diff --git a/hw/virtio.c b/hw/virtio.c
index dba80f8..c721c2a 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -805,7 +805,7 @@ void virtio_load(VirtIODevice *vdev, QEMUFile *f)
virtio_update_irq(vdev);
}
-VirtIODevice *virtio_init_pci(PCIBus *bus, const char *name,
+VirtIODevice *virtio_init_pci(const char *name, const char *opts,
uint16_t vendor, uint16_t device,
uint16_t subvendor, uint16_t subdevice,
uint8_t class_code, uint8_t subclass_code,
@@ -817,8 +817,7 @@ VirtIODevice *virtio_init_pci(PCIBus *bus, const char *name,
uint8_t *config;
uint32_t size;
- pci_dev = pci_register_device(bus, name, struct_size,
- -1, NULL, NULL);
+ pci_dev = pci_register_device_2(name, opts, struct_size, NULL, NULL);
if (!pci_dev)
return NULL;
diff --git a/hw/virtio.h b/hw/virtio.h
index 83511e2..18913fb 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -89,7 +89,7 @@ struct VirtIODevice
VirtQueue *vq;
};
-VirtIODevice *virtio_init_pci(PCIBus *bus, const char *name,
+VirtIODevice *virtio_init_pci(const char *name, const char *opts,
uint16_t vendor, uint16_t device,
uint16_t subvendor, uint16_t subdevice,
uint8_t class_code, uint8_t subclass_code,
--
1.6.0.6
next prev parent reply other threads:[~2009-01-22 19:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-22 19:23 [Qemu-devel] [RFC PATCH 0/9] Configurable PCI device addresses Markus Armbruster
2009-01-22 19:30 ` [Qemu-devel] [PATCH 1/9] PCI device registration helpers Markus Armbruster
2009-01-22 19:30 ` [Qemu-devel] [PATCH 2/9] Clean up handling of name=value, ... part of -vga option argument Markus Armbruster
2009-01-22 19:30 ` [Qemu-devel] [PATCH 3/9] Support pci=... in option argument of -vga Markus Armbruster
2009-01-22 19:31 ` Markus Armbruster [this message]
2009-01-22 19:31 ` [Qemu-devel] [PATCH 5/9] Support pci=... in option argument of -net nic Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 6/9] Make drives_opt[] accessible from device initialization Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 7/9] Support pci=... in option argument of -drive if=virtio Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 8/9] New option -audio as a more flexible alternative to -soundhw Markus Armbruster
2009-01-22 22:03 ` malc
2009-01-23 8:32 ` Markus Armbruster
2009-01-23 9:29 ` Kevin Wolf
2009-01-23 10:04 ` Markus Armbruster
2009-01-23 10:24 ` Kevin Wolf
2009-01-23 11:51 ` Markus Armbruster
2009-01-22 19:31 ` [Qemu-devel] [PATCH 9/9] Support pci=... in option argument of -audio Markus Armbruster
2009-01-22 20:06 ` [Qemu-devel] [RFC PATCH 0/9] Configurable PCI device addresses Anthony Liguori
2009-01-23 9:04 ` Markus Armbruster
2009-01-23 10:23 ` Daniel P. Berrange
2009-01-23 19:06 ` Paul Brook
2009-01-23 19:28 ` Anthony Liguori
2009-01-26 8:55 ` Markus Armbruster
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=1232652665-1710-4-git-send-email-armbru@redhat.com \
--to=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).