Skip to contentSkip to conversation

vm creation fails (not)

autotest Gerd Hoffmann 1 participant 1 message Aug 5, 2009 KVM

lore
Share & tools
lore
#0 lore raw

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

client/tests/kvm/kvm_vm.py +3 -0
index eba9b84..cbb01e7 100644
@@ -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)