From: Matthias Bolte Date: Mon, 4 Jul 2011 08:49:54 +0000 (+0200) Subject: qemu: Fix virFileMakePath error handling in snapshot creation X-Git-Tag: v0.9.4-rc1~309 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a03db81cd6cc9626bd9b5b9273add32ee5eadfe;p=thirdparty%2Flibvirt.git qemu: Fix virFileMakePath error handling in snapshot creation virFileMakePath returns an errno value on error, that will never be negative. An virFileMakePath error would have been ignored here, instead of being reported correctly. --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 363a361b21..aab3ab96da 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -7498,7 +7498,7 @@ static int qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm, goto cleanup; } err = virFileMakePath(snapDir); - if (err < 0) { + if (err != 0) { virReportSystemError(err, _("cannot create snapshot directory '%s'"), snapDir); goto cleanup;