Skip to content

Remove some qdev_get_machine() calls from CONFIG_USER_ONLY

Eduardo Habkost qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4machine: Move gpio code to hw/core/gpio.chw/core/Makefile.objs hw/core/gpio.c hw/core/qdev.c+207 -1841 reply
2/4move qdev hotplug code to qdev-hotplug.chw/core/Makefile.objs hw/core/bus.c hw/core/qdev-hotplug.c +1 more+70 -470 replies
3/4qdev: Don't compile hotplug code in user-mode emulationhw/core/Makefile.objs hw/core/qdev-hotplug-stubs.c tests/Makefile.include+50 -32 replies
4/4qdev-hotplug: Don't check type of qdev_get_machine()hw/core/qdev-hotplug.c+4 -91 reply

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-Daudé
1/4R-b T-b
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/4] Remove some qdev_get_machine() calls from CONFIG_USER_ONLY

This series moves some qdev code outside qdev.o, so it can be compiled only in CONFIG_SOFTMMU.

The code being moved includes two qdev_get_machine() calls, so this will make it easier to move qdev_get_machine() to CONFIG_SOFTMMU later.

After this series, there's one remaining qdev_get_machine() call that seems more difficult to remove:

    static void device_set_realized(Object *obj, bool value, Error **errp)
    {
        /* [...] */
        if (!obj->parent) {
            gchar *name = g_strdup_printf("device[%d]", unattached_count++);

            object_property_add_child(container_get(qdev_get_machine(),
                                                    "/unattached"),
                                      name, obj, &error_abort);
            unattached_parent = true;
            g_free(name);
        }
        /* [...] */
    }

This one is tricky because on system emulation mode it needs "/machine" to already exist, but in user-only mode it needs to implicitly create a "/machine" container.

Eduardo Habkost (4):
machine: Move gpio code to hw/core/gpio.c
move qdev hotplug code to qdev-hotplug.c
qdev: Don't compile hotplug code in user-mode emulation
qdev-hotplug: Don't check type of qdev_get_machine()

 hw/core/bus.c                |  11 --
 hw/core/gpio.c               | 206 ++++++++++++++++++++++++++++++++
 hw/core/qdev-hotplug-stubs.c |  44 +++++++
 hw/core/qdev-hotplug.c       |  64 ++++++++++
 hw/core/qdev.c               | 219 -----------------------------------
 hw/core/Makefile.objs        |   5 +-
 tests/Makefile.include       |   3 +-
 7 files changed, 320 insertions(+), 232 deletions(-)
 create mode 100644 hw/core/gpio.c
 create mode 100644 hw/core/qdev-hotplug-stubs.c
 create mode 100644 hw/core/qdev-hotplug.c
Signature · 1 line
2.18.0.rc1.1.g3f1ff2140