* [PATCH] hw/s390x: Attach default virtio-net devices to the /machine/virtual-css-bridge
@ 2024-07-01 20:01 Thomas Huth
2024-07-01 21:24 ` Cédric Le Goater
2024-07-02 4:45 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Huth @ 2024-07-01 20:01 UTC (permalink / raw)
To: qemu-devel, Halil Pasic, Christian Borntraeger, Eric Farman
Cc: qemu-s390x, Richard Henderson, David Hildenbrand,
Ilya Leoshkevich
The initial virtio-net-ccw devices currently do not have a proper parent
in the QOM tree, so they show up under /machine/unattached - which is
somewhat ugly. Let's attach them to /machine/virtual-css-bridge/virtual-css
instead.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/s390x/s390-virtio-ccw.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index cd063f8b64..0d58e5ab75 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -216,8 +216,11 @@ static void s390_init_ipl_dev(const char *kernel_filename,
static void s390_create_virtio_net(BusState *bus, const char *name)
{
DeviceState *dev;
+ int cnt = 0;
while ((dev = qemu_create_nic_device(name, true, "virtio"))) {
+ g_autofree char *childname = g_strdup_printf("%s[%d]", name, cnt++);
+ object_property_add_child(OBJECT(bus), childname, OBJECT(dev));
qdev_realize_and_unref(dev, bus, &error_fatal);
}
}
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/s390x: Attach default virtio-net devices to the /machine/virtual-css-bridge
2024-07-01 20:01 [PATCH] hw/s390x: Attach default virtio-net devices to the /machine/virtual-css-bridge Thomas Huth
@ 2024-07-01 21:24 ` Cédric Le Goater
2024-07-02 4:45 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Cédric Le Goater @ 2024-07-01 21:24 UTC (permalink / raw)
To: Thomas Huth, qemu-devel, Halil Pasic, Christian Borntraeger,
Eric Farman
Cc: qemu-s390x, Richard Henderson, David Hildenbrand,
Ilya Leoshkevich
On 7/1/24 10:01 PM, Thomas Huth wrote:
> The initial virtio-net-ccw devices currently do not have a proper parent
> in the QOM tree, so they show up under /machine/unattached - which is
> somewhat ugly. Let's attach them to /machine/virtual-css-bridge/virtual-css
> instead.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
> hw/s390x/s390-virtio-ccw.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index cd063f8b64..0d58e5ab75 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -216,8 +216,11 @@ static void s390_init_ipl_dev(const char *kernel_filename,
> static void s390_create_virtio_net(BusState *bus, const char *name)
> {
> DeviceState *dev;
> + int cnt = 0;
>
> while ((dev = qemu_create_nic_device(name, true, "virtio"))) {
> + g_autofree char *childname = g_strdup_printf("%s[%d]", name, cnt++);
> + object_property_add_child(OBJECT(bus), childname, OBJECT(dev));
> qdev_realize_and_unref(dev, bus, &error_fatal);
> }
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/s390x: Attach default virtio-net devices to the /machine/virtual-css-bridge
2024-07-01 20:01 [PATCH] hw/s390x: Attach default virtio-net devices to the /machine/virtual-css-bridge Thomas Huth
2024-07-01 21:24 ` Cédric Le Goater
@ 2024-07-02 4:45 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-07-02 4:45 UTC (permalink / raw)
To: Thomas Huth, qemu-devel, Halil Pasic, Christian Borntraeger,
Eric Farman
Cc: qemu-s390x, Richard Henderson, David Hildenbrand,
Ilya Leoshkevich
On 1/7/24 22:01, Thomas Huth wrote:
> The initial virtio-net-ccw devices currently do not have a proper parent
> in the QOM tree, so they show up under /machine/unattached - which is
> somewhat ugly. Let's attach them to /machine/virtual-css-bridge/virtual-css
> instead.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> hw/s390x/s390-virtio-ccw.c | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-02 4:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01 20:01 [PATCH] hw/s390x: Attach default virtio-net devices to the /machine/virtual-css-bridge Thomas Huth
2024-07-01 21:24 ` Cédric Le Goater
2024-07-02 4:45 ` Philippe Mathieu-Daudé
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).