From: Xiaoqing Wei <[email protected]>

Now autotest alway regenerates certs before run/boot
a guest, which is not needed, and sometimes could be
a disaster when one has a running VM, since 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 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/client/virt/kvm_vm.py b/client/virt/kvm_vm.py
index c4f4308..53eef56 100644
--- a/client/virt/kvm_vm.py
+++ b/client/virt/kvm_vm.py
@@ -715,7 +715,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 (not os.path.exists(prefix) 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.11.4

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

Reply via email to