On 9/19/19 6:37 AM, Richard W.M. Jones wrote:
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;
We probably ought to reset ALL of the h->can_* cached values. If h->can_write changes, that also impacts h->can_zero and friends.
+ return backend_open (b, conn, readonly); }
Obviously this hunk should be in the first patch ...
Rich.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org