[pve-devel] applied: [RFC qemu-server] migration: nbd export: switch away from deprecated QMP command

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jan 16 14:02:35 CET 2023


Am 02/12/2022 um 13:54 schrieb Fiona Ebner:
> The 'nbd-server-add' QMP command has been deprecated since QEMU 5.2 in
> favor of a more general 'block-export-add'.
> 
> When using 'nbd-server-add', QEMU internally converts the parameters
> and calls blk_exp_add() which is also used by 'block-export-add'. It
> does one more thing, namely calling nbd_export_set_on_eject_blk() to
> auto-remove the export from the server when the backing drive goes
> away. But that behavior is not needed in our case, stopping the NBD
> server removes the exports anyways.
> 
> It was checked with a debugger that the parameters to blk_exp_add()
> are still the same after this change. Well, the block node names are
> autogenerated and not consistent across invocations.
> 
> The alternative to using 'query-block' would be specifying a
> predictable 'node-name' for our '-drive' commandline. It's not that
> difficult for this use case, but in general one needs to be careful
> (e.g. it can't be specified for an empty CD drive, but would need to
> be set when inserting a CD later). Querying the actual 'node-name'
> seemed a bit more future-proof.
> 
> Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
> ---
> 
> RFC, because I'm not sure which approach is better.

for now this works out fine, we can always switch to persistent node-names
if it shows to has some relevant advantage.

> 
>  PVE/QemuServer.pm            | 17 ++++++++++++++++-
>  test/MigrationTest/QmMock.pm |  4 +++-
>  2 files changed, 19 insertions(+), 2 deletions(-)
> 
>

applied, thanks!





More information about the pve-devel mailing list