qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC v3] VFIO Migration


From: Paolo Bonzini
Subject: Re: [RFC v3] VFIO Migration
Date: Tue, 10 Nov 2020 12:12:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

On 10/11/20 10:53, Stefan Hajnoczi wrote:
"allowed_values"
   The list all values that the device implementation accepts for this migration
   parameter. Integer ranges can be described using "<min>-<max>" strings.

   Examples: ['a', 'b', 'c'], [1, 5, 7], ['0-255', 512, '1024-2048'], [true]

   This member is optional. When absent, any value suitable for the type may be
   given but the device implementation may refuse certain values.

I'd rather make this simpler:

- remove allowed_values for strings. Effect: discourages using strings as enums, leaving them only for free-form values such as vendor name or model name.

- remove allowed_values for bools. If off_value is absent the only allowed value is init_value. If off_value is present, both true and false are allowed (and !off_value is the "on_value", so to speak).

- change allowed_values into allowed_min and allowed_max for int values. Advantage: avoids having to parse strings as ranges. Disadvantage: removes expressiveness (cannot say "x must be a power of two"), but I'm not sure it's worth the extra complication.

Thanks,

Paolo

"description"
   A human-readable description of the migration parameter. This is not intended
   for user interfaces but rather as a troubleshooting aid for developers. The
   description is typically written in English. This member is optional.

"init_value"
   The initial parameter value when a device instance is created. This member is
   required.

"off_value"
   The parameter value that disables the effect of this parameter. This member
   is absent if the migration parameter cannot be disabled.

"type"
   The data type ("bool", "int", "str"). This member is required.




reply via email to

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