hotplug: Call each qemu commmand with an own socat
authorDimitris Aragiorgis <dimara@grnet.gr>
Mon, 3 Feb 2014 21:36:53 +0000 (23:36 +0200)
committerThomas Thrainer <thomasth@google.com>
Thu, 6 Feb 2014 08:49:15 +0000 (09:49 +0100)
commit89c1024146bf56dd93f45423f9fb905794e2936a
treea68169f8b44427e963a5ad71b97847a6ca00e141
parent401b773e6e237e8f6e0e78a92e8f75a4b3e98fa1
hotplug: Call each qemu commmand with an own socat

Previously we issued one socat command with two "\n" separated
actions (e.g. netdev_add ...\ndevice_add...)

After having observed a strange monitor behavior [1] splitting
those commands and introducing a sleep time in between, may reduce
any race possibilities. Additionally it will be a step forward
parsing monitor output of each command and decide whether to
modify runtime files or raise a HotplugError.

This patch simply changes _CallHotplugCommand() to take a
list of commands and issue them separately. Introduces one second
sleep after each command and removes sleep from HotModDevice().

[1] https://groups.google.com/d/msg/ganeti-devel/hCQnmuqKtU0/UWGnw251cskJ

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
lib/hypervisor/hv_kvm.py