mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
qemuBlockNodeNameGetBackingChain: 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
26c09438e2
commit
4bfc24fb87
@ -231,22 +231,16 @@ qemuBlockNodeNameGetBackingChain(virJSONValue *namednodes,
|
||||
virJSONValue *blockstats)
|
||||
{
|
||||
struct qemuBlockNodeNameGetBackingChainData data;
|
||||
g_autoptr(GHashTable) namednodestable = NULL;
|
||||
g_autoptr(GHashTable) disks = NULL;
|
||||
g_autoptr(GHashTable) namednodestable = virHashNew(virJSONValueHashFree);
|
||||
g_autoptr(GHashTable) disks = virHashNew(qemuBlockNodeNameBackingChainDataHashEntryFree);
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
|
||||
if (!(namednodestable = virHashNew(virJSONValueHashFree)))
|
||||
return NULL;
|
||||
|
||||
if (virJSONValueArrayForeachSteal(namednodes,
|
||||
qemuBlockNamedNodesArrayToHash,
|
||||
namednodestable) < 0)
|
||||
return NULL;
|
||||
|
||||
if (!(disks = virHashNew(qemuBlockNodeNameBackingChainDataHashEntryFree)))
|
||||
return NULL;
|
||||
|
||||
data.nodenamestable = namednodestable;
|
||||
data.disks = disks;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user