提交 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)
{
if (!driver->qemuImgBinary)
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unable to find kvm-img or qemu-img"));
"%s", _("unable to find qemu-img"));
return driver->qemuImgBinary;
}
......
......@@ -718,9 +718,7 @@ qemuStateInitialize(bool privileged,
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 =
virLockManagerPluginNew(cfg->lockManagerName ?
......
......@@ -153,7 +153,6 @@ static virStorageFileBackendPtr fileBackends[] = {
enum {
TOOL_QEMU_IMG,
TOOL_KVM_IMG,
};
#define READ_BLOCK_SIZE_DEFAULT (1024 * 1024)
......@@ -1234,14 +1233,10 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
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) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unable to find kvm-img or qemu-img"));
"%s", _("unable to find qemu-img"));
return -1;
}
......@@ -1266,7 +1261,6 @@ virStorageBackendBuildVolFrom
virStorageBackendFSImageToolTypeToFunc(int tool_type)
{
switch (tool_type) {
case TOOL_KVM_IMG:
case TOOL_QEMU_IMG:
return virStorageBackendCreateQemuImg;
default:
......@@ -1284,11 +1278,8 @@ virStorageBackendFindFSImageTool(char **tool)
int tool_type = -1;
char *tmp = NULL;
if ((tmp = virFindFileInPath("kvm-img")) != NULL) {
tool_type = TOOL_KVM_IMG;
} else if ((tmp = virFindFileInPath("qemu-img")) != NULL) {
if ((tmp = virFindFileInPath("qemu-img")) != NULL)
tool_type = TOOL_QEMU_IMG;
}
if (tool)
*tool = tmp;
......
......@@ -1343,14 +1343,10 @@ virStorageBackendFilesystemResizeQemuImg(const char *path,
char *img_tool;
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) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unable to find kvm-img or qemu-img"));
"%s", _("unable to find qemu-img"));
return -1;
}
......
......@@ -1580,7 +1580,7 @@ virFileIsLink(const char *linkpath)
/*
* 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
*/
......
......@@ -137,9 +137,7 @@ testPrepImages(void)
char *buf = NULL;
bool compat = false;
qemuimg = virFindFileInPath("kvm-img");
if (!qemuimg)
qemuimg = virFindFileInPath("qemu-img");
qemuimg = virFindFileInPath("qemu-img");
if (!qemuimg)
goto skip;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册