Am 07.09.2012 10:42, schrieb Markus Armbruster: >> @@ -1628,51 +1625,6 @@ static int qcow2_load_vmstate(BlockDriverState *bs, >> uint8_t *buf, >> return ret; >> } >> >> -static QEMUOptionParameter qcow2_create_options[] = { >> - { >> - .name = BLOCK_OPT_SIZE, >> - .type = OPT_SIZE, >> - .help = "Virtual disk size" >> - }, >> - { >> - .name = BLOCK_OPT_COMPAT_LEVEL, >> - .type = OPT_STRING, >> - .help = "Compatibility level (0.10 or 1.1)" >> - }, >> - { >> - .name = BLOCK_OPT_BACKING_FILE, >> - .type = OPT_STRING, >> - .help = "File name of a base image" >> - }, >> - { >> - .name = BLOCK_OPT_BACKING_FMT, >> - .type = OPT_STRING, >> - .help = "Image format of the base image" >> - }, >> - { >> - .name = BLOCK_OPT_ENCRYPT, >> - .type = OPT_FLAG, >> - .help = "Encrypt the image" >> - }, >> - { >> - .name = BLOCK_OPT_CLUSTER_SIZE, >> - .type = OPT_SIZE, >> - .help = "qcow2 cluster size", >> - .value = { .n = DEFAULT_CLUSTER_SIZE }, >> - }, >> - { >> - .name = BLOCK_OPT_PREALLOC, >> - .type = OPT_STRING, >> - .help = "Preallocation mode (allowed values: off, metadata)" >> - }, >> - { >> - .name = BLOCK_OPT_LAZY_REFCOUNTS, >> - .type = OPT_FLAG, >> - .help = "Postpone refcount updates", >> - }, >> - { NULL } >> -}; >> - > > Replacement moves to qemu-config.c. Not sure that's an improvement, but > it's how QemuOpts generally work. For an exception, see QemuOptsList > use in blkdebug.c.
Yes, please follow the example of blkdebug.c. There's no reason to have these QemuOptsLists global as they don't make sense in a qemu config file. Another important reason is that in order to add or remove a file format, you don't have to change anything outside the image format implementation, you just link an additional object file. Moving part of it into qemu-config.c hurts the modularity. Kevin