提交 762f67f2 编写于 作者: Z zhencliu

Export a qcow2 persistent bitmap with qemu-nbd

Signed-off-by: NZhenchao Liu <zhencliu@redhat.com>
上级 8ed4c122
......@@ -272,6 +272,9 @@ variants image_backend:
# On an unexpected disconnect, the nbd client tries to connect again
# until succeeding or encountering a serious error, optional
#nbd_reconnect_delay =
# The qcow2 persistent bitmap name, expose that bitmap via the "qemu:dirty-bitmap:name",
# used for qemu-nbd, optional
#nbd_export_bitmap =
- libcurl:
storage_type = curl
enable_curl = yes
......
......@@ -55,10 +55,11 @@ def export_image(qemu_nbd, filename, local_image, params):
"unix_socket": "",
"filename": "",
"fork": "--fork",
"pid_file": ""
"pid_file": "",
"bitmap": ""
}
export_cmd = ('{secret_object} {tls_creds} '
'{export_format} {persistent} {desc} {port} '
'{export_format} {persistent} {desc} {port} {bitmap} '
'{export_name} {fork} {pid_file} {unix_socket} {filename}')
pid_file = utils_misc.generate_tmp_file_name('%s_nbd_server' % local_image,
......@@ -105,6 +106,9 @@ def export_image(qemu_nbd, filename, local_image, params):
tls_creds=params['nbd_server_tls_creds']
)
if params.get('nbd_export_bitmap'):
cmd_dict['bitmap'] = '-B %s' % params['nbd_export_bitmap']
qemu_nbd_pid = None
cmdline = qemu_nbd + ' ' + string.Formatter().format(export_cmd,
**cmd_dict)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册