[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/34] qemu-nbd: use no_argument/required_argument co
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 11/34] qemu-nbd: use no_argument/required_argument constants |
Date: |
Mon, 22 Feb 2016 17:32:29 +0100 |
From: "Daniel P. Berrange" <address@hidden>
When declaring the 'struct option' array, use the standard
constants no_argument/required_argument, instead of magic
values 0 and 1.
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
qemu-nbd.c | 51 ++++++++++++++++++++++++++-------------------------
1 file changed, 26 insertions(+), 25 deletions(-)
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 9ccfc13..efc427c 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -463,31 +463,32 @@ int main(int argc, char **argv)
const char *sn_id_or_name = NULL;
const char *sopt = "hVb:o:p:rsnP:c:dvk:e:f:tl:x:";
struct option lopt[] = {
- { "help", 0, NULL, 'h' },
- { "version", 0, NULL, 'V' },
- { "bind", 1, NULL, 'b' },
- { "port", 1, NULL, 'p' },
- { "socket", 1, NULL, 'k' },
- { "offset", 1, NULL, 'o' },
- { "read-only", 0, NULL, 'r' },
- { "partition", 1, NULL, 'P' },
- { "connect", 1, NULL, 'c' },
- { "disconnect", 0, NULL, 'd' },
- { "snapshot", 0, NULL, 's' },
- { "load-snapshot", 1, NULL, 'l' },
- { "nocache", 0, NULL, 'n' },
- { "cache", 1, NULL, QEMU_NBD_OPT_CACHE },
- { "aio", 1, NULL, QEMU_NBD_OPT_AIO },
- { "discard", 1, NULL, QEMU_NBD_OPT_DISCARD },
- { "detect-zeroes", 1, NULL, QEMU_NBD_OPT_DETECT_ZEROES },
- { "shared", 1, NULL, 'e' },
- { "format", 1, NULL, 'f' },
- { "persistent", 0, NULL, 't' },
- { "verbose", 0, NULL, 'v' },
- { "object", 1, NULL, QEMU_NBD_OPT_OBJECT },
- { "export-name", 1, NULL, 'x' },
- { "tls-creds", 1, NULL, QEMU_NBD_OPT_TLSCREDS },
- { "image-opts", 0, NULL, QEMU_NBD_OPT_IMAGE_OPTS },
+ { "help", no_argument, NULL, 'h' },
+ { "version", no_argument, NULL, 'V' },
+ { "bind", required_argument, NULL, 'b' },
+ { "port", required_argument, NULL, 'p' },
+ { "socket", required_argument, NULL, 'k' },
+ { "offset", required_argument, NULL, 'o' },
+ { "read-only", no_argument, NULL, 'r' },
+ { "partition", required_argument, NULL, 'P' },
+ { "connect", required_argument, NULL, 'c' },
+ { "disconnect", no_argument, NULL, 'd' },
+ { "snapshot", no_argument, NULL, 's' },
+ { "load-snapshot", required_argument, NULL, 'l' },
+ { "nocache", no_argument, NULL, 'n' },
+ { "cache", required_argument, NULL, QEMU_NBD_OPT_CACHE },
+ { "aio", required_argument, NULL, QEMU_NBD_OPT_AIO },
+ { "discard", required_argument, NULL, QEMU_NBD_OPT_DISCARD },
+ { "detect-zeroes", required_argument, NULL,
+ QEMU_NBD_OPT_DETECT_ZEROES },
+ { "shared", required_argument, NULL, 'e' },
+ { "format", required_argument, NULL, 'f' },
+ { "persistent", no_argument, NULL, 't' },
+ { "verbose", no_argument, NULL, 'v' },
+ { "object", required_argument, NULL, QEMU_NBD_OPT_OBJECT },
+ { "export-name", required_argument, NULL, 'x' },
+ { "tls-creds", required_argument, NULL, QEMU_NBD_OPT_TLSCREDS },
+ { "image-opts", no_argument, NULL, QEMU_NBD_OPT_IMAGE_OPTS },
{ NULL, 0, NULL, 0 }
};
int ch;
--
1.8.3.1
- [Qemu-devel] [PULL 13/34] block migration: Activate image on destination before writing to it, (continued)
- [Qemu-devel] [PULL 13/34] block migration: Activate image on destination before writing to it, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 04/34] block: Fix -incoming with snapshot=on, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 15/34] throttle: Make throttle_conflicting() set errp, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 09/34] qemu-img: allow specifying image as a set of options args, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 16/34] throttle: Make throttle_max_is_missing_limit() set errp, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 06/34] qemu-img: add support for --object command line arg, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 14/34] throttle: Make throttle_compute_timer() static, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 05/34] qemu-io: add support for --object command line arg, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 08/34] qemu-nbd: allow specifying image as a set of options args, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 18/34] throttle: Set always an average value when setting a maximum value, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 11/34] qemu-nbd: use no_argument/required_argument constants,
Kevin Wolf <=
- [Qemu-devel] [PULL 26/34] throttle: Test throttle_compute_wait() during bursts, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 17/34] throttle: Make throttle_is_valid() set errp, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 20/34] throttle: Use throttle_config_init() to initialize ThrottleConfig, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 22/34] throttle: Add command-line settings to define the burst periods, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 33/34] qemu-iotests: 140: don't use IDE device, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 24/34] qapi: Add burst length fields to BlockDeviceInfo, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 19/34] throttle: Merge all functions that check the configuration into one, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 25/34] throttle: Check that burst_level leaks correctly, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 30/34] MAINTAINERS: Add myself as maintainer of the throttling code, Kevin Wolf, 2016/02/22
- [Qemu-devel] [PULL 21/34] throttle: Add support for burst periods, Kevin Wolf, 2016/02/22