提交 c87784be 编写于 作者: C Cole Robinson

storagefile: Rename qcow2GetExtensions 'format' argument

To backingFormat, which makes it more clear. Move it to the end of
the argument list which will scale nicer with future patches
Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: NCole Robinson <crobinso@redhat.com>
上级 125dbad3
...@@ -427,9 +427,9 @@ cowGetBackingStore(char **res, ...@@ -427,9 +427,9 @@ cowGetBackingStore(char **res,
static int static int
qcow2GetExtensions(int *format, qcow2GetExtensions(const char *buf,
const char *buf, size_t buf_size,
size_t buf_size) int *backingFormat)
{ {
size_t offset; size_t offset;
size_t extension_start; size_t extension_start;
...@@ -509,8 +509,8 @@ qcow2GetExtensions(int *format, ...@@ -509,8 +509,8 @@ qcow2GetExtensions(int *format,
case QCOW2_HDR_EXTENSION_BACKING_FORMAT: case QCOW2_HDR_EXTENSION_BACKING_FORMAT:
if (buf[offset+len] != '\0') if (buf[offset+len] != '\0')
break; break;
*format = virStorageFileFormatTypeFromString(buf+offset); *backingFormat = virStorageFileFormatTypeFromString(buf+offset);
if (*format <= VIR_STORAGE_FILE_NONE) if (*backingFormat <= VIR_STORAGE_FILE_NONE)
return -1; return -1;
} }
...@@ -561,7 +561,7 @@ qcowXGetBackingStore(char **res, ...@@ -561,7 +561,7 @@ qcowXGetBackingStore(char **res,
memcpy(*res, buf + offset, size); memcpy(*res, buf + offset, size);
(*res)[size] = '\0'; (*res)[size] = '\0';
if (qcow2GetExtensions(format, buf, buf_size) < 0) if (qcow2GetExtensions(buf, buf_size, format) < 0)
return BACKING_STORE_INVALID; return BACKING_STORE_INVALID;
return BACKING_STORE_OK; return BACKING_STORE_OK;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册