On Thu, Sep 19, 2019 at 12:34:17PM +0100, Richard W.M. Jones wrote:
diff --git a/server/backend.c b/server/backend.c index 8a434bd..b8c5742 100644 --- a/server/backend.c +++ b/server/backend.c @@ -224,9 +224,17 @@ backend_valid_range (struct backend *b, struct connection *conn, int backend_reopen (struct backend *b, struct connection *conn, int readonly) { + struct b_conn_handle *h = &conn->handles[b->i]; + debug ("%s: reopen", b->name);
b->close (b, conn); + + /* This forces .open to recalculate h->can_write, which might have + * changed since we may have a new readonly value. + */ + h->can_write = -1; + return backend_open (b, conn, readonly); }
Obviously this hunk should be in the first patch ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org