[libvirt] PATCH: Fix non-raw storage volume cloning

The recent storage patches broke cloning of non-raw volumes, due to a small typo. THis was identified by the libvirt TCK storage tests! Daniel diff --git a/src/storage_backend.c b/src/storage_backend.c index 1664804..67815d7 100644 --- a/src/storage_backend.c +++ b/src/storage_backend.c @@ -567,7 +567,7 @@ virStorageBackendGetBuildVolFromFunction(virConnectPtr conn, (inputvol->type == VIR_STORAGE_VOL_FILE && inputvol->target.format != VIR_STORAGE_VOL_FILE_RAW)) { - if ((tool_type = virStorageBackendFindFSImageTool(NULL)) != -1) { + if ((tool_type = virStorageBackendFindFSImageTool(NULL)) < 0) { virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s", _("creation of non-raw file images is " "not supported without qemu-img.")); -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Fri, Jul 17, 2009 at 01:08:11PM +0100, Daniel P. Berrange wrote:
The recent storage patches broke cloning of non-raw volumes, due to a small typo. THis was identified by the libvirt TCK storage tests!
ACK ! BTW the enum defining the tool doesn't provide an initializer I usually prefer to set one up like enum { TOOL_QEMU_IMG = 1, ... To be sure what to expect in the code, even if it is supposed to start from zero, currently we compare a value that the compiler choose to define to a -1 (or < 0) arbitrary check. It works but I feel a bit uneasy about this :-) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Daniel P. Berrange wrote:
The recent storage patches broke cloning of non-raw volumes, due to a small typo. THis was identified by the libvirt TCK storage tests!
Go automated testing! ACK from me. - Cole
Daniel
diff --git a/src/storage_backend.c b/src/storage_backend.c index 1664804..67815d7 100644 --- a/src/storage_backend.c +++ b/src/storage_backend.c @@ -567,7 +567,7 @@ virStorageBackendGetBuildVolFromFunction(virConnectPtr conn, (inputvol->type == VIR_STORAGE_VOL_FILE && inputvol->target.format != VIR_STORAGE_VOL_FILE_RAW)) {
- if ((tool_type = virStorageBackendFindFSImageTool(NULL)) != -1) { + if ((tool_type = virStorageBackendFindFSImageTool(NULL)) < 0) { virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s", _("creation of non-raw file images is " "not supported without qemu-img."));
participants (3)
-
Cole Robinson
-
Daniel P. Berrange
-
Daniel Veillard