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:
Juan Quintela 2020-11-18 09:37:30 +01:00 committed by Michael S. Tsirkin
parent e2bde83e23
commit 518eda9fda

View File

@ -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;
}