Bug 1625257

Summary: block-commit is not usable with -blockdev setup
Product: Red Hat Enterprise Linux 7 Reporter: Kevin Wolf <kwolf>
Component: qemu-kvm-rhevAssignee: Kevin Wolf <kwolf>
Status: CLOSED DUPLICATE QA Contact: Gu Nini <ngu>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: chayang, coli, juzhang, kwolf, michen, ngu, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-05 08:58:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kevin Wolf 2018-09-04 13:38:40 UTC
There are two problems that make the block-commit QMP command difficult or impossible to use with a setup where the block graph is built node by node with individual -blockdev options or blockdev-add QMP commands.

1. The block-commit only accepts filenames to identify the top and the base node for the commit operation. However, with individual options set, this can easily cause QEMU to use a json: filename, the exact layout of which is hard to predict. Instead, block-commit should offer options to identify top and base by their node name.

2. Commit automatically reopens the base if it is currently reopened read-only. In a graph built node by node, however, the reopen fails because base->file isn't also reopened and you can't have a read-write format layer on top of a read-only protocol layer. Commit must be changed so that it reopens all relevant nodes so that it can be used even when the base node is opened read-only originally.

The following command line runs into the same problem 2, though I can't say yet if it should work in the end or not (depends on whether the best fix is in reopen itself or in commit's use of reopen):
qemu-io -r -c 'reopen -w' --image-opts driver=qcow2,file.driver=file,file.filename=/tmp/backing.qcow2,file.read-only=on,read-only=on