qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 4/5] migration: Make find_dirty_block() return a single param


From: Dr. David Alan Gilbert
Subject: Re: [PATCH 4/5] migration: Make find_dirty_block() return a single parameter
Date: Thu, 28 Jul 2022 10:07:14 +0100
User-agent: Mutt/2.2.6 (2022-06-05)

* Juan Quintela (quintela@redhat.com) wrote:
> "Dr. David Alan Gilbert" <dgilbert@redhat.com> wrote:
> > * Juan Quintela (quintela@redhat.com) wrote:
> >> We used to return two bools, just return a single int with the
> >> following meaning:
> >> 
> >> old return / again / new return
> >> false        false   0
> >> false        true    1
> >> true         true    2  /* We don't care about again at all */
> >
> > We shouldn't use magic numbers; if you want to return it in a single
> > value then it should be an enum so it is clear.
> 
> I need to also return an error in the following patches.
> I am not sure if it clearer to try to change to an enum.
> Will try and see.

Well even if you used a const or #define, it would be better than having
0/1/2 all over.

Dave

> Later, Juan.
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK




reply via email to

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