From: Ian Campbell Subject: Re: [PATCH: Lazy Restore] xl restore: Add a new "-l" lazy switch. Date: Wed, 4 Jun 2014 13:49:00 +0100 Message-ID: <1401886140.21220.18.camel@kazak.uk.xensource.com> References: <1401303887-27439-1-git-send-email-myselfdushyantbehl@gmail.com> <1401303887-27439-2-git-send-email-myselfdushyantbehl@gmail.com> <1401725092.8841.8.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dushyant Behl Cc: Andres Lagar Cavilla , Stefano Stabellini , ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2014-06-04 at 18:12 +0530, Dushyant Behl wrote: > On Mon, Jun 2, 2014 at 9:34 PM, Ian Campbell wrote: > > On Thu, 2014-05-29 at 00:34 +0530, Dushyant Behl wrote: > >> @@ -1470,6 +1470,15 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom, > >> > >> DPRINTF("%s: starting restore of new domid %u", __func__, dom); > >> > >> + if ( lazy ) { > > > > Coding style for libxc (see toplevel CODING_STYLE doc) has { on the next > > line under the if. > > I checked with the CODING_STYLE doc and the block structure mentioned is > the same followed by me ( opening bracket on the same line as the statement). > The only exception that is mentioned to have opening bracket for a block on > a different line is a function. Not sure which doc you are looking at, CODING_STYLE at the top of the repo applies to tools/libxc/* and says: Braces ('{' and '}') are usually placed on a line of their own, except for the do/while loop. This is unlike the Linux coding style and unlike K&R. do/while loops are an exception. e.g.: if ( condition ) { /* Do stuff. */ } (Note that libxl has a different style, see tools/libxl/CODING_STYLE) > >> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl > >> index 52f1aa9..6c8355c 100644 > >> --- a/tools/libxl/libxl_types.idl > >> +++ b/tools/libxl/libxl_types.idl > >> @@ -282,6 +282,7 @@ libxl_domain_create_info = Struct("domain_create_info",[ > >> > >> libxl_domain_restore_params = Struct("domain_restore_params", [ > >> ("checkpointed_stream", integer), > >> + ("lazy", integer), > > > > Changes to the libxl interface require a LIBXL_HAVE #define in libxl.h, > > see the comment regarding API compatibility in that file. > > > > I have created a new macro LIBXL_HAVE_RESTORE_PARAMS which is > set when the structure libxl_domain_restore_params has lazy as an attribute. That name sounds to generic, it should be LIBXL_HAVE_DOMAIN_RESTORE_PARAMS_LAZY I think. Ian.