diff --git a/lib/setupmanagers/qemuhck/devices/vhost-user-fs-pci.json b/lib/setupmanagers/qemuhck/devices/vhost-user-fs-pci.json index 972a8e50..6383e8c3 100644 --- a/lib/setupmanagers/qemuhck/devices/vhost-user-fs-pci.json +++ b/lib/setupmanagers/qemuhck/devices/vhost-user-fs-pci.json @@ -12,7 +12,8 @@ "pre_start_commands": [ "mkdir -p @fs_daemon_share_path@", "rm -f @fs_daemon_socket@", - "@fs_daemon_bin@ --socket-path=@fs_daemon_socket@ -o source=@fs_daemon_share_path@ -o cache=always &" + "@fs_daemon_bin@ --socket-path=@fs_daemon_socket@ -o source=@fs_daemon_share_path@ --cache always &", + "until [ -S '@fs_daemon_socket@' ]; do echo 'Socket does not exist, waiting...'; sleep 1; done" ], "post_stop_commands": [ "rm -f @fs_daemon_socket@" diff --git a/lib/setupmanagers/qemuhck/qemu_machine.rb b/lib/setupmanagers/qemuhck/qemu_machine.rb index 4886d4ab..86b5e6dd 100644 --- a/lib/setupmanagers/qemuhck/qemu_machine.rb +++ b/lib/setupmanagers/qemuhck/qemu_machine.rb @@ -548,16 +548,20 @@ def run_config_commands end def run_pre_start_commands - @pre_start_commands.each do |dirty_cmd| - cmd = replace_string_recursive(dirty_cmd, full_replacement_list) - run_cmd(cmd) + Timeout.timeout(60) do + @pre_start_commands.each do |dirty_cmd| + cmd = replace_string_recursive(dirty_cmd, full_replacement_list) + run_cmd(cmd) + end end end def run_post_stop_commands - @post_stop_commands.each do |dirty_cmd| - cmd = replace_string_recursive(dirty_cmd, full_replacement_list) - run_cmd_no_fail(cmd) + Timeout.timeout(60) do + @post_stop_commands.each do |dirty_cmd| + cmd = replace_string_recursive(dirty_cmd, full_replacement_list) + run_cmd_no_fail(cmd) + end end end