From 3094a943d19124a67013caa09311cdd7c69ba9dd Mon Sep 17 00:00:00 2001 From: Kostiantyn Kostiuk Date: Thu, 2 Nov 2023 11:54:09 +0200 Subject: [PATCH 1/3] Wait for virtiofsd socket exist before start QEMU Signed-off-by: Kostiantyn Kostiuk --- lib/setupmanagers/qemuhck/devices/vhost-user-fs-pci.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/setupmanagers/qemuhck/devices/vhost-user-fs-pci.json b/lib/setupmanagers/qemuhck/devices/vhost-user-fs-pci.json index 972a8e50..0e22bd72 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@ -o 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@" From c6d9a35fd63e20756b9af0d002f2d114f6c370de Mon Sep 17 00:00:00 2001 From: Kostiantyn Kostiuk Date: Mon, 6 Nov 2023 11:06:30 +0200 Subject: [PATCH 2/3] Limit init/clean step time Expected that all preparation will be finished quickly. Signed-off-by: Kostiantyn Kostiuk --- lib/setupmanagers/qemuhck/qemu_machine.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 From afb8bb9767724fc446a081ae89788cc7c41c354c Mon Sep 17 00:00:00 2001 From: Konstantin Kostiuk Date: Wed, 8 Nov 2023 10:20:44 +0200 Subject: [PATCH 3/3] Fix deprecated virtiofsd command line Signed-off-by: Konstantin Kostiuk --- lib/setupmanagers/qemuhck/devices/vhost-user-fs-pci.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/setupmanagers/qemuhck/devices/vhost-user-fs-pci.json b/lib/setupmanagers/qemuhck/devices/vhost-user-fs-pci.json index 0e22bd72..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,7 @@ "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": [