mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 15:15:46 +00:00
block/export: Add node-name to BlockExportOptions
Every block export needs a block node to export, so add a 'node-name' option to BlockExportOptions and remove the replaced option 'device' from BlockExportOptionsNbd. To maintain compatibility in nbd-server-add, BlockExportOptionsNbd needs to be wrapped by a new type NbdServerAddOptions that adds 'device' back because nbd-server-add doesn't use the BlockExportOptions base type at all (so even without changing it to a 'node-name' option in block-export-add, this compatibility code would be necessary). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200924152717.287415-16-kwolf@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
@ -1064,10 +1064,10 @@ int main(int argc, char **argv)
|
||||
export_opts = g_new(BlockExportOptions, 1);
|
||||
*export_opts = (BlockExportOptions) {
|
||||
.type = BLOCK_EXPORT_TYPE_NBD,
|
||||
.node_name = g_strdup(bdrv_get_node_name(bs)),
|
||||
.has_writethrough = true,
|
||||
.writethrough = writethrough,
|
||||
.u.nbd = {
|
||||
.device = g_strdup(bdrv_get_node_name(bs)),
|
||||
.has_name = true,
|
||||
.name = g_strdup(export_name),
|
||||
.has_description = !!export_description,
|
||||
|
Reference in New Issue
Block a user