]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: `virHashNew` cannot return NULL
authorTim Wiederhake <twiederh@redhat.com>
Mon, 5 Jul 2021 14:36:01 +0000 (16:36 +0200)
committerTim Wiederhake <twiederh@redhat.com>
Wed, 14 Jul 2021 13:37:07 +0000 (15:37 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tests/qemumonitorjsontest.c

index 7fd58dc2d1303ee8c6875febda087995d9e96e15..89ede3b59a16ff66276f3f478482fbf6955ec571 100644 (file)
@@ -1460,18 +1460,14 @@ testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const void *opaque)
 {
     const testGenericData *data = opaque;
     virDomainXMLOption *xmlopt = data->xmlopt;
-    g_autoptr(GHashTable) blockDevices = NULL;
-    g_autoptr(GHashTable) expectedBlockDevices = NULL;
+    g_autoptr(GHashTable) blockDevices = virHashNew(g_free);
+    g_autoptr(GHashTable) expectedBlockDevices = virHashNew(g_free);
     struct qemuDomainDiskInfo *info;
     g_autoptr(qemuMonitorTest) test = NULL;
 
     if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
         return -1;
 
-    if (!(blockDevices = virHashNew(g_free)) ||
-        !(expectedBlockDevices = virHashNew(g_free)))
-        return -1;
-
     info = g_new0(struct qemuDomainDiskInfo, 1);
 
     if (virHashAddEntry(expectedBlockDevices, "virtio-disk0", info) < 0) {