virtio-net failover cleanup and new features
v2 cover virtio-net failover cleanup and new features
v2: add helpers to manage the list of hidden devices rather
than relying on the command line parameters
Hide VFIO device if it is plugged before the virtio-net one
This series moves the code used by virtio-net failover from the virtio-net device to the PCI subsystem.
Doing that, we can use failover with a regular QEMU PCI device (we can add the function call to unregister the ROM vmstate) and we can also use this code to unplug a PCI card before migration and plug it back after migration without using a failover device (of course, connectivity is lost during all the migration). In contrary of failover, this does not need support from the guest system to work.
Laurent Vivier (8):
qdev: add an Error parameter to the DeviceListener hide_device()
function
qdev/qbus: remove failover specific code
failover: virtio-net: remove failover_primary_hidden flag
failover: pci: move failover hotplug/unplug code into pci subsystem
failover: hide the PCI device if the virtio-net device is not present
failover: pci: unregister ROM on unplug
pci: automatically unplug a PCI card before migration
failover: qemu-opts: manage hidden device list
include/hw/pci/pci.h | 5 + include/hw/qdev-core.h | 6 +- include/hw/virtio/virtio-net.h | 4 - include/hw/virtio/virtio.h | 1 - include/qemu/option.h | 4 + hw/core/qdev.c | 5 +- hw/net/virtio-net.c | 149 +------------------- hw/pci/pci.c | 242 +++++++++++++++++++++++++++++++-- hw/vfio/pci.c | 2 +- softmmu/qdev-monitor.c | 14 +- util/qemu-option.c | 82 +++++++++++ 11 files changed, 338 insertions(+), 176 deletions(-)
Signature · 1 line
2.31.1
RFC PATCH v2 1/8 qdev: add an Error parameter to the DeviceListener hide_device() function
This allows an error to be reported to the caller of qdev_device_add()
--- include/hw/qdev-core.h | 6 ++++-- hw/core/qdev.c | 4 ++-- hw/net/virtio-net.c | 2 +- softmmu/qdev-monitor.c | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-)
include/hw/qdev-core.h +4 -2
@@ -202,7 +202,8 @@ struct DeviceListener {* hide a failover device depending for example on the device * opts. */ -bool (*hide_device)(DeviceListener *listener,QemuOpts *device_opts); +bool (*hide_device)(DeviceListener *listener,QemuOpts *device_opts, +Error **errp);QTAILQ_ENTRY (DeviceListener) link; };
@@ -804,12 +805,13 @@ void device_listener_unregister(DeviceListener *listener);/** * @qdev_should_hide_device: * @opts: QemuOpts as passed on cmdline. +* @errp: pointer to error object * * Check if a device should be added. * When a device is added via qdev_device_add() this will be called, * and return if the device should be added now or not. */ -bool qdev_should_hide_device (QemuOpts *opts); +bool qdev_should_hide_device (QemuOpts *opts,Error **errp); typedef enum MachineInitPhase { /* current_machine is NULL. */
hw/core/qdev.c +2 -2
@@ -211,13 +211,13 @@ void device_listener_unregister(DeviceListener *listener)QTAILQ_REMOVE (&device_listeners, listener, link); } -bool qdev_should_hide_device (QemuOpts *opts) +bool qdev_should_hide_device (QemuOpts *opts,Error **errp) {DeviceListener *listener; QTAILQ_FOREACH(listener, &device_listeners, link) {if (listener->hide_device) { -if (listener->hide_device (listener, opts)) { +if (listener->hide_device (listener, opts, errp)) {return true; } }
hw/net/virtio-net.c +1 -1
@@ -3279,7 +3279,7 @@ static void virtio_net_migration_state_notifier(Notifier *notifier, void *data) }static bool failover_hide_primary_device (DeviceListener *listener, -QemuOpts *device_opts) +QemuOpts *device_opts,Error **errp) {VirtIONet *n =container_of (listener, VirtIONet, primary_listener);const char *standby_id;
softmmu/qdev-monitor.c +2 -2
@@ -627,8 +627,8 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)error_setg (errp,"Device with failover_pair_id don't have id" );return NULL ; } -if (qdev_should_hide_device (opts)) { -if (bus && !qbus_is_hotpluggable (bus)) { +if (qdev_should_hide_device (opts, errp)) { +if (errp && !*errp && bus && !qbus_is_hotpluggable (bus)) {error_setg (errp,QERR_BUS_NO_HOTPLUG , bus->name); }return NULL ;
Signature · 1 line
2.31.1
Re: [RFC PATCH v2 1/8] qdev: add an Error parameter to the DeviceListener hide_device() function
Laurent Vivier <[email protected]> wrote:
D> This allows an error to be reported to the caller of qdev_device_add()
Quoted 2 lines
Signed-off-by Laurent Vivier <[email protected]>
RFC PATCH v2 2/8 qdev/qbus: remove failover specific code
In reply to Laurent VivierCommit f3a850565693 ("qdev/qbus: add hidden device support") has introduced a generic way to hide a device but it has modified qdev_device_add() to check a specific option of the failover device, "failover_pair_id", before calling the generic mechanism.
It's not needed (and not generic) to do that in qdev_device_add() because this is also checked by the failover_hide_primary_device() function that uses the generic mechanism to hide the device.
--- hw/net/virtio-net.c | 7 +++++++ softmmu/qdev-monitor.c | 14 ++++---------- 2 files changed, 11 insertions(+), 10 deletions(-)
hw/net/virtio-net.c +7 -0
@@ -3288,6 +3288,13 @@ static bool failover_hide_primary_device(DeviceListener *listener,return false; } standby_id =qemu_opt_get (device_opts,"failover_pair_id" ); +if (standby_id ==NULL ) { +return false; + } +if (device_opts->id ==NULL ) { +error_setg (errp,"Device with failover_pair_id don't have id" ); +return true; + }if (g_strcmp0 (standby_id, n->netclient_name) !=0 ) {return false; }
softmmu/qdev-monitor.c +4 -10
@@ -622,17 +622,11 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp) } } -if (qemu_opt_get (opts,"failover_pair_id" )) { -if (!opts->id) { -error_setg (errp,"Device with failover_pair_id don't have id" ); -return NULL ; - } -if (qdev_should_hide_device (opts, errp)) { -if (errp && !*errp && bus && !qbus_is_hotpluggable (bus)) { -error_setg (errp,QERR_BUS_NO_HOTPLUG , bus->name); - } -return NULL ; +if (qdev_should_hide_device (opts, errp)) { +if (errp && !*errp && bus && !qbus_is_hotpluggable (bus)) { +error_setg (errp,QERR_BUS_NO_HOTPLUG , bus->name); } +return NULL ; }if (phase_check (PHASE_MACHINE_READY ) && bus && !qbus_is_hotpluggable (bus)) {
Signature · 1 line
2.31.1
Re: [RFC PATCH v2 2/8] qdev/qbus: remove failover specific code
Quoted 11 lines · Laurent Vivier
Commit
f3a850565693("qdev/qbus: add hidden device support") has introduced a generic way to hide a device but it has modifiedqdev_device_add()to check a specific option of the failover device, "failover_pair_id", before calling the generic mechanism.It's not needed (and not generic) to do that in
qdev_device_add()because this is also checked by thefailover_hide_primary_device()function that uses the generic mechanism to hide the device.Cc Jens Freimann <[email protected]>Signed-off-by Laurent Vivier <[email protected]>
I see why you want this change. It was done the other way to make sure that we only tried to hide the divec is there is a failover_pair_id property. You can't have both.
RFC PATCH v2 3/8 failover: virtio-net: remove failover_primary_hidden flag
In reply to Laurent VivierWe dont't need a flag to know if the primary device must be hidden, we can rely on the machine state:
Device is hidden if the machine is in prelaunch state (src) or in inmigrate state with migration status set to none (dst). We don't need to check the flag in virtio_net_handle_migration_primary() because this function is only registered if the failover is enabled and the flag also set to false. This function also sets it back to true after a successful unplug during the migration but we don't need to know it is hidden because nothing will try to plug it back after the migration (except in case of error but the flag is set back to false).
--- include/hw/virtio/virtio-net.h | 2 -- hw/net/virtio-net.c | 25 +++++++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-)
include/hw/virtio/virtio-net.h +0 -2
@@ -205,8 +205,6 @@ struct VirtIONet {AnnounceTimer announce_timer;bool needs_vnet_hdr_swap;bool mtu_bypass_backend; -/* primary failover device is hidden*/ -bool failover_primary_hidden;bool failover;DeviceListener primary_listener;Notifier migration_state;
hw/net/virtio-net.c +15 -10
@@ -36,8 +36,10 @@#include "qapi/qapi-types-migration.h" #include "qapi/qapi-events-migration.h" #include "hw/virtio/virtio-access.h" +#include "migration/migration.h" #include "migration/misc.h" #include "standard-headers/linux/ethtool.h" +#include "sysemu/runstate.h" #include "sysemu/sysemu.h" #include "trace.h" #include "monitor/qdev.h"
@@ -937,7 +939,6 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features)if (virtio_has_feature (features,VIRTIO_NET_F_STANDBY )) {qapi_event_send_failover_negotiated (n->netclient_name); -qatomic_set (&n->failover_primary_hidden, false);failover_add_primary (n, &err);if (err) {warn_report_err (err);
@@ -3225,7 +3226,6 @@ static bool failover_replug_primary(VirtIONet *n, DeviceState *dev,return false; }qdev_set_parent_bus (dev, primary_bus, &error_abort); -qatomic_set (&n->failover_primary_hidden, false); hotplug_ctrl =qdev_get_hotplug_handler (dev);if (hotplug_ctrl) {hotplug_handler_pre_plug (hotplug_ctrl, dev, &err);
@@ -3243,7 +3243,6 @@ out:static void virtio_net_handle_migration_primary (VirtIONet *n,MigrationState *s) { -bool should_be_hidden;Error *err =NULL ;DeviceState *dev =failover_find_primary_device (n);
@@ -3251,13 +3250,10 @@ static void virtio_net_handle_migration_primary(VirtIONet *n, MigrationState *s)return ; } - should_be_hidden =qatomic_read (&n->failover_primary_hidden); - -if (migration_in_setup (s) && !should_be_hidden) { +if (migration_in_setup (s)) {if (failover_unplug_primary (n, dev)) {vmstate_unregister (VMSTATE_IF (dev),qdev_get_vmsd (dev), dev);qapi_event_send_unplug_primary (dev->id); -qatomic_set (&n->failover_primary_hidden, true); }else {warn_report ("couldn't unplug primary device" ); }
@@ -3299,8 +3295,18 @@ static bool failover_hide_primary_device(DeviceListener *listener,return false; } -/* failover_primary_hidden is set during feature negotiation */ -return qatomic_read (&n->failover_primary_hidden); +if (runstate_check (RUN_STATE_PRELAUNCH )) { +/* hide the failover primary on src on startup */ +return true; + } + +if (runstate_check (RUN_STATE_INMIGRATE ) && +migration_incoming_get_current ()->state ==MIGRATION_STATUS_NONE ) { +/* hide the failover primary on dest on startup */ +return true; + } + +return false; }static void virtio_net_device_realize (DeviceState *dev,Error **errp)
@@ -3338,7 +3344,6 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)if (n->failover) { n->primary_listener.hide_device = failover_hide_primary_device; -qatomic_set (&n->failover_primary_hidden, true);device_listener_register (&n->primary_listener); n->migration_state.notify = virtio_net_migration_state_notifier;add_migration_state_change_notifier (&n->migration_state);
Signature · 1 line
2.31.1
Re: [RFC PATCH v2 3/8] failover: virtio-net: remove failover_primary_hidden flag
Quoted 12 lines · Laurent Vivier
We dont't need a flag to know if the primary device must be hidden, we can rely on the machine state:
Device is hidden if the machine is in prelaunch state (src) or in inmigrate state with migration status set to none (dst). We don't need to check the flag invirtio_net_handle_migration_primary()because this function is only registered if the failover is enabled and the flag also set to false. This function also sets it back to true after a successful unplug during the migration but we don't need to know it is hidden because nothing will try to plug it back after the migration (except in case of error but the flag is set back to false).
Quoted 1 line
Signed-off-by Laurent Vivier <[email protected]>
Much clear. I was removing all the global failover variables, but didn't finish the job.
Well done.
RFC PATCH v2 4/8 failover: pci: move failover hotplug/unplug code into pci subsystem
In reply to Laurent Vivierfailover allows a VFIO device to be unplugged on migration to switch to the standby device, a virtio-net device.
Failover relies on PCI ability to hotplug/unplug a card (the VFIO one) but all the code is implemented in virtio-net device that is not a PCI device (even not in virtio-net-pci that is the bridge between the PCI bus and the virtio-net device)
This patch moves all the failover PCI related code to the PCI sub-system and keeps only in virtio-net the code related to the failover (that is implemented in the virtio-net driver in the kernel)
There are several parts involved in the PCI device hotplug/unplug:
- the migration state notifier
originally virtio_net_handle_migration_primary(), moved to hw/pci/pci.c as pci_dev_handle_migration(). On source, this function unplugs the card on migration setup and plugs it back in case of failure. (helpers are pci_dev_migration_unplug() and pci_dev_migration_replug(),
previously failover_unplug_primary() and failover_replug_primary()).
- the hide device listener
originally failover_hide_primary_device(), moved to hw/pci/pci.c as pci_dev_hide_device().
This function is called by qdev_device_add() to know if a device must be hidden or not. To do that, the function checks the command line, if the device doesn't have a "failover_pair_id" it is not hidden. Otherwise it is hidden at startup on source and destination and it is only plugged by a compatible virtio-net device).
- the unplug pending checking functions
originally primary_unplug_pending() and dev_unplug_pending(), moved to hw/pci/pci.c as bus_unplug_pending() and pci_device_unplug_pending()
bus_unplug_pending() is called during the migration to check if the PCI device has been unplugged before starting to migrate data. It has been moved from vmstate_virtio_net to vmstate_pcibus. We can't move it to vmstate_pci_device because the device vmstate is removed before to start the migration (we don't migrate the device we unplug).
pci_device_unplug_pending() is called by bus_unplug_pending() to check if an unplug is pending for a given device (this is a class function) of the bus.
For a given PCI bus, bus_unplug_pending() will call pci_device_unplug_pending() for each available bus slot.
--- include/hw/pci/pci.h | 4 + include/hw/virtio/virtio-net.h | 2 - include/hw/virtio/virtio.h | 1 - hw/net/virtio-net.c | 156 ------------------------------- hw/pci/pci.c | 166 ++++++++++++++++++++++++++++++++- 5 files changed, 169 insertions(+), 160 deletions(-)
include/hw/pci/pci.h +4 -0
@@ -241,6 +241,9 @@ struct PCIDeviceClass {/* rom bar */ const char *romfile; + +DeviceListener listener; +bool (*dev_unplug_pending)(void *opaque); };typedef void (*PCIINTxRoutingNotifier )(PCIDevice *dev);
@@ -359,6 +362,7 @@ struct PCIDevice {/* ID of standby device in net_failover pair */ char *failover_pair_id; +Notifier migration_state;uint32_t acpi_index; };
include/hw/virtio/virtio-net.h +0 -2
@@ -206,8 +206,6 @@ struct VirtIONet {bool needs_vnet_hdr_swap;bool mtu_bypass_backend;bool failover; -DeviceListener primary_listener; -Notifier migration_state;VirtioNetRssData rss_data;struct NetRxPkt *rx_pkt;struct EBPFRSSContext ebpf_rss;
include/hw/virtio/virtio.h +0 -1
@@ -159,7 +159,6 @@ struct VirtioDeviceClass {*/ int (*post_load)(VirtIODevice *vdev);const VMStateDescription *vmsd; -bool (*primary_unplug_pending)(void *opaque); }; void virtio_instance_init_common(Object *proxy_obj, void *data,
hw/net/virtio-net.c +0 -156
200 lines not on this page · raw message
hw/pci/pci.c +165 -1
229 lines not on this page · raw message
Signature · 1 line
2.31.1
RFC PATCH v2 5/8 failover: hide the PCI device if the virtio-net device is not present
In reply to Laurent VivierWe can plug either the virtio-net device first or the PCI device first.
If we plug the PCI device first, QEMU checks the failover_pair_id but doesn't hide the device if the virtio-net device is not present.
This is a problem because if the virtio-net device is not plugged and the machine is migrated the VFIO device doesn't prevent anymore the migration and the machine is migrated with the VFIO device.
And of course, on destination the guest reboots because VFIO device cannot be migrated.
We can fix the problem by hiding the PCI device with a failover_pair_id device that is not present. In this case, if the machine is migrated the VFIO device is not migrated, and if the virtio-net device is plugged, the PCI device is plugged and can be migrated using the failover mechanism.
--- hw/pci/pci.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
hw/pci/pci.c +4 -3
@@ -2244,10 +2244,11 @@ static bool pci_dev_hide_device(DeviceListener *listener, d =qdev_find_recursive (sysbus_get_default (), opt);if (d ==NULL ) {/* -* if the the virtio-net device is not plugged it can be -* plugged later, and this device will be added to the failover +* PCI device has a pair id, but the virtio-net device is not +* plugged: hide it, it will be plugged later when the virtio-net +* device will be plugged */ -return false; +return true; }if (runstate_check (RUN_STATE_PRELAUNCH )) {
Signature · 1 line
2.31.1
RFC PATCH v2 6/8 failover: pci: unregister ROM on unplug
In reply to Laurent VivierThe intend of failover is to allow a VM with a VFIO networking card to be migrated without disrupting the network operation by switching to a virtio-net device during the migration.
This simple change allows a simulated device like e1000e to be tested rather than a vfio device, even if it's useless in real life it can help to debug failover.
This is interesting to developers that want to test failover on a system with no vfio device. Moreover it simplifies host networking configuration as we can use the same bridge for virtio-net and the other failover networking device.
Without this change the migration of a system configured with failover fails with:
... -device virtio-net-pci,id=virtionet0,failover=on,... \ -device e1000,failover_pair_id=virtionet0,... \ ...
(qemu) migrate ...
Unknown ramblock "0000:00:01.1:00.0/e1000e.rom", cannot accept migration error while loading state for instance 0x0 of device 'ram' load of migration failed: Invalid argument
This happens because QEMU correctly unregisters the interface vmstate but not the ROM one. This patch fixes that.
--- hw/pci/pci.c | 1 + 1 file changed, 1 insertion(+)
hw/pci/pci.c +1 -0
@@ -2208,6 +2208,7 @@ static void pci_dev_handle_migration(PCIDevice *pci_dev, MigrationState *s)if (migration_in_setup (s)) {if (pci_dev_migration_unplug (pci_dev)) {vmstate_unregister (VMSTATE_IF (dev),qdev_get_vmsd (dev), dev); +pci_del_option_rom (pci_dev);qapi_event_send_unplug_primary (dev->id); }else {warn_report ("couldn't unplug primary device" );
Signature · 1 line
2.31.1
Re: [RFC PATCH v2 6/8] failover: pci: unregister ROM on unplug
Quoted 23 lines · Laurent Vivier
The intend of failover is to allow a VM with a VFIO networking card to be migrated without disrupting the network operation by switching to a virtio-net device during the migration.
This simple change allows a simulated device like e1000e to be tested rather than a vfio device, even if it's useless in real life it can help to debug failover.
This is interesting to developers that want to test failover on a system with no vfio device. Moreover it simplifies host networking configuration as we can use the same bridge for virtio-net and the other failover networking device.
Without this change the migration of a system configured with failover fails with:
... -device virtio-net-pci,id=virtionet0,failover=on,... \ -device e1000,failover_pair_id=virtionet0,... \ ...(qemu) migrate ...
Quoted 8 lines
Unknown ramblock "0000:00:01.1:00.0/e1000e.rom", cannot accept migration error while loading state for instance
0x0of device 'ram' load of migration failed: Invalid argumentThis happens because QEMU correctly unregisters the interface vmstate but not the ROM one. This patch fixes that.
Signed-off-by Laurent Vivier <[email protected]>
One could even defend that unpluging the device and *NOT* unpluging the ROM is a bug, independently of failover, no?
Later, Juan.
RFC PATCH v2 7/8 pci: automatically unplug a PCI card before migration
In reply to Laurent VivierWe have moved all the functions needed by failover to unplug a card to the PCI subsystem.
A side effect of this change is we can implement automatic hotplug/unplug of any PCI card during migration without using a failover virtio-net card. For that, we need to introduce a new PCI device property, "unplug-on-migration", we can set to "true" or "on" if we want QEMU unplugs the card before the migration and plugs it back on the destination side after the migration.
We modify the pci_dev_hide_device() function to check for the "unplug-on-migration" property on the command line.
If it is present, the device is hidden on startup only on the destination side and it will be unplugged before the migration.
To implement the "unplug-on-migration" property, we add a post_load function in vmstate_pcibus to hotplug the card after the migration (bus_post_load() and pci_dev_replug_on_migration()). This is not needed with virtio-net failover because the device is plugged back by the virtio-net device during the features migration (VIRTIO_NET_F_STANDBY)
--- include/hw/pci/pci.h | 1 + hw/pci/pci.c | 76 ++++++++++++++++++++++++++++++++++++++------ hw/vfio/pci.c | 2 +- 3 files changed, 69 insertions(+), 10 deletions(-)
include/hw/pci/pci.h +1 -0
@@ -362,6 +362,7 @@ struct PCIDevice {/* ID of standby device in net_failover pair */ char *failover_pair_id; +bool unplug_on_migration;Notifier migration_state;uint32_t acpi_index; };
hw/pci/pci.c +67 -9
126 lines not on this page · raw message
hw/vfio/pci.c +1 -1
@@ -3080,7 +3080,7 @@ static void vfio_realize(PCIDevice *pdev, Error **errp) } } -if (!pdev->failover_pair_id) { +if (!pdev->unplug_on_migration) { ret =vfio_migration_probe (&vdev->vbasedev, errp);if (ret) {error_report ("%s: Migration disabled" , vdev->vbasedev.name);
Signature · 1 line
2.31.1
RFC PATCH v2 8/8 failover: qemu-opts: manage hidden device list
In reply to Laurent Vivierfailover relies on the command line parameters to store and detect failover devices because while the device is hidden it doesn't appears in qdev objects and so we don't have the list anywhere else.
But this doesn't work if the the device is hotplugged because it is not added to the qemu opts list (and the opts list memory is released after the qdev_device_add() if the device object is not created as it is the case when it is hidden).
It seems cleaner to manage our own list of hidden devices.
To do that, this patch adds some qemu_opts functions to store the opts list of the device when it is hidden. This list will be used to actually plug the device when it will be enabled for the guest.
--- include/qemu/option.h | 4 +++ hw/core/qdev.c | 1 + hw/net/virtio-net.c | 5 ++- hw/pci/pci.c | 4 +-- util/qemu-option.c | 82 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+), 5 deletions(-)
include/qemu/option.h +4 -0
@@ -150,4 +150,8 @@ QDict *keyval_parse(const char *params, const char *implied_key, bool *help, Error **errp);void keyval_merge (QDict *old,const QDict *new,Error **errp); +int qemu_opts_hidden_device_foreach (qemu_opts_loopfunc func, +void *opaque,Error **errp); +QemuOpts *qemu_opts_hidden_device_find (const char *id); +void qemu_opts_store_hidden_device (QemuOpts *opts);#endif
hw/core/qdev.c +1 -0
@@ -218,6 +218,7 @@ bool qdev_should_hide_device(QemuOpts *opts, Error **errp) QTAILQ_FOREACH(listener, &device_listeners, link) {if (listener->hide_device) {if (listener->hide_device (listener, opts, errp)) { +qemu_opts_store_hidden_device (opts);return true; } }
hw/net/virtio-net.c +2 -3
@@ -831,8 +831,7 @@ static char *failover_find_primary_device_id(VirtIONet *n)FailoverId fid; fid.n = n; -if (!qemu_opts_foreach (qemu_find_opts ("device" ), - failover_set_primary, &fid, &err)) { +if (!qemu_opts_hidden_device_foreach (failover_set_primary, &fid, &err)) {return NULL ; }return fid.id;
@@ -874,7 +873,7 @@ static void failover_add_primary(VirtIONet *n, Error **errp) " failover_pair_id=%s\n", n->netclient_name);return ; } - opts =qemu_opts_find (qemu_find_opts ("device" ), id); + opts =qemu_opts_hidden_device_find (id);g_assert (opts);/* cannot be NULL because id was found using opts list */ dev =qdev_device_add (opts, &err);if (err) {
hw/pci/pci.c +2 -2
@@ -142,8 +142,8 @@ static int bus_post_load(void *opaque, int version_id)Error *err =NULL ;PCIBus *bus = opaque; -if (qemu_opts_foreach (qemu_find_opts ("device" ), - pci_dev_replug_on_migration, bus->qbus.name, &err)) { +if (qemu_opts_hidden_device_foreach (pci_dev_replug_on_migration, + bus->qbus.name, &err)) {error_report_err (err);return -EINVAL ; }
util/qemu-option.c +82 -0
91 lines not on this page · raw message
Signature · 1 line
2.31.1