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
@ -818,7 +818,7 @@ static int is_my_primary(void *opaque, QemuOpts *opts, Error **errp)
|
||||
int ret = 0;
|
||||
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);
|
||||
ret = 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user