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

storagefile: qcow1: Fix check for empty backing file

From f772b3d9 the intention of this code seems to be to set
format=NONE when the image does not have a backing file. However
'buf' here is the whole qcow1 file header. What we want to be
checking is 'res' which is the parsed backing file path.
qcowXGetBackingStore sets this to NULL when there's no backing file.
Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: NCole Robinson <crobinso@redhat.com>
上级 9f508ec7
...@@ -578,7 +578,7 @@ qcow1GetBackingStore(char **res, ...@@ -578,7 +578,7 @@ qcow1GetBackingStore(char **res,
* used to store backing format */ * used to store backing format */
*format = VIR_STORAGE_FILE_AUTO; *format = VIR_STORAGE_FILE_AUTO;
ret = qcowXGetBackingStore(res, NULL, buf, buf_size, false); ret = qcowXGetBackingStore(res, NULL, buf, buf_size, false);
if (ret == BACKING_STORE_OK && *buf == '\0') if (ret == BACKING_STORE_OK && !*res)
*format = VIR_STORAGE_FILE_NONE; *format = VIR_STORAGE_FILE_NONE;
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册