[libvirt PATCH 13/38] qemuBlockNodeNameGetBackingChain: `virHashNew` cannot return NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/qemu/qemu_block.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 2815eb54fa..8150241015 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -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;
 
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux