Am 21.09.2017 um 15:53 hat Kevin Wolf geschrieben: > Am 15.09.2017 um 12:10 hat Kevin Wolf geschrieben: > > qemu-io provides a 'reopen' command that allows switching from writable > > to read-only access. We need to make sure that we don't try to keep > > write permissions to a BlockBackend that becomes read-only, otherwise > > things are going to fail. > > > > command() already makes sure to request any additional permissions that > > a qemu-io command requires, so just resetting the permissions to values > > that are safe for read-only images is enough to fix this. > > > > As a side effect, this makes the output of qemu-iotests case 187 more > > consistent. > > > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > > This seems to break qemu-iotests 077 and 081 for raw. I'll look into > it tomorrow.
The problem seems to be related to 'aio_write': We already reset the permissions while the request is still in flight and might still start new internal requests that aren't allowed any more. We would have to drain blk around resetting the permissions, but this would obviously defeat the purpose of the aio_* commands. I tried creating a separate temporary BB, but it doesn't seem to be that straightforward (still crashes during 'aio_flush'). It would also provide the wrong semantics, HMP 'qemu-io' commands are supposed to be executed on the exact BlockBackend that was given. So unless someone has an idea how to salvage this patch, I'm afraid I'll just have to drop it. The original state isn't really correct either, but it errs on the side of having more permissions than necessary, so failure is less likely. Kevin