[libvirt] [PATCH] qemu:Delete sockets which act as UNIX domain socket server

Wangyufei (A) james.wangyufei at huawei.com
Fri Jul 19 02:12:06 UTC 2013


When I shutdown a vm, I found sockets which act as UNIX domain socket server were not deleted. When I add the following code, it work out.

Signed-off-by: WangYufei <james.wangyufei at huawei.com<mailto:james.wangyufei at huawei.com>>
---
src/qemu/qemu_process.c |    7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 3d5e8f6..e794f37 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4086,6 +4086,13 @@ void qemuProcessStop(virQEMUDriverPtr driver,
         priv->monConfig = NULL;
     }
+    /* remove socket which acts as UNIX domain socket server */
+    for (i = 0; i < vm->def->nchannels; i++) {
+        if ((vm->def->channels[i]->source.type == VIR_DOMAIN_CHR_TYPE_UNIX) &&
+            vm->def->channels[i]->source.data.nix.listen)
+            unlink(vm->def->channels[i]->source.data.nix.path);
+    }
+
     /* shut it off for sure */
     ignore_value(qemuProcessKill(vm,
                                  VIR_QEMU_PROCESS_KILL_FORCE|
--
1.7.3.1.msysgit.0


Best Regards,

-WangYufei

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130719/04a929c8/attachment-0001.htm>


More information about the libvir-list mailing list