qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Chunyan Liu <cyliu@suse.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: stefanha@gmail.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 2/3] Extract code to nbd_setup function to be used for many purposes
Date: Mon, 5 Dec 2011 13:46:47 +0800	[thread overview]
Message-ID: <CAERYnoZZJGGLuJrZ-Hi8sAqyJ09B6NGQ8f=hu1Gkxyp1yGqQjA@mail.gmail.com> (raw)
In-Reply-To: <4ED8FDA7.3090901@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]

2011/12/3 Paolo Bonzini <pbonzini@redhat.com>

> On 12/02/2011 04:27 PM, Chunyan Liu wrote:
>
>> @@ -42,6 +42,18 @@ static int verbose;
>>  static char *device;
>>  static char *srcpath;
>>  static char *sockpath;
>> +static int is_sockpath_option;
>> +static int sigterm_fd[2];
>> +static off_t dev_offset;
>> +static uint32_t nbdflags;
>> +static bool disconnect;
>> +static const char *bindto = "0.0.0.0";
>> +static int port = NBD_DEFAULT_PORT;
>> +static int li;
>> +static int flags = BDRV_O_RDWR;
>> +static int partition = -1;
>> +static int shared = 1;
>> +static int persistent;
>>
>
> A lot of statics... "li" seems unused.
>

Using these statics simply because most of them are global parameters
getting from command line options, will be used later. Otherwise, the
nbd_setup() function should take many parameters.

Ahh, "li" could be defined in main(). After getting parameters from option,
later places can use "port".
       case 'p':
            li = strtol(optarg, &end, 0);
            if (*end) {
                errx(EXIT_FAILURE, "Invalid port `%s'", optarg);
            }
            if (li < 1 || li > 65535) {
                errx(EXIT_FAILURE, "Port out of range `%s'", optarg);
            }
            port = (uint16_t)li;


> I took patch 1/3 in my tree (git://github.com/bonzini/**qemu.git<http://github.com/bonzini/qemu.git>branch nbd-server).  I'll post it together with my patches next week.
>
> Paolo
>
>

[-- Attachment #2: Type: text/html, Size: 2225 bytes --]

  reply	other threads:[~2011-12-05  5:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-02 15:27 [Qemu-devel] [PATCH v4 1/3] Update ioctl order in nbd_init() to detect EBUSY Chunyan Liu
2011-12-02 15:27 ` [Qemu-devel] [PATCH v4 2/3] Extract code to nbd_setup function to be used for many purposes Chunyan Liu
2011-12-02 16:32   ` Paolo Bonzini
2011-12-05  5:46     ` Chunyan Liu [this message]
2011-12-05 13:16       ` Stefan Hajnoczi
2011-12-06  6:56         ` Chunyan Liu
2011-12-06  7:59           ` Paolo Bonzini
2011-12-06  8:42             ` Chunyan Liu
2011-12-06  8:44               ` Paolo Bonzini
2011-12-06  9:01                 ` Chunyan Liu
2011-12-07  4:23                   ` Chunyan Liu
2011-12-07  9:44                     ` Paolo Bonzini
2011-12-08 11:55                     ` Stefan Hajnoczi
2011-12-09  8:31                       ` Chunyan Liu
2011-12-09  9:36                         ` Stefan Hajnoczi
2011-12-02 15:27 ` [Qemu-devel] [PATCH v4 3/3] Add -f option to qemu-nbd Chunyan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAERYnoZZJGGLuJrZ-Hi8sAqyJ09B6NGQ8f=hu1Gkxyp1yGqQjA@mail.gmail.com' \
    --to=cyliu@suse.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).