qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC] remove QEMUOptionParameter


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH RFC] remove QEMUOptionParameter
Date: Fri, 07 Sep 2012 13:42:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]