diff mbox

[autotest] vm creation fails (not)

Message ID 4A7954D7.3020409@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gerd Hoffmann Aug. 5, 2009, 9:45 a.m. UTC
Hi,

Now and then autotest thinks creating the vm failed, although qemu 
started up just fine.  autotest then goes to wait($qemupid) and hangs 
there forever ...

I suspect this is a race: autotest uses 'help' on the monitor to check 
whenever qemu is alive. If qemu created the monitor socket fast enougth 
it works.  Otherwise it doesn't.

I've papered over it with the quick&dirty patch below.  Someone who 
knows autotest better that /me should fix this properly.

thanks,
   Gerd
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index eba9b84..cbb01e7 100644
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -382,6 +382,9 @@  class VM:
             self.process = kvm_subprocess.run_bg(qemu_command, None,
                                                  logging.debug, "(qemu) ")
 
+            # wait a bit to give qemu enougth time to create the monitor socket
+            time.sleep(3)
+
             if not self.process.is_alive():
                 logging.error("VM could not be created; "
                               "qemu command failed:\n%s" % qemu_command)