qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

questions about QMP commands - "block-export-add" and "nbd-server-add"


From: Yu Zhang
Subject: questions about QMP commands - "block-export-add" and "nbd-server-add"
Date: Tue, 5 Jul 2022 11:57:59 +0200

Hi All,

since QEMU-5.2, the QMP command "nbd-server-add" was deprecated and replaced with "block-export-add" [1].

Arguments for the two are different. For using "block-export-add", "id" and "node-name" are needed, of which "id" is "device" for "nbd-server-add", and "node-name" can be obtained from the querying result of "query-block". As shown by an example below:

{ "execute": "query-block" }
{"return": [..., {..., "device": "drive-virtio-disk5", ...: {...:
{"virtual-size": 53687091200, "filename": "/dev/md0", "format": "raw", ...}
, ..., "node-name": "#block349", ...}, "qdev": "/machine/peripheral/virtio-disk5/virtio-backend", "type": "unknown"}]}

{ "execute": "nbd-server-add", "arguments": { "device": "drive-virtio-disk5", "writable": true }}
{"error": {"class": "GenericError", "desc": "Permission conflict on node '#block349': permissions 'write' are both required by an unnamed block device (uses node '#block349' as 'root' child) and unshared by block device 'drive-virtio-disk5' (uses node '#block349' as 'root' child)."}}

{ "execute": "block-export-add", "arguments": { "type": "nbd", "id": "drive-virtio-disk5", "node-name": "#block349", "writable": true }}
{"error": {"class": "GenericError", "desc": "Permission conflict on node '#block349': permissions 'write' are both required by an unnamed block device (uses node '#block349' as 'root' child) and unshared by block device 'drive-virtio-disk5' (uses node '#block349' as 'root' child)."}}


An issue we encountered with "block-export-add" for VM live migration:

on the target server
- exported device name: drive-virtio-disk5
- node name of the exported device: #node123

on the source server
- gets the device name from target via network: driver-virtio-disk5
- gets the node name from the target via network: #node123

However, on the source server, the node name #node123 can't be identified.

Assumption: the same "device" may have different "node-name" on the source and target servers. It seems that sending "device" is quite easy, but sending "device" and translating it to the correct "node-name" is not quite straightforward.
The "block-export-add" command made it somehow unnecessarily complicated.

For this reason, we would like to know:
- whether it's possible not to deprecate the use of "nbd-server-add" command, or
- whether there is a simpler QMP command for block device migration

Thank you so much for your reply.

Yu Zhang @Compute Platform Team of IONOS SE
05.07.2022

[1] https://wiki.qemu.org/ChangeLog/5.2

reply via email to

[Prev in Thread] Current Thread [Next in Thread]