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

Re: [Xen-devel] [PATCH: Lazy Restore] xl restore: Add a new "-l" lazy switch.



On Wed, Jun 4, 2014 at 6:19 PM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
> On Wed, 2014-06-04 at 18:12 +0530, Dushyant Behl wrote:
>> On Mon, Jun 2, 2014 at 9:34 PM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> 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)
>

Sorry but the file tools/libxl/CODING_STYLE has mentioned the following
statement for block structure -

5. Block structure
Every indented statement is braced apart from blocks that contain just
one statement.
The opening brace is on the line that contains the control flow
statement that introduces the new block; the closing brace is on the
same line as the else keyword, or on a line by itself if there is no
else keyword.  Examples:

    if (a == 5) {
        printf("a was 5.\n");
    } else if (a == 6) {
        printf("a was 6.\n");
    } else {
        printf("a was something else entirely.\n");
    }

An exception is the opening brace for a function; for reasons of tradition
and clarity it comes on a line by itself:

    void a_function(void)
    {
        do_something();
    }

The statement which you have mentioned in the mail was actually mentioned
in the file xen/CODING_STYLE. I was actually following the file
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.
>
Sure, I'll update the macro name to this.

Thanks and Regards,
Dushyant Behl

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.