[libvirt] [PATCH] qemu: improve errors related to offline domains

Eric Blake eblake at redhat.com
Thu Apr 26 20:17:55 UTC 2012


On 04/26/2012 02:11 PM, Stefan Berger wrote:
> On 04/26/2012 03:50 PM, Eric Blake wrote:
> 
>> https://bugzilla.redhat.com/show_bug.cgi?id=816662 pointed out
>> that attempting 'virsh blockpull' on an offline domain gave a
>> misleading error message about qemu lacking support for the
>> operation, even when qemu was specifically updated to support it.
>> The real problem is that we have several capabilities that are
>> only determined when starting a domain, and therefore are still
>> clear when first working with an inactive domain (namely, any
>> capability set by qemuMonitorJSONCheckCommands).

>> @@ -12637,6 +12643,12 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom,
>>
>>       priv = vm->privateData;
>>
>> +    if (!virDomainObjIsActive(vm)) {
>> +        qemuReportError(VIR_ERR_OPERATION_INVALID,
>> +                        "%s", _("domain is not running"));
>> +        goto endjob;
>> +    }
>> +
> Nit, you could move this above the priv =. Neither endjob nor cleanup
> need this priv.
> But 'goto endjob' is wrong (replace with 'goto cleanup'),

D'oh - too much copy-and-paste!  You're obviously right (and this is why
we do code review).

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120426/3699cffc/attachment-0001.sig>


More information about the libvir-list mailing list