From: Ian Campbell Subject: Re: [PATCH 13/19] libxl: suspend: New domain_suspend_pvcontrol_acked Date: Thu, 13 Mar 2014 17:05:20 +0000 Message-ID: <1394730320.16364.21.camel@kazak.uk.xensource.com> References: <1393945016-1417-1-git-send-email-ian.jackson@eu.citrix.com> <1393945016-1417-14-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1393945016-1417-14-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Shriram Rajagopalan , xen-devel@lists.xensource.com, Lai Jiangshan , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Tue, 2014-03-04 at 14:56 +0000, Ian Jackson wrote: > Factor out domain_suspend_pvcontrol_acked. > > This replaces a bunch of open-coded strcmp()s and makes the code > clearer. It also eliminates the need to check for state==NULL each > time it's read, because we can check for NULL once before the strcmp. > > No functional change. > > Signed-off-by: Ian Jackson > CC: Stefano Stabellini > CC: Ian Campbell > --- > tools/libxl/libxl_dom.c | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > > diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c > index 59f6ce3..a0b3a57 100644 > --- a/tools/libxl/libxl_dom.c > +++ b/tools/libxl/libxl_dom.c > @@ -1034,6 +1034,12 @@ static void domain_suspend_common_done(libxl__egc *egc, > libxl__domain_suspend_state *dss, > bool ok); > > +static bool domain_suspend_pvcontrol_acked(const char *state) { > + /* any value other than "suspend", including ENOENT, is OK */ Where ENOENT is indicated by !state I suppose? Assuming so you can mention that here if you like, either way: Acked-by: Ian Campbell