[Qemu-devel] [PATCH 0/4] block: Add auto-read-only option

Kevin Wolf posted 4 patches 7 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20181009193524.19052-1-kwolf@redhat.com
Test docker-clang@ubuntu failed
Test checkpatch passed
There is a newer version of this series
qapi/block-core.json  |  6 ++++++
block/nbd-client.h    |  1 +
include/block/block.h |  2 ++
block.c               | 28 +++++++++++++++++++++++++++-
block/file-posix.c    | 13 +++++++++++++
block/nbd-client.c    | 14 +++++++++++---
block/nbd.c           |  4 +++-
block/vvfat.c         |  1 +
8 files changed, 64 insertions(+), 5 deletions(-)
[Qemu-devel] [PATCH 0/4] block: Add auto-read-only option
Posted by Kevin Wolf 7 years ago
Peter, would this provide what libvirt urgently needs for backing files
vs. the commit block job?

Kevin Wolf (4):
  block: Update flags in bdrv_set_read_only()
  block: Add auto-read-only option
  nbd: Support auto-read-only option
  file-posix: Support auto-read-only option

 qapi/block-core.json  |  6 ++++++
 block/nbd-client.h    |  1 +
 include/block/block.h |  2 ++
 block.c               | 28 +++++++++++++++++++++++++++-
 block/file-posix.c    | 13 +++++++++++++
 block/nbd-client.c    | 14 +++++++++++---
 block/nbd.c           |  4 +++-
 block/vvfat.c         |  1 +
 8 files changed, 64 insertions(+), 5 deletions(-)

-- 
2.13.6


Re: [Qemu-devel] [PATCH 0/4] block: Add auto-read-only option
Posted by Peter Krempa 7 years ago
On Tue, Oct 09, 2018 at 21:35:20 +0200, Kevin Wolf wrote:
> Peter, would this provide what libvirt urgently needs for backing files
> vs. the commit block job?

This looks fine for us with one exception. I'd prefer if the curl driver
implemented this too so that we don't have to hardcode the readonly flag
for that as well.

With CURL based backend backing an image I get:

-blockdev {"driver":"http","url":"example.com","node-name":"libvirt-2-storage","discard":"unmap","auto-read-only":true}: curl block device does not support writes

I've tested it with libvirt's usage of -blockdev together with
block-commit and also with read-only-NBD backed images and everything
seems to work well for me. I'll report back once I give it more testing.