qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 06/10] qemu-ga: Add Windows VSS provider to q


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v4 06/10] qemu-ga: Add Windows VSS provider to quiesce applications on fsfreeze
Date: Fri, 28 Jun 2013 09:05:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

Il 28/06/2013 00:25, Tomoki Sekiyama ha scritto:
>>>>> >>>> +STDMETHODIMP CQGAVssProviderFactory::CreateInstance(
>>>>> >>>> +    IUnknown *pUnknownOuter, REFIID iid, void **ppv)
>>>>> >>>> +{
>>>>> >>>> +    if (pUnknownOuter) {
>>>>> >>>> +        return CLASS_E_NOAGGREGATION;
>>>>> >>>> +    }
>>>>> >>>> +    CQGAVssProvider *pObj = new CQGAVssProvider;
>>>>> >>>> +    if (!pObj) {
>>>>> >>>> +        return E_OUTOFMEMORY;
>>>>> >>>> +    }
>> >
>> >(We generally assume that memory allocation never fails.)
> Ah, OK...

Actually, we do because we use g_malloc/g_free.  The functions exit on
memory allocation failure.  I'm not sure the same is true of the new
operator... doesn't it throw an exception on allocation failure (that's
what I vaguely remember)?

Also, this is not running in the context of qemu-ga, so I think it is
better to be more conservative and trap memory allocation failure.


Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]