[libvirt] [PATCH] libxl_driver: Drop needless variable

Michal Privoznik posted 1 patch 1 week ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/53a18667b6d235438be8454475ccfc614c860c1f.1562678900.git.mprivozn@redhat.com
src/libxl/libxl_driver.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

[libvirt] [PATCH] libxl_driver: Drop needless variable

Posted by Michal Privoznik 1 week ago
The @oldDef variable in libxlAddDom0() is not used really. Drop
it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/libxl/libxl_driver.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 7c236383e4..731700ded6 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -606,7 +606,6 @@ libxlAddDom0(libxlDriverPrivatePtr driver)
     libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
     virDomainDefPtr def = NULL;
     virDomainObjPtr vm = NULL;
-    virDomainDefPtr oldDef = NULL;
     libxl_dominfo d_info;
     unsigned long long maxmem;
     int ret = -1;
@@ -636,7 +635,7 @@ libxlAddDom0(libxlDriverPrivatePtr driver)
     if (!(vm = virDomainObjListAdd(driver->domains, def,
                                    driver->xmlopt,
                                    0,
-                                   &oldDef)))
+                                   NULL)))
         goto cleanup;
     def = NULL;
 
@@ -657,7 +656,6 @@ libxlAddDom0(libxlDriverPrivatePtr driver)
  cleanup:
     libxl_dominfo_dispose(&d_info);
     virDomainDefFree(def);
-    virDomainDefFree(oldDef);
     virDomainObjEndAPI(&vm);
     virObjectUnref(cfg);
     return ret;
-- 
2.21.0

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

Re: [libvirt] [PATCH] libxl_driver: Drop needless variable

Posted by Ján Tomko 1 week ago
On Tue, Jul 09, 2019 at 03:28:20PM +0200, Michal Privoznik wrote:
>The @oldDef variable in libxlAddDom0() is not used really. Drop
>it.
>
>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
> src/libxl/libxl_driver.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>

Not really needed since its introduction in
commit 45697fe545841af46c95c996439ed59ca3a7ef9d


Reviewed-by: Ján Tomko <jtomko@redhat.com>

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