[libvirt] [PATCH] qemu: Unref domain on error of opening qemu monitor

Osier jyang at redhat.com
Thu Oct 28 04:59:55 UTC 2010


于 2010年10月28日 11:50, Hu Tao 写道:
> On Thu, Oct 28, 2010 at 11:42:12AM +0800, Osier wrote:
>> 于 2010年10月28日 11:06, Hu Tao 写道:
>>> The domain refed will be left unrefed when there is error when opening
>>> qemu monitor, so unref it.
>>> ---
>>>   src/qemu/qemu_driver.c |    6 ++++--
>>>   1 files changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>>> index 25695df..4bcfb27 100644
>>> --- a/src/qemu/qemu_driver.c
>>> +++ b/src/qemu/qemu_driver.c
>>> @@ -1385,7 +1385,7 @@ qemuConnectMonitor(struct qemud_driver *driver, virDomainObjPtr vm)
>>>             (driver->securityDriver,vm)<   0) {
>>>           VIR_ERROR(_("Failed to set security context for monitor for %s"),
>>>                     vm->def->name);
>>> -        goto error;
>>> +        return ret;
>>
>> how could you unref the domain ref? it returns here.. :-)
>> it even will give up closing priv->mon.
>
> 1. The domain is not refed yet here, so we can't unref it later.
> 2. The monitor is not opened yet here, so it is wrong to close it later.
>
ah, right, just looked the entire codes.. :-)

- Osier




More information about the libvir-list mailing list