mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
failover: g_strcmp0() knows how to handle NULL
Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-10-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
e2bde83e23
commit
518eda9fda
1 changed files with 1 additions and 1 deletions
|
@ -818,7 +818,7 @@ static int is_my_primary(void *opaque, QemuOpts *opts, Error **errp)
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
const char *standby_id = qemu_opt_get(opts, "failover_pair_id");
|
const char *standby_id = qemu_opt_get(opts, "failover_pair_id");
|
||||||
|
|
||||||
if (standby_id != NULL && (g_strcmp0(standby_id, n->netclient_name) == 0)) {
|
if (g_strcmp0(standby_id, n->netclient_name) == 0) {
|
||||||
n->primary_device_id = g_strdup(opts->id);
|
n->primary_device_id = g_strdup(opts->id);
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue