mirror of https://gitee.com/openkylin/libvirt.git
testQemuMonitorJSONqemuMonitorJSONGetBlockInfo: `virHashNew` cannot return NULL
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
92c35f5590
commit
091f22223b
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue