qemu-img.c (2e024cde1f632d7098f5da742e54186156c6aca9) | qemu-img.c (b65a5e12a4136b20f9d06675d597b52d64ac903c) |
---|---|
1/* 2 * QEMU disk image utility 3 * 4 * Copyright (c) 2003-2008 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 247 unchanged lines hidden (view full) --- 256 return ret; 257} 258#endif 259 260static int print_block_option_help(const char *filename, const char *fmt) 261{ 262 BlockDriver *drv, *proto_drv; 263 QemuOptsList *create_opts = NULL; | 1/* 2 * QEMU disk image utility 3 * 4 * Copyright (c) 2003-2008 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 247 unchanged lines hidden (view full) --- 256 return ret; 257} 258#endif 259 260static int print_block_option_help(const char *filename, const char *fmt) 261{ 262 BlockDriver *drv, *proto_drv; 263 QemuOptsList *create_opts = NULL; |
264 Error *local_err = NULL; |
|
264 265 /* Find driver and parse its options */ 266 drv = bdrv_find_format(fmt); 267 if (!drv) { 268 error_report("Unknown file format '%s'", fmt); 269 return 1; 270 } 271 272 create_opts = qemu_opts_append(create_opts, drv->create_opts); 273 if (filename) { | 265 266 /* Find driver and parse its options */ 267 drv = bdrv_find_format(fmt); 268 if (!drv) { 269 error_report("Unknown file format '%s'", fmt); 270 return 1; 271 } 272 273 create_opts = qemu_opts_append(create_opts, drv->create_opts); 274 if (filename) { |
274 proto_drv = bdrv_find_protocol(filename, true); | 275 proto_drv = bdrv_find_protocol(filename, true, &local_err); |
275 if (!proto_drv) { | 276 if (!proto_drv) { |
276 error_report("Unknown protocol '%s'", filename); | 277 qerror_report_err(local_err); 278 error_free(local_err); |
277 qemu_opts_free(create_opts); 278 return 1; 279 } 280 create_opts = qemu_opts_append(create_opts, proto_drv->create_opts); 281 } 282 283 qemu_opts_print_help(create_opts); 284 qemu_opts_free(create_opts); --- 1234 unchanged lines hidden (view full) --- 1519 /* Find driver and parse its options */ 1520 drv = bdrv_find_format(out_fmt); 1521 if (!drv) { 1522 error_report("Unknown file format '%s'", out_fmt); 1523 ret = -1; 1524 goto out; 1525 } 1526 | 279 qemu_opts_free(create_opts); 280 return 1; 281 } 282 create_opts = qemu_opts_append(create_opts, proto_drv->create_opts); 283 } 284 285 qemu_opts_print_help(create_opts); 286 qemu_opts_free(create_opts); --- 1234 unchanged lines hidden (view full) --- 1521 /* Find driver and parse its options */ 1522 drv = bdrv_find_format(out_fmt); 1523 if (!drv) { 1524 error_report("Unknown file format '%s'", out_fmt); 1525 ret = -1; 1526 goto out; 1527 } 1528 |
1527 proto_drv = bdrv_find_protocol(out_filename, true); | 1529 proto_drv = bdrv_find_protocol(out_filename, true, &local_err); |
1528 if (!proto_drv) { | 1530 if (!proto_drv) { |
1529 error_report("Unknown protocol '%s'", out_filename); | 1531 qerror_report_err(local_err); 1532 error_free(local_err); |
1530 ret = -1; 1531 goto out; 1532 } 1533 1534 if (!skip_create) { 1535 if (!drv->create_opts) { 1536 error_report("Format driver '%s' does not support image creation", 1537 drv->format_name); --- 1551 unchanged lines hidden --- | 1533 ret = -1; 1534 goto out; 1535 } 1536 1537 if (!skip_create) { 1538 if (!drv->create_opts) { 1539 error_report("Format driver '%s' does not support image creation", 1540 drv->format_name); --- 1551 unchanged lines hidden --- |