mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemu: block: Extract formatting of props for 'file' backend
'file' backend in qemu supports few more options than the current implementation. Extract it so that changes don't pollute the code. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
8a78f88a1a
commit
0304e675c0
@ -974,6 +974,18 @@ qemuBlockStorageSourceGetSshProps(virStorageSourcePtr src)
|
||||
}
|
||||
|
||||
|
||||
static virJSONValuePtr
|
||||
qemuBlockStorageSourceGetFileProps(virStorageSourcePtr src)
|
||||
{
|
||||
virJSONValuePtr ret = NULL;
|
||||
|
||||
ignore_value(virJSONValueObjectCreate(&ret,
|
||||
"s:driver", "file",
|
||||
"s:filename", src->path, NULL) < 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* qemuBlockStorageSourceGetBackendProps:
|
||||
* @src: disk source
|
||||
@ -991,9 +1003,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src)
|
||||
case VIR_STORAGE_TYPE_BLOCK:
|
||||
case VIR_STORAGE_TYPE_FILE:
|
||||
case VIR_STORAGE_TYPE_DIR:
|
||||
if (virJSONValueObjectCreate(&fileprops,
|
||||
"s:driver", "file",
|
||||
"s:filename", src->path, NULL) < 0)
|
||||
if (!(fileprops = qemuBlockStorageSourceGetFileProps(src)))
|
||||
return NULL;
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user