[libvirt] [PATCH] qemu: Fix virFileMakePath error handling in snapshot creation
Matthias Bolte
matthias.bolte at googlemail.com
Tue Jul 5 10:26:39 UTC 2011
2011/7/4 Osier Yang <jyang at redhat.com>:
> 于 2011年07月04日 16:50, Matthias Bolte 写道:
>>
>> virFileMakePath returns an errno value on error, that will never be
>> negative. So a virFileMakePath error whould have been ignored here.
>
> s/whould/should/
No. Actually the typo is s/whould/would/, because an error would have
been ignored, but should have been reported instead.
>> ---
>> src/qemu/qemu_driver.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>> index 363a361..aab3ab9 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;
>
>
> ACK
>
> Osier
>
Thanks, pushed with fixed commit message.
--
Matthias Bolte
http://photron.blogspot.com
More information about the libvir-list
mailing list