storagefile: Use qcowXGetBackingStore directly

The qcow1 and qcow2 variants are identical, so remove the wrappers

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2019-10-04 18:14:49 -04:00
parent 6017e7b3b8
commit 242e7ac590

View File

@ -180,9 +180,7 @@ struct FileTypeInfo {
static int cowGetBackingStore(char **, int *, static int cowGetBackingStore(char **, int *,
const char *, size_t); const char *, size_t);
static int qcow1GetBackingStore(char **, int *, static int qcowXGetBackingStore(char **, int *,
const char *, size_t);
static int qcow2GetBackingStore(char **, int *,
const char *, size_t); const char *, size_t);
static int qcow2GetFeatures(virBitmapPtr *features, int format, static int qcow2GetFeatures(virBitmapPtr *features, int format,
char *buf, ssize_t len); char *buf, ssize_t len);
@ -366,14 +364,14 @@ static struct FileTypeInfo const fileTypeInfo[] = {
LV_BIG_ENDIAN, 4, 4, {1}, LV_BIG_ENDIAN, 4, 4, {1},
QCOWX_HDR_IMAGE_SIZE, 8, 1, QCOWX_HDR_IMAGE_SIZE, 8, 1,
qcow1EncryptionInfo, qcow1EncryptionInfo,
qcow1GetBackingStore, NULL qcowXGetBackingStore, NULL
}, },
[VIR_STORAGE_FILE_QCOW2] = { [VIR_STORAGE_FILE_QCOW2] = {
0, "QFI", NULL, 0, "QFI", NULL,
LV_BIG_ENDIAN, 4, 4, {2, 3}, LV_BIG_ENDIAN, 4, 4, {2, 3},
QCOWX_HDR_IMAGE_SIZE, 8, 1, QCOWX_HDR_IMAGE_SIZE, 8, 1,
qcow2EncryptionInfo, qcow2EncryptionInfo,
qcow2GetBackingStore, qcowXGetBackingStore,
qcow2GetFeatures qcow2GetFeatures
}, },
[VIR_STORAGE_FILE_QED] = { [VIR_STORAGE_FILE_QED] = {
@ -565,25 +563,6 @@ qcowXGetBackingStore(char **res,
} }
static int
qcow1GetBackingStore(char **res,
int *format,
const char *buf,
size_t buf_size)
{
return qcowXGetBackingStore(res, format, buf, buf_size);
}
static int
qcow2GetBackingStore(char **res,
int *format,
const char *buf,
size_t buf_size)
{
return qcowXGetBackingStore(res, format, buf, buf_size);
}
static int static int
vmdk4GetBackingStore(char **res, vmdk4GetBackingStore(char **res,
int *format, int *format,