Lines Matching +full:use +full:- +full:case
5 * Copyright (c) 2003-2005 Silicon Graphics, Inc.
8 * See the COPYING file in the top-level directory.
18 #include "qemu/help-texts.h"
21 #include "qemu-io.h"
22 #include "qemu/error-report.h"
23 #include "qemu/main-loop.h"
26 #include "qemu/config-file.h"
33 #include "system/block-backend.h"
37 #include "qemu-version.h"
44 /* qemu-io commands passed using -c */
56 return 0x4; /* Ctrl-D */ in get_eof_char()
63 return 0x4; /* Ctrl-D */ in get_eof_char()
102 error_report("-U conflicts with image options"); in openfile()
127 " 'open -n -o driver=raw /tmp/data' - opens raw data file read-write, uncached\n" in open_help()
129 " Opens a file for subsequent use by all of the other qemu-io commands.\n" in open_help()
130 " -r, -- open file read-only\n" in open_help()
131 " -s, -- use snapshot file\n" in open_help()
132 " -C, -- use copy-on-read\n" in open_help()
133 " -n, -- disable host cache, short for -t none\n" in open_help()
134 " -U, -- force shared permissions\n" in open_help()
135 " -k, -- use kernel AIO implementation (Linux only, prefer use of -i)\n" in open_help()
136 " -i, -- use AIO mode (threads, native or io_uring)\n" in open_help()
137 " -t, -- use the given cache mode for the image\n" in open_help()
138 " -d, -- use the given discard mode for the image\n" in open_help()
139 " -o, -- options to be given to the block driver" in open_help()
150 .argmax = -1,
152 .args = "[-rsCnkU] [-t cache] [-d discard] [-o options] [path]",
178 while ((c = getopt(argc, argv, "snCro:ki:t:d:U")) != -1) { in open_f()
180 case 's': in open_f()
183 case 'n': in open_f()
187 case 'C': in open_f()
190 case 'r': in open_f()
193 case 'k': in open_f()
196 case 't': in open_f()
200 return -EINVAL; in open_f()
203 case 'd': in open_f()
207 return -EINVAL; in open_f()
210 case 'i': in open_f()
214 return -EINVAL; in open_f()
217 case 'o': in open_f()
219 printf("--image-opts and 'open -o' are mutually exclusive\n"); in open_f()
221 return -EINVAL; in open_f()
225 return -EINVAL; in open_f()
228 case 'U': in open_f()
234 return -EINVAL; in open_f()
242 if (imageOpts && (optind == argc - 1)) { in open_f()
245 return -EINVAL; in open_f()
254 if (optind == argc - 1) { in open_f()
261 return -EINVAL; in open_f()
265 return -EINVAL; in open_f()
281 .argmin = -1,
282 .argmax = -1,
290 "Usage: %s [OPTIONS]... [-c STRING]... [file]\n" in usage()
293 " --object OBJECTDEF define an object such as 'secret' for\n" in usage()
295 " --image-opts treat file as option string\n" in usage()
296 " -c, --cmd STRING execute command with its arguments\n" in usage()
298 " -f, --format FMT specifies the block driver to use\n" in usage()
299 " -r, --read-only export read-only\n" in usage()
300 " -s, --snapshot use snapshot file\n" in usage()
301 " -n, --nocache disable host cache, short for -t none\n" in usage()
302 " -C, --copy-on-read enable copy-on-read\n" in usage()
303 " -m, --misalign misalign allocations for O_DIRECT\n" in usage()
304 " -k, --native-aio use kernel AIO implementation\n" in usage()
305 " (Linux only, prefer use of -i)\n" in usage()
306 " -i, --aio=MODE use AIO mode (threads, native or io_uring)\n" in usage()
307 " -t, --cache=MODE use the given cache mode for the image\n" in usage()
308 " -d, --discard=MODE use the given discard mode for the image\n" in usage()
309 " -T, --trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n" in usage()
311 " see qemu-img(1) man page for full description\n" in usage()
312 " -U, --force-share force shared permissions\n" in usage()
313 " -h, --help display this help and exit\n" in usage()
314 " -V, --version output version information and exit\n" in usage()
316 "See '%s -c help' for information on available commands.\n" in usage()
391 if (p != line && p[-1] == '\n') { in fetchline_fgets()
392 p[-1] = '\0'; in fetchline_fgets()
473 cmdline[ncmdline - 1] = user_cmd; in add_user_command()
505 { "read-only", no_argument, NULL, 'r' }, in main()
508 { "copy-on-read", no_argument, NULL, 'C' }, in main()
510 { "native-aio", no_argument, NULL, 'k' }, in main()
516 { "image-opts", no_argument, NULL, OPTION_IMAGE_OPTS }, in main()
517 { "force-share", no_argument, 0, 'U'}, in main()
544 while ((c = getopt_long(argc, argv, sopt, lopt, &opt_index)) != -1) { in main()
546 case 's': in main()
549 case 'n': in main()
553 case 'C': in main()
556 case 'd': in main()
562 case 'f': in main()
565 case 'c': in main()
568 case 'r': in main()
571 case 'm': in main()
574 case 'k': in main()
577 case 'i': in main()
583 case 't': in main()
589 case 'T': in main()
592 case 'V': in main()
596 case 'h': in main()
599 case 'U': in main()
602 case OPTION_OBJECT: in main()
605 case OPTION_IMAGE_OPTS: in main()
614 if ((argc - optind) > 1) { in main()
620 error_report("--image-opts and -f are mutually exclusive"); in main()
652 if ((argc - optind) == 1) { in main()