From: Xiaoqing Wei <[email protected]>

now autotest alway regenerate certs before run/boot a guest, which is not 
needed.
and sometimes could be a disaster when u have a running VM,
re-generate the certs would make your existing VM no longer accessible.

Signed-off-by: Xiaoqing Wei <[email protected]>
---
 client/virt/kvm_vm.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/client/virt/kvm_vm.py b/client/virt/kvm_vm.py
index 6b73a96..e91a236 100644
--- a/client/virt/kvm_vm.py
+++ b/client/virt/kvm_vm.py
@@ -714,7 +714,11 @@ class VM(virt_vm.BaseVM):
                     self.spice_options['spice_tls_port'] = t_port
 
                 prefix = optget("spice_x509_prefix")
-                if optget("spice_gen_x509") == "yes":
+                if (os.path.exists(prefix) is False
+                    and optget("spice_gen_x509") == "yes"):
+                    # Generate spice_x509_* is not always necessary,
+                    # Regenerate them will make your existing VM
+                    # not longer accessiable via encrypted spice.
                     c_subj = optget("spice_x509_cacert_subj")
                     s_subj = optget("spice_x509_server_subj")
                     passwd = optget("spice_x509_key_password")
-- 
1.7.1

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to