render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From b04dcdee9c66d99017d00c8b16a335f0b148ffab Mon Sep 17 00:00:00 2001
Message-Id: <b04dcdee9c66d99017d00c8b16a335f0b148ffab@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 26 Feb 2014 14:54:12 +0100
Subject: [PATCH] conf: Rename virDomainDiskHostDefFree to
 virDomainDiskHostDefClear

https://bugzilla.redhat.com/show_bug.cgi?id=1032370

The function destroys only the contents not the object itself thus it
should be called Clear.

(cherry picked from commit 2b2decbdcc46b34dce6141f264a126373544bc00)

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/conf/domain_conf.c   | 6 +++---
 src/conf/domain_conf.h   | 2 +-
 src/libvirt_private.syms | 2 +-
 src/qemu/qemu_command.c  | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 60e8849..eef2176 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1212,13 +1212,13 @@ void virDomainDiskDefFree(virDomainDiskDefPtr def)
     }
 
     for (i = 0; i < def->nhosts; i++)
-        virDomainDiskHostDefFree(&def->hosts[i]);
+        virDomainDiskHostDefClear(&def->hosts[i]);
     VIR_FREE(def->hosts);
 
     VIR_FREE(def);
 }
 
-void virDomainDiskHostDefFree(virDomainDiskHostDefPtr def)
+void virDomainDiskHostDefClear(virDomainDiskHostDefPtr def)
 {
     if (!def)
         return;
@@ -4959,7 +4959,7 @@ error:
     VIR_FREE(protocol);
     VIR_FREE(transport);
     while (nhosts > 0) {
-        virDomainDiskHostDefFree(&hosts[nhosts - 1]);
+        virDomainDiskHostDefClear(&hosts[nhosts - 1]);
         nhosts--;
     }
 
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 824fb8e..0a4316b 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2209,7 +2209,7 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def);
 void virDomainInputDefFree(virDomainInputDefPtr def);
 void virDomainDiskDefFree(virDomainDiskDefPtr def);
 void virDomainLeaseDefFree(virDomainLeaseDefPtr def);
-void virDomainDiskHostDefFree(virDomainDiskHostDefPtr def);
+void virDomainDiskHostDefClear(virDomainDiskHostDefPtr def);
 int virDomainDeviceFindControllerModel(virDomainDefPtr def,
                                        virDomainDeviceInfoPtr info,
                                        int controllerType);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index c2ae2c8..72a5033 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -195,7 +195,7 @@ virDomainDiskErrorPolicyTypeToString;
 virDomainDiskFindByBusAndDst;
 virDomainDiskGeometryTransTypeFromString;
 virDomainDiskGeometryTransTypeToString;
-virDomainDiskHostDefFree;
+virDomainDiskHostDefClear;
 virDomainDiskIndexByName;
 virDomainDiskInsert;
 virDomainDiskInsertPreAlloced;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index e6a6650..062b7e4 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3440,7 +3440,7 @@ cleanup:
     return ret;
 
 error:
-    virDomainDiskHostDefFree(def->hosts);
+    virDomainDiskHostDefClear(def->hosts);
     VIR_FREE(def->hosts);
     goto cleanup;
 }
@@ -3542,7 +3542,7 @@ qemuParseNBDString(virDomainDiskDefPtr disk)
     return 0;
 
 error:
-    virDomainDiskHostDefFree(h);
+    virDomainDiskHostDefClear(h);
     VIR_FREE(h);
     return -1;
 }
-- 
1.9.0