[libvirt] [PATCH 3/3] qemu: avoid dead store in doPeer2PeerMigrate3

Alex Jia ajia at redhat.com
Mon Aug 8 02:28:06 UTC 2011


On 08/05/2011 11:15 PM, Eric Blake wrote:
> On 08/05/2011 02:12 AM, Alex Jia wrote:
>> On 08/04/2011 10:27 PM, Eric Blake wrote:
>>> On 08/03/2011 11:30 PM, Alex Jia wrote:
>>>> Value stored to 'ret' is never read. If Confirm3 returns -1, there's
>>>> nothing
>>>> more we can do, here should remove this dead assignment.
>>>>
>>>> * src/qemu/qemu_migration.c: kill dead assignment.
>>>>
>>>> Signed-off-by: Alex Jia<ajia at redhat.com>
>>>> ---
>>>> src/qemu/qemu_migration.c | 6 +++---
>>>> 1 files changed, 3 insertions(+), 3 deletions(-)
>>>
>>> I'm thinking NACK as written. We should probably emit a log message if
>>> confirm failed, at which point, ret would be used in the conditional
>>> deciding whether to do a log message. Furthermore, libvirt.c
>>> virDomainMigrateVersion3 has the same bug with a dead assignment to
>>> ret; we should solve it in the same way for both implementations.
>>>
>> Eric, I haven't figured out a apposite error number in virterror.h,
>> whether we need to define a new error number like this:
>>
>> VIR_ERR_MIGRATE_CONFIRM_FAILED = 75, /* a migration finished, but
>> confirmation failed, there is a domain probably left in 'paused' state
>> on source.*/
>
> That's if we want to report the error back to the caller and fail the 
> API.  But the migration happened - it is running on the destination, 
> so I think we have to make the API return success.  Which means that 
> we don't need a new VIR_ERR_* value, rather, we just need a new 
> VIR_WARN() call to guarantee a log entry but nothing further.
>
Yeah, only need to record warning information into log.

Thanks,
Alex




More information about the libvir-list mailing list