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

Re: [virt-tools-list] [PATCH RFC] Add support for the new 'removable' disk flag.



03/10/13 23:07, anonym wrote:
> 03/10/13 18:09, Cole Robinson wrote:
>> On 10/02/2013 10:39 AM, Fred A. Kemp wrote:
>> For virt-install, don't worry about adding man page docs unless you want to.
>> Extending the cli is pretty easy, you'll want to edit
>> virtinst/cli.py:parse_disk, see parse_features acpi handling for an example of
>> doing on|off.
> 
> Hmm. I assume you mean something like:
> 
> --- a/virtinst/cli.py
> +++ b/virtinst/cli.py
> @@ -1460,6 +1460,7 @@ def parse_disk(guest, optstr, dev=None,
> validate=True):
> 
>      set_param("device", "device")
>      set_param("bus", "bus")
> +    set_param("removable", "removable", convert_cb=_on_off_convert)
>      set_param("driver_cache", "cache")
>      set_param("driver_name", "driver_name")
>      set_param("driver_type", "driver_type")
> 
> 
> This fails since it tries to set 'removable' in virtinst to True/False,
> but I made it into a "on"/"off"/None tristate. It works for acpi since
> it's a bool in virtinst. Perhaps what you mean in my next quote that you
> want me to make 'removable' into a bool too (then it works)? If so,
> there's an issue with the "future proof[ing]" of the check box for
> 'removable' in virt-manager you requested (see below).
>
> [...]
>> Probably also want to show it if there's an explicit removable setting already
>> set to future proof it a wee bit.
> 
> [...]
> 
> Also, as alluded to above, this will be impossible if you want me to
> make 'removable' into a bool instead of the tristate. Due to the point
> made in my previous paragraph, that isn't much of a problem, IMHO.
> 
> Or have I misunderstood you completely?

I think I got it. I just found out about the 'is_onoff' parameter for
XMLProperty. Its True/False/None tristate solves the above issues. I'll
send a new patch shortly.

Cheers!


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