[libvirt] [PATCH] qemu: Report nicer error if decompression of save image fails

Peter Krempa pkrempa at redhat.com
Thu Feb 7 17:16:37 UTC 2013


On 02/07/13 18:12, Daniel P. Berrange wrote:
> On Thu, Feb 07, 2013 at 06:09:50PM +0100, Peter Krempa wrote:
>> This patch is a little more specific what failed while trying to restore
>> a guest from a save image.
>> ---
>>   src/qemu/qemu_driver.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>> index 979a027..c96ba7a 100644
>> --- a/src/qemu/qemu_driver.c
>> +++ b/src/qemu/qemu_driver.c
>> @@ -4903,6 +4903,8 @@ qemuDomainSaveImageStartVM(virConnectPtr conn,
>>
>>           if (virCommandWait(cmd, NULL) < 0) {
>>               qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED, 0);
>> +            virReportError(VIR_ERR_OPERATION_FAILED, "%s",
>> +                           _("Decompression of save image failed"));
>
> virCommandWait will already be reporting an error which you're
> now overwriting. Historically this has been a very bad thing
> for us when troubleshooting because you're throwing away the
> more specific details, in favour of a generic error message
> with no detail.

Indeed. I forgot to actually check virCommandWait. I'm myself a fan of 
errors propagated with more specific messages so this isn't fixing anything.

>
>
> Daniel.
>




More information about the libvir-list mailing list