@@ -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'
@@ -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;
}