mirror of
https://github.com/jiangcuo/qemu-server
synced 2025-08-24 03:00:48 +00:00
blockdev: blockdev replace: delete format block node first
Nodes need to be deleted from top to bottom. For example: > ./qemu-img create /tmp/disk.qcow2 -f qcow2 1G > ./qemu-system-x86_64 --qmp stdio \ > <<EOF > {"execute": "qmp_capabilities"} > {"execute": "blockdev-add", "arguments": { "driver": "file", "node-name": "file-node", "filename": "/tmp/disk.qcow2" }} > {"execute": "blockdev-add", "arguments": { "driver": "qcow2", "node-name": "fmt-node", "file": "file-node" }} > {"execute": "blockdev-del", "arguments": { "node-name": "file-node" }} > {"execute": "blockdev-del", "arguments": { "node-name": "fmt-node" }} > EOF produces > {"error": {"class": "GenericError", "desc": "Block device file-node is in use"}} while it works with first detaching the format node and then the file node. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
6898a72b54
commit
32102c06be
@ -947,8 +947,8 @@ sub blockdev_replace {
|
||||
|
||||
# delete old file|fmt nodes
|
||||
# add eval as reopen is auto removing the old nodename automatically only if it was created at vm start in command line argument
|
||||
eval { mon_cmd($vmid, 'blockdev-del', 'node-name' => $src_file_blockdev_name) };
|
||||
eval { mon_cmd($vmid, 'blockdev-del', 'node-name' => $src_fmt_blockdev_name) };
|
||||
eval { mon_cmd($vmid, 'blockdev-del', 'node-name' => $src_file_blockdev_name) };
|
||||
}
|
||||
|
||||
sub blockdev_commit {
|
||||
|
Loading…
Reference in New Issue
Block a user