[libvirt] [PATCH v2 19/45] cpu: Don't overwrite errors in cpuGetModels

Jiri Denemark jdenemar at redhat.com
Mon Sep 19 13:30:28 UTC 2016


cpuGetSubDriver already reports a useful error.

Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
---

Notes:
    Version 2:
    - no change

 src/cpu/cpu.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index d2b7ce3..fae3885 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -765,13 +765,8 @@ cpuGetModels(virArch arch, char ***models)
 
     VIR_DEBUG("arch=%s", virArchToString(arch));
 
-    driver = cpuGetSubDriver(arch);
-    if (driver == NULL) {
-        virReportError(VIR_ERR_INVALID_ARG,
-                       _("cannot find a driver for the architecture %s"),
-                       virArchToString(arch));
+    if (!(driver = cpuGetSubDriver(arch)))
         return -1;
-    }
 
     if (!driver->getModels) {
         if (models)
-- 
2.10.0




More information about the libvir-list mailing list