Skip to content
Snippets Groups Projects
Commit fefee85d authored by Kevin Wolf's avatar Kevin Wolf
Browse files

nbd: Add writethrough to block-export-add


qemu-nbd allows use of writethrough cache modes, which mean that write
requests made through NBD will cause a flush before they complete.
Expose the same functionality in block-export-add.

Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
Message-Id: <20200924152717.287415-10-kwolf@redhat.com>
Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 1c8222b0
No related branches found
No related tags found
No related merge requests found
......@@ -216,9 +216,13 @@ BlockExport *nbd_export_create(BlockExportOptions *exp_args, Error **errp)
goto out;
}
if (!exp_args->has_writethrough) {
exp_args->writethrough = false;
}
exp = nbd_export_new(bs, arg->name, arg->description, arg->bitmap,
!arg->writable, !arg->writable,
NULL, false, errp);
NULL, exp_args->writethrough, errp);
if (!exp) {
goto out;
}
......
......@@ -170,10 +170,15 @@
# Describes a block export, i.e. how single node should be exported on an
# external interface.
#
# @writethrough: If true, caches are flushed after every write request to the
# export before completion is signalled. (since: 5.2;
# default: false)
#
# Since: 4.2
##
{ 'union': 'BlockExportOptions',
'base': { 'type': 'BlockExportType' },
'base': { 'type': 'BlockExportType',
'*writethrough': 'bool' },
'discriminator': 'type',
'data': {
'nbd': 'BlockExportOptionsNbd'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment