[pve-devel] [PATCH] add a forcemachine parameter to force a specific qemu machine version

Stefan Priebe - Profihost AG s.priebe at profihost.ag
Tue Jun 4 11:03:11 CEST 2013


Am 04.06.2013 10:45, schrieb Dietmar Maurer:
>> Yes and no the idea was that if we may have later a machine configuration in
>> .conf this one still forces the machine to another value.
>>
>> Example:
>> machine config option: pc-q35-1.4
>> You start the VM.
>> change machine config option: pc-q35-1.5 you do a snapshot
>>
>> you rollback - now the config option machine is pc-q35-1.5 but we still need
>> to FORCE to pc-q35-1.4
> 
> What is the problem - I do not see any conflict (the vm_start parameter and the configuration option can
> have the same name).

Sure but if we have a machine option, the user might set it to a value
which is newer than the vm is actually running with.

So we have a snapshot using the actual config which has a wrong value
for machine. Should then the snapshot simply overwrite that machine
value? I wanted to archive that we may have to options in the feature.

forcemachine (used by migration and snapshot)
machine (configurable by the user which might not match the forcemachine)

>>>> +PVE::JSONSchema::register_standard_option('forcemachine', {
>>>> +    description => "Force a specific qemu machine type.",
>>>> +    type => 'string',
>>>> +    maxLength => 128,
>>>> +    optional => 1,
>>>> +});
>>>
>>> Can we have a simple parser for that type?
>>
>> Which kind of parser? Just [a-z0-9-\.]?
> 
> I thought something like:
> 
> (pc|pc(-i440fx)?-\d+\.]d+|q35|pc-q35-\d+\.\d+)
> 
> Seems we can simply use a regex in the JSON schema for that.
> 



More information about the pve-devel mailing list