[libvirt] [PATCH v2 17/32] util: Use VIR_STEAL_PTR in virstoragefile

John Ferlan posted 32 patches 7 years ago
There is a newer version of this series
[libvirt] [PATCH v2 17/32] util: Use VIR_STEAL_PTR in virstoragefile
Posted by John Ferlan 7 years ago
virStorageFileGetRelativeBackingPath and virStorageFileGetMetadataRecurse
open coded.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
---
 src/util/virstoragefile.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 828e95d5d3..c6425308fb 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -4208,8 +4208,7 @@ virStorageFileGetRelativeBackingPath(virStorageSourcePtr top,
         goto cleanup;
     }
 
-    *relpath = path;
-    path = NULL;
+    VIR_STEAL_PTR(*relpath, path);
 
     ret = 0;
 
@@ -4947,8 +4946,7 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
             goto cleanup;
     }
 
-    src->backingStore = backingStore;
-    backingStore = NULL;
+    VIR_STEAL_PTR(src->backingStore, backingStore);
     ret = 0;
 
  cleanup:
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 17/32] util: Use VIR_STEAL_PTR in virstoragefile
Posted by Ján Tomko 6 years, 12 months ago
On Fri, Feb 08, 2019 at 01:37:11PM -0500, John Ferlan wrote:
>virStorageFileGetRelativeBackingPath and virStorageFileGetMetadataRecurse
>open coded.
>

There might be a missing.

>Signed-off-by: John Ferlan <jferlan@redhat.com>
>Reviewed-by: Erik Skultety <eskultet@redhat.com>
>---
> src/util/virstoragefile.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>

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