[PATCH 12/12] Remove double OOM error reporting

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

 



---
 src/libxl/libxl_driver.c | 5 +++--
 src/qemu/qemu_command.c  | 8 ++------
 src/qemu/qemu_hotplug.c  | 4 +---
 src/util/viruri.c        | 2 +-
 4 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index f195b7e..9aec78d 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3983,11 +3983,12 @@ libxlDomainGetNumaParameters(virDomainPtr dom,
             if (numnodes <= 0)
                 goto cleanup;
 
-            if (libxl_node_bitmap_alloc(priv->ctx, &nodemap, 0) ||
-                !(nodes = virBitmapNew(numnodes))) {
+            if (libxl_node_bitmap_alloc(priv->ctx, &nodemap, 0)) {
                 virReportOOMError();
                 goto cleanup;
             }
+            if (!(nodes = virBitmapNew(numnodes)))
+                goto cleanup;
 
             rc = libxl_domain_get_nodeaffinity(priv->ctx,
                                                vm->def->id,
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0c1f0f1..6d3cc07 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9113,10 +9113,8 @@ qemuBuildParallelChrDeviceStr(char **deviceStr,
                               virDomainChrDefPtr chr)
 {
     if (virAsprintf(deviceStr, "isa-parallel,chardev=char%s,id=%s",
-                    chr->info.alias, chr->info.alias) < 0) {
-        virReportOOMError();
+                    chr->info.alias, chr->info.alias) < 0)
         return -1;
-    }
     return 0;
 }
 
@@ -9139,10 +9137,8 @@ qemuBuildChannelChrDeviceStr(char **deviceStr,
 
         if (virAsprintf(deviceStr,
                         "user,guestfwd=tcp:%s:%i-chardev:char%s,id=user-%s",
-                        addr, port, chr->info.alias, chr->info.alias) < 0) {
-            virReportOOMError();
+                        addr, port, chr->info.alias, chr->info.alias) < 0)
             goto cleanup;
-        }
         break;
 
     case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO:
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 5e8aa4e..3060dbc 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1450,10 +1450,8 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver,
     if (qemuBuildChrDeviceStr(&devstr, vm->def, chr, priv->qemuCaps) < 0)
         return ret;
 
-    if (virAsprintf(&charAlias, "char%s", chr->info.alias) < 0) {
-        virReportOOMError();
+    if (virAsprintf(&charAlias, "char%s", chr->info.alias) < 0)
         goto cleanup;
-    }
 
     if (qemuDomainChrInsert(vmdef, chr) < 0)
         goto cleanup;
diff --git a/src/util/viruri.c b/src/util/viruri.c
index eb47bbe..1bb3e97 100644
--- a/src/util/viruri.c
+++ b/src/util/viruri.c
@@ -120,7 +120,7 @@ virURIParseParams(virURIPtr uri)
         if (virURIParamAppend(uri, name, value ? value : "") < 0) {
             VIR_FREE(name);
             VIR_FREE(value);
-            goto no_memory;
+            return -1;
         }
         VIR_FREE(name);
         VIR_FREE(value);
-- 
1.8.5.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]