提交 487d211d 编写于 作者: C Cole Robinson

storage: remove support for /usr/bin/kvm-img

This an ubuntu/debian packaging convention. At one point it may have
been an actually different binary, but at least as of ubuntu precise
(the oldest supported ubuntu distro, released april 2012) kvm-img is
just a symlink to qemu-img for back compat.

I think it's safe to drop support for it
上级 1196fed2
...@@ -3072,7 +3072,7 @@ qemuFindQemuImgBinary(virQEMUDriverPtr driver) ...@@ -3072,7 +3072,7 @@ qemuFindQemuImgBinary(virQEMUDriverPtr driver)
{ {
if (!driver->qemuImgBinary) if (!driver->qemuImgBinary)
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unable to find kvm-img or qemu-img")); "%s", _("unable to find qemu-img"));
return driver->qemuImgBinary; return driver->qemuImgBinary;
} }
......
...@@ -718,8 +718,6 @@ qemuStateInitialize(bool privileged, ...@@ -718,8 +718,6 @@ qemuStateInitialize(bool privileged,
goto error; goto error;
} }
qemu_driver->qemuImgBinary = virFindFileInPath("kvm-img");
if (!qemu_driver->qemuImgBinary)
qemu_driver->qemuImgBinary = virFindFileInPath("qemu-img"); qemu_driver->qemuImgBinary = virFindFileInPath("qemu-img");
if (!(qemu_driver->lockManager = if (!(qemu_driver->lockManager =
......
...@@ -153,7 +153,6 @@ static virStorageFileBackendPtr fileBackends[] = { ...@@ -153,7 +153,6 @@ static virStorageFileBackendPtr fileBackends[] = {
enum { enum {
TOOL_QEMU_IMG, TOOL_QEMU_IMG,
TOOL_KVM_IMG,
}; };
#define READ_BLOCK_SIZE_DEFAULT (1024 * 1024) #define READ_BLOCK_SIZE_DEFAULT (1024 * 1024)
...@@ -1234,14 +1233,10 @@ virStorageBackendCreateQemuImg(virConnectPtr conn, ...@@ -1234,14 +1233,10 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA, -1); virCheckFlags(VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA, -1);
/* KVM is usually ahead of qemu on features, so try that first */
create_tool = virFindFileInPath("kvm-img");
if (!create_tool)
create_tool = virFindFileInPath("qemu-img"); create_tool = virFindFileInPath("qemu-img");
if (!create_tool) { if (!create_tool) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unable to find kvm-img or qemu-img")); "%s", _("unable to find qemu-img"));
return -1; return -1;
} }
...@@ -1266,7 +1261,6 @@ virStorageBackendBuildVolFrom ...@@ -1266,7 +1261,6 @@ virStorageBackendBuildVolFrom
virStorageBackendFSImageToolTypeToFunc(int tool_type) virStorageBackendFSImageToolTypeToFunc(int tool_type)
{ {
switch (tool_type) { switch (tool_type) {
case TOOL_KVM_IMG:
case TOOL_QEMU_IMG: case TOOL_QEMU_IMG:
return virStorageBackendCreateQemuImg; return virStorageBackendCreateQemuImg;
default: default:
...@@ -1284,11 +1278,8 @@ virStorageBackendFindFSImageTool(char **tool) ...@@ -1284,11 +1278,8 @@ virStorageBackendFindFSImageTool(char **tool)
int tool_type = -1; int tool_type = -1;
char *tmp = NULL; char *tmp = NULL;
if ((tmp = virFindFileInPath("kvm-img")) != NULL) { if ((tmp = virFindFileInPath("qemu-img")) != NULL)
tool_type = TOOL_KVM_IMG;
} else if ((tmp = virFindFileInPath("qemu-img")) != NULL) {
tool_type = TOOL_QEMU_IMG; tool_type = TOOL_QEMU_IMG;
}
if (tool) if (tool)
*tool = tmp; *tool = tmp;
......
...@@ -1343,14 +1343,10 @@ virStorageBackendFilesystemResizeQemuImg(const char *path, ...@@ -1343,14 +1343,10 @@ virStorageBackendFilesystemResizeQemuImg(const char *path,
char *img_tool; char *img_tool;
virCommandPtr cmd = NULL; virCommandPtr cmd = NULL;
/* KVM is usually ahead of qemu on features, so try that first */
img_tool = virFindFileInPath("kvm-img");
if (!img_tool)
img_tool = virFindFileInPath("qemu-img"); img_tool = virFindFileInPath("qemu-img");
if (!img_tool) { if (!img_tool) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unable to find kvm-img or qemu-img")); "%s", _("unable to find qemu-img"));
return -1; return -1;
} }
......
...@@ -1580,7 +1580,7 @@ virFileIsLink(const char *linkpath) ...@@ -1580,7 +1580,7 @@ virFileIsLink(const char *linkpath)
/* /*
* Finds a requested executable file in the PATH env. e.g.: * Finds a requested executable file in the PATH env. e.g.:
* "kvm-img" will return "/usr/bin/kvm-img" * "qemu-img" will return "/usr/bin/qemu-img"
* *
* You must free the result * You must free the result
*/ */
......
...@@ -137,8 +137,6 @@ testPrepImages(void) ...@@ -137,8 +137,6 @@ testPrepImages(void)
char *buf = NULL; char *buf = NULL;
bool compat = false; bool compat = false;
qemuimg = virFindFileInPath("kvm-img");
if (!qemuimg)
qemuimg = virFindFileInPath("qemu-img"); qemuimg = virFindFileInPath("qemu-img");
if (!qemuimg) if (!qemuimg)
goto skip; goto skip;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册