[PATCH] qemu: Check for existence of auto-generated socket path before removing

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

 



Commit id 'f1f68ca33' added code to remove the directory paths for
auto-generated sockets, but that code could be called before the
paths were created resulting in generating error messages from
virFileDeleteTree indicating that the file doesn't exist. So just
add a check before attemping the directory delete for existence.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/qemu/qemu_process.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index ce2c70c..b55eb52 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5269,13 +5269,13 @@ void qemuProcessStop(virQEMUDriverPtr driver,
 
     ignore_value(virAsprintf(&tmppath, "%s/domain-%s",
                              cfg->libDir, vm->def->name));
-    if (tmppath)
+    if (tmppath && virFileExists(tmppath))
         virFileDeleteTree(tmppath);
     VIR_FREE(tmppath);
 
     ignore_value(virAsprintf(&tmppath, "%s/domain-%s",
                              cfg->channelTargetDir, vm->def->name));
-    if (tmppath)
+    if (tmppath && virFileExists(tmppath))
         virFileDeleteTree(tmppath);
     VIR_FREE(tmppath);
 
-- 
2.1.0

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