Re: [PATCH 3/3] qemu: Add qemuDomainClearPrivatePaths and use it

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

 



On Mon, Apr 04, 2016 at 07:12:50AM +0200, Michal Privoznik wrote:
On 03.04.2016 22:23, Martin Kletzander wrote:
It's the counterpart of qemuDomainSetPrivatePaths().

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c  | 10 ++++++++++
 src/qemu/qemu_domain.h  |  1 +
 src/qemu/qemu_process.c |  3 +--
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 6102f7983f58..f38b0f381030 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -562,6 +562,16 @@ qemuDomainSetPrivatePaths(virQEMUDriverPtr driver,
 }


+void
+qemuDomainClearPrivatePaths(virDomainObjPtr vm)
+{
+    qemuDomainObjPrivatePtr priv = vm->privateData;
+
+    VIR_FREE(priv->libDir);
+    VIR_FREE(priv->channelTargetDir);
+}
+
+
 static void *
 qemuDomainObjPrivateAlloc(void)
 {
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 918a77dabd29..54d7bd74f3be 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -554,6 +554,7 @@ int qemuDomainNetVLAN(virDomainNetDefPtr def);
 int qemuDomainSetPrivatePaths(virQEMUDriverPtr driver,
                               virDomainObjPtr vm);

+void qemuDomainClearPrivatePaths(virDomainObjPtr vm);

 virDomainDiskDefPtr qemuDomainDiskByName(virDomainDefPtr def, const char *name);

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 02c13bcfbb38..d9dca7485387 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5832,8 +5832,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
     virFileDeleteTree(priv->libDir);
     virFileDeleteTree(priv->channelTargetDir);

-    VIR_FREE(priv->libDir);
-    VIR_FREE(priv->channelTargetDir);
+    qemuDomainClearPrivatePaths(vm);

     ignore_value(virDomainChrDefForeach(vm->def,
                                         false,


I think this can be merged with 1/3.


Yes, I forgot to mention that if we decide to put all commits in
together, then I'll just make it two commits so it makes more sense.

Michal

Attachment: signature.asc
Description: Digital signature

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