[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Permission error when run block-commit
From: |
Max Reitz |
Subject: |
Re: Permission error when run block-commit |
Date: |
Mon, 24 Feb 2020 11:04:00 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 24.02.20 08:56, Jing-Wei Su wrote:
> Hi, all
>
> I was trying to do block-commit, and the disk layout is the following diagram.
>
> +----------------------+
> | top-disk |
> +---------------------+
> | (backing)
> +----------------------+
> | middle-disk |
> +---------------------+
> | (backing)
> +----------------------+
> | base-disk |
> +---------------------+
>
> The script for running the vm is
> qemu-system-x86_64 -name vm -enable-kvm -cpu qemu64,+kvmclock -m 1024 \
> -drive
> if=none,id=middle_disk0,driver=qcow2,file.filename=${dir}/middle.qcow2,file.locking=off,\
> backing.driver=qcow2,backing.file.filename=${dir}/down.qcow2,backing.file.locking=off
> \
> -drive
> if=ide,id=top-disk0,driver=qcow2,file.filename=${dir}/top.qcow2,backing=middle_disk0
> \
> -qmp stdio -vnc :0
>
> After booting the vm, I issued the block-commit command:
> {
> "execute": "block-commit",
> "arguments": {
> "device": "top-disk0",
> "job-id": "job0",
> "top": "/mnt/NFV/qemu/top.qcow2",
> "base": "/mnt/NFV/qemu/down.qcow2"
> }
> }
>
> But, I got the ERROR
> {"error": {"class": "GenericError", "desc": "Conflicts with use by
> middle_disk0 as 'root', which uses 'consistent read' on #block116"}}
>
> I cannot figure out what makes this ERROR.
> Is any idea about the root cause and how to solve the error?
You cannot commit from top to base while there is something attached to
the middle. That “something” here is “middle_disk0”, as the error
message explains. (Yes, you specify if=none, but that doesn’t change
the fact that -drive always creates what’s called a BlockBackend that
appears as a user of the given block device.)
If you want to build block graphs in separate command-line options, you
should use -blockdev, like so:
-blockdev node_name=middle_disk0,driver=qcow2,\
file.driver=file,file.filename=${dir}/middle.qcow2,backing.driver=qcow2,\
backing.file.driver=file,backing.file.filename=${dir}/down.qcow2
(Instead of the -drive if=none above)
You can also use JSON:
-blockdev '{"node-name": "middle_disk0", "driver": "qcow2",
"file": { "driver": "file",
"filename": "${dir}/middle.qcow2" },
"backing": {
"driver": "qcow2",
"file": { "driver": "file",
"filename": "${dir}/down.qcow2" }
} }'
Hope that helps,
Max
signature.asc
Description: OpenPGP digital signature