qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 06/19] Add qemu_opts_validate() for post parsing


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 06/19] Add qemu_opts_validate() for post parsing validation
Date: Fri, 11 Sep 2009 09:47:53 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3

On 09/10/09 17:18, Mark McLoughlin wrote:
Several qemu command line options have a parameter whose value affects
what other parameters are accepted for the option.

In these cases, we can have an empty description table in the
QemuOptsList and once the option has been parsed we can use a suitable
description table to validate the other parameters based on the value of
that parameter.

Hmm. The "empty description" mode is intended to be used in case the verification isn't done by QemuOpts at all (i.e. for -devices, where the qdev property code will do the checks). I really like to have the option description hooked into QemuOptsList.

I can think of two possible ways to do that:

(1) We can stick all possible values info QemuOptsList->desc.  Then
    have separate data structures to describe which fields are allowed
    in which cases (and, while being at it, which fields are mandatory).

(2) We have multiple QemuOptDesc lists for the different cases.

I tend to prefer the first. We can do the option parsing unconditionally in qemu_opt_set() then and don't have two different possible code paths for that.

Comments?  Other ideas?

cheers,
  Gerd





reply via email to

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