diff options
author | Juan Quintela <quintela@redhat.com> | 2020-11-18 09:37:42 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-12-08 13:48:58 -0500 |
commit | fec037c1e2da0a7ea54eabce65cc14d461fdc5eb (patch) | |
tree | 21aec25c9fdf08509ed01e6d8533a3656aa21f27 /softmmu/qdev-monitor.c | |
parent | 2e28095369f4eab516852fd49dde17c3bfd782f9 (diff) |
failover: make sure that id always exist
We check that it exist at device creation time, so we don't have to
check anywhere else.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20201118083748.1328-22-quintela@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'softmmu/qdev-monitor.c')
-rw-r--r-- | softmmu/qdev-monitor.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 0e10f0466f..301089eaea 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -613,6 +613,10 @@ 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)) { if (bus && !qbus_is_hotpluggable(bus)) { error_setg(errp, QERR_BUS_NO_HOTPLUG, bus->name); |