提交 c4818812 编写于 作者: P Peter Krempa

qemuBlockStorageSourceGetFormatRawProps: format 'offset' and 'size' for slice

If we have a 'format' type slice for a raw driver we can directly format
the values.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 6efa0461
...@@ -1194,16 +1194,21 @@ qemuBlockStorageSourceGetFormatRawProps(virStorageSourcePtr src, ...@@ -1194,16 +1194,21 @@ qemuBlockStorageSourceGetFormatRawProps(virStorageSourcePtr src,
secretalias = srcPriv->encinfo->s.aes.alias; secretalias = srcPriv->encinfo->s.aes.alias;
} }
/* currently unhandled properties for the 'raw' driver:
* 'offset'
* 'size'
*/
if (virJSONValueObjectAdd(props, if (virJSONValueObjectAdd(props,
"s:driver", driver, "s:driver", driver,
"S:key-secret", secretalias, NULL) < 0) "S:key-secret", secretalias, NULL) < 0)
return -1; return -1;
/* Currently only storage slices are supported. We'll have to calculate
* the union of the slices here if we don't want to be adding needless
* 'raw' nodes. */
if (src->sliceStorage &&
virJSONValueObjectAdd(props,
"U:offset", src->sliceStorage->offset,
"U:size", src->sliceStorage->size,
NULL) < 0)
return -1;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册