Skip to contentSkip to conversation

virtiofsd: Call qemu_init_exec_dir

PATCH In review Dr. David Alan Gilbert (git) 3 participants 4 messages Oct 2, 2020 – Oct 7, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtiofsd: Call qemu_init_exec_dir

From: "Dr. David Alan Gilbert" <[email protected]>

Since fcb4f59c879 qemu_get_local_state_pathname relies on the init_exec_dir, and virtiofsd asserts because we never set it. Set it.

---
 tools/virtiofsd/passthrough_ll.c | 2 ++
 1 file changed, 2 insertions(+)
tools/virtiofsd/passthrough_ll.c +2 -0
index 0b229ebd57..cce983ca63 100644
@@ -2839,6 +2839,8 @@ int main(int argc, char *argv[])
     /* Don't mask creation mode, kernel already did that */
     umask(0);
 
+    qemu_init_exec_dir(argv[0]);
+
     pthread_mutex_init(&lo.mutex, NULL);
     lo.inodes = g_hash_table_new(lo_key_hash, lo_key_equal);
     lo.root.fd = -1;
Signature · 1 line
2.26.2
Tested-by Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Since fcb4f59c879 qemu_get_local_state_pathname relies on the init_exec_dir, and virtiofsd asserts because we never set it. Set it.

Quoted 17 lines
---
 tools/virtiofsd/passthrough_ll.c | 2 ++
 1 file changed, 2 insertions(+)
tools/virtiofsd/passthrough_ll.c +2 -0
index 0b229ebd57..cce983ca63 100644
@@ -2839,6 +2839,8 @@ int main(int argc, char *argv[])
     /* Don't mask creation mode, kernel already did that */
     umask(0);
 
+    qemu_init_exec_dir(argv[0]);
+
     pthread_mutex_init(&lo.mutex, NULL);
     lo.inodes = g_hash_table_new(lo_key_hash, lo_key_equal);
     lo.root.fd = -1;
Signature · 1 line
Alex Bennée
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 11 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

Since fcb4f59c879 qemu_get_local_state_pathname relies on the init_exec_dir, and virtiofsd asserts because we never set it. Set it.

---
 tools/virtiofsd/passthrough_ll.c | 2 ++
 1 file changed, 2 insertions(+)
#3 lore raw
In reply to Dr. David Alan Gilbert (git)
Quoted 8 lines · * Dr. David Alan Gilbert (git) ([email protected]) wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

Since fcb4f59c879 qemu_get_local_state_pathname relies on the init_exec_dir, and virtiofsd asserts because we never set it. Set it.

Queued

Quoted 21 lines
---
 tools/virtiofsd/passthrough_ll.c | 2 ++
 1 file changed, 2 insertions(+)
tools/virtiofsd/passthrough_ll.c +2 -0
index 0b229ebd57..cce983ca63 100644
@@ -2839,6 +2839,8 @@ int main(int argc, char *argv[])
     /* Don't mask creation mode, kernel already did that */
     umask(0);
 
+    qemu_init_exec_dir(argv[0]);
+
     pthread_mutex_init(&lo.mutex, NULL);
     lo.inodes = g_hash_table_new(lo_key_hash, lo_key_equal);
     lo.root.fd = -1;
Signature · 1 line
2.26.2
Signature · 1 line
Dr. David Alan Gilbert / [email protected] / Manchester, UK