[Libguestfs] [PATCH nbdkit 1/4] plugins: guestfs: This plugin is only safe when serializing connections.

Richard W.M. Jones rjones at redhat.com
Thu Jun 7 15:48:54 UTC 2018


If two connections are both made at the same time then they would both
open a guestfs handle, possible for write, on the same set of disks.

With older qemu this would result in disk corruption, with newer qemu
you'd get just a locking failure.
---
 plugins/guestfs/guestfs-plugin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/guestfs/guestfs-plugin.c b/plugins/guestfs/guestfs-plugin.c
index 66788d8..1572940 100644
--- a/plugins/guestfs/guestfs-plugin.c
+++ b/plugins/guestfs/guestfs-plugin.c
@@ -492,7 +492,7 @@ plugin_guestfs_close (void *handle)
   free (h);
 }
 
-#define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_REQUESTS
+#define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS
 
 /* Get the file size. */
 static int64_t
-- 
2.16.2




More information about the Libguestfs mailing list