Revision 9a2d77ad qemu-io.c

b/qemu-io.c
1307 1307
" 'open -Cn /tmp/data' - creates/opens data file read-write and uncached\n"
1308 1308
"\n"
1309 1309
" Opens a file for subsequent use by all of the other qemu-io commands.\n"
1310
" -C, -- create new file if it doesn't exist\n"
1311 1310
" -r, -- open file read-only\n"
1312 1311
" -s, -- use snapshot file\n"
1313 1312
" -n, -- disable host cache\n"
......
1337 1336
	int growable = 0;
1338 1337
	int c;
1339 1338

  
1340
	while ((c = getopt(argc, argv, "snCrg")) != EOF) {
1339
	while ((c = getopt(argc, argv, "snrg")) != EOF) {
1341 1340
		switch (c) {
1342 1341
		case 's':
1343 1342
			flags |= BDRV_O_SNAPSHOT;
......
1345 1344
		case 'n':
1346 1345
			flags |= BDRV_O_NOCACHE;
1347 1346
			break;
1348
		case 'C':
1349
			flags |= BDRV_O_CREAT;
1350
			break;
1351 1347
		case 'r':
1352 1348
			readonly = 1;
1353 1349
			break;
......
1395 1391
static void usage(const char *name)
1396 1392
{
1397 1393
	printf(
1398
"Usage: %s [-h] [-V] [-Crsnm] [-c cmd] ... [file]\n"
1394
"Usage: %s [-h] [-V] [-rsnm] [-c cmd] ... [file]\n"
1399 1395
"QEMU Disk exerciser\n"
1400 1396
"\n"
1401
"  -C, --create         create new file if it doesn't exist\n"
1402 1397
"  -c, --cmd            command to execute\n"
1403 1398
"  -r, --read-only      export read-only\n"
1404 1399
"  -s, --snapshot       use snapshot file\n"
......
1417 1412
{
1418 1413
	int readonly = 0;
1419 1414
	int growable = 0;
1420
	const char *sopt = "hVc:Crsnmgk";
1415
	const char *sopt = "hVc:rsnmgk";
1421 1416
        const struct option lopt[] = {
1422 1417
		{ "help", 0, NULL, 'h' },
1423 1418
		{ "version", 0, NULL, 'V' },
1424 1419
		{ "offset", 1, NULL, 'o' },
1425 1420
		{ "cmd", 1, NULL, 'c' },
1426
		{ "create", 0, NULL, 'C' },
1427 1421
		{ "read-only", 0, NULL, 'r' },
1428 1422
		{ "snapshot", 0, NULL, 's' },
1429 1423
		{ "nocache", 0, NULL, 'n' },
......
1449 1443
		case 'c':
1450 1444
			add_user_command(optarg);
1451 1445
			break;
1452
		case 'C':
1453
			flags |= BDRV_O_CREAT;
1454
			break;
1455 1446
		case 'r':
1456 1447
			readonly = 1;
1457 1448
			break;

Also available in: Unified diff