diff options
author | Doug Goldstein <cardoe@gentoo.org> | 2009-06-10 15:34:16 +0000 |
---|---|---|
committer | Doug Goldstein <cardoe@gentoo.org> | 2009-06-10 15:34:16 +0000 |
commit | 03c48ec3ad9f92963f4124c7f25ba5604c9b5929 (patch) | |
tree | aa39ad2a42ac5f06181eb7000147c40c42ad8d02 /app-emulation/libvirt | |
parent | Add patch to build with kernel 2.6.30 released today. (diff) | |
download | gentoo-2-03c48ec3ad9f92963f4124c7f25ba5604c9b5929.tar.gz gentoo-2-03c48ec3ad9f92963f4124c7f25ba5604c9b5929.tar.bz2 gentoo-2-03c48ec3ad9f92963f4124c7f25ba5604c9b5929.zip |
bug fixes for kvm-img support patch
(Portage version: 2.1.6.13/cvs/Linux x86_64)
Diffstat (limited to 'app-emulation/libvirt')
-rw-r--r-- | app-emulation/libvirt/ChangeLog | 8 | ||||
-rw-r--r-- | app-emulation/libvirt/files/libvirt-0.6.4-kvm-img.patch | 38 | ||||
-rw-r--r-- | app-emulation/libvirt/libvirt-0.6.4-r1.ebuild (renamed from app-emulation/libvirt/libvirt-0.6.4.ebuild) | 2 |
3 files changed, 36 insertions, 12 deletions
diff --git a/app-emulation/libvirt/ChangeLog b/app-emulation/libvirt/ChangeLog index 2f76770e401a..e1866a7b9e4f 100644 --- a/app-emulation/libvirt/ChangeLog +++ b/app-emulation/libvirt/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-emulation/libvirt # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.29 2009/06/09 18:37:33 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.30 2009/06/10 15:34:16 cardoe Exp $ + +*libvirt-0.6.4-r1 (10 Jun 2009) + + 10 Jun 2009; Doug Goldstein <cardoe@gentoo.org> -libvirt-0.6.4.ebuild, + +libvirt-0.6.4-r1.ebuild, files/libvirt-0.6.4-kvm-img.patch: + bug fixes for kvm-img support patch 09 Jun 2009; Patrick Lauer <patrick@gentoo.org> libvirt-0.6.4.ebuild: Fixing virtualbox dep for #272264 diff --git a/app-emulation/libvirt/files/libvirt-0.6.4-kvm-img.patch b/app-emulation/libvirt/files/libvirt-0.6.4-kvm-img.patch index c0ad9c1d3d01..74e8dfd753d9 100644 --- a/app-emulation/libvirt/files/libvirt-0.6.4-kvm-img.patch +++ b/app-emulation/libvirt/files/libvirt-0.6.4-kvm-img.patch @@ -1,3 +1,18 @@ +commit 414b18f7dd75537f4bd50ea6476e1b95389d7868 +Author: Doug Goldstein <cardoe@gentoo.org> +Date: Mon Jun 8 12:24:27 2009 -0500 + + Support kvm-img or qemu-img dynamically + + This patch adds a new function virFindFileInPath() and uses it to find + where a binary lives in the PATH environment variable. Using this, we + can dynamically find where utility functions exist (and if they even + exists). So such we remove the build-time check for qemu-img and make it + dynamic for kvm-img and qemu-img. Several distros uses kvm-img over + qemu-img when installing KVM. kvm-img also includes several patches + which Red Hat is trying to upstream with QEMU so this patch supports + those features which are commented out in libvirt when using kvm-img + diff --git a/configure.in b/configure.in index 5c0575c..552c761 100644 --- a/configure.in @@ -37,7 +52,7 @@ index b39216f..0c55684 100644 virFileHasSuffix; virFileLinkPointsTo; diff --git a/src/storage_backend_fs.c b/src/storage_backend_fs.c -index be6d011..ea5de7f 100644 +index be6d011..0175152 100644 --- a/src/storage_backend_fs.c +++ b/src/storage_backend_fs.c @@ -1183,11 +1183,12 @@ static int createFileDir(virConnectPtr conn, @@ -102,7 +117,7 @@ index be6d011..ea5de7f 100644 if (type == NULL) { virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, _("unknown storage vol type %d"), -@@ -1277,17 +1273,45 @@ static int createQemuImg(virConnectPtr conn, +@@ -1277,17 +1273,47 @@ static int createQemuImg(virConnectPtr conn, } } @@ -110,9 +125,11 @@ index be6d011..ea5de7f 100644 + use_kvmimg = 1; + else if ((create_tool = virFindFileInPath("qemu-img")) != NULL) + use_kvmimg = 0; -+ else ++ else { + virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, + _("unable to find kvm-img or qemu-img")); ++ return -1; ++ } + + if (inputvol) { + convargv[0] = create_tool; @@ -149,7 +166,7 @@ index be6d011..ea5de7f 100644 /* * Xen removed the fully-functional qemu-img, and replaced it * with a partially functional qcow-create. Go figure ??!? -@@ -1321,18 +1345,20 @@ static int createQemuCreate(virConnectPtr conn, +@@ -1321,18 +1347,20 @@ static int createQemuCreate(virConnectPtr conn, /* Size in MB - yes different units to qemu-img :-( */ snprintf(size, sizeof(size), "%llu", vol->capacity/1024/1024); @@ -172,7 +189,7 @@ index be6d011..ea5de7f 100644 static int _virStorageBackendFileSystemVolBuild(virConnectPtr conn, -@@ -1341,6 +1367,7 @@ _virStorageBackendFileSystemVolBuild(virConnectPtr conn, +@@ -1341,6 +1369,7 @@ _virStorageBackendFileSystemVolBuild(virConnectPtr conn, { int fd; createFile create_func; @@ -180,7 +197,7 @@ index be6d011..ea5de7f 100644 if (vol->target.format == VIR_STORAGE_VOL_FILE_RAW && (!inputvol || -@@ -1353,17 +1380,20 @@ _virStorageBackendFileSystemVolBuild(virConnectPtr conn, +@@ -1353,17 +1382,20 @@ _virStorageBackendFileSystemVolBuild(virConnectPtr conn, create_func = createRaw; } else if (vol->target.format == VIR_STORAGE_VOL_FILE_DIR) { create_func = createFileDir; @@ -207,10 +224,10 @@ index be6d011..ea5de7f 100644 if (create_func(conn, vol, inputvol) < 0) diff --git a/src/util.c b/src/util.c -index 3a8c105..487349a 100644 +index 3a8c105..664fb0f 100644 --- a/src/util.c +++ b/src/util.c -@@ -1073,7 +1073,34 @@ int virFileResolveLink(const char *linkpath, +@@ -1073,7 +1073,35 @@ int virFileResolveLink(const char *linkpath, #endif } @@ -223,6 +240,7 @@ index 3a8c105..487349a 100644 +char *virFindFileInPath(const char *file) +{ + char pathenv[PATH_MAX]; ++ char *penv = &pathenv; /* this is for glibc 2.10 strsep chnages */ + char *pathseg; + char fullpath[PATH_MAX]; + @@ -232,9 +250,9 @@ index 3a8c105..487349a 100644 + + /* for each path segment, append the file to search for and test for -+ * it. return it if found ++ * it. return it if found. + */ -+ while ((pathseg = strsep(&pathenv, ":")) != NULL) { ++ while ((pathseg = strsep(&penv, ":")) != NULL) { + snprintf(fullpath, PATH_MAX, "%s/%s", pathseg, file); + if (virFileExists(fullpath)) + return strdup(fullpath); diff --git a/app-emulation/libvirt/libvirt-0.6.4.ebuild b/app-emulation/libvirt/libvirt-0.6.4-r1.ebuild index bb1e5aec0d03..5e8a36d5608f 100644 --- a/app-emulation/libvirt/libvirt-0.6.4.ebuild +++ b/app-emulation/libvirt/libvirt-0.6.4-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-0.6.4.ebuild,v 1.2 2009/06/09 18:37:33 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-0.6.4-r1.ebuild,v 1.1 2009/06/10 15:34:16 cardoe Exp $ EAPI="2" |