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

Stefan Priebe s.priebe at profihost.ag
Mon Jun 3 21:25:03 CEST 2013


Am 03.06.2013 10:53, schrieb Dietmar Maurer:
>> diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index
>> 8ed9d5d..3cc66e8 100644
>> --- a/PVE/API2/Qemu.pm
>> +++ b/PVE/API2/Qemu.pm
>> @@ -1327,7 +1327,7 @@ __PACKAGE__->register_method({
>>   	    skiplock => get_standard_option('skiplock'),
>>   	    stateuri => get_standard_option('pve-qm-stateuri'),
>>   	    migratedfrom => get_standard_option('pve-node',{ optional => 1
>> }),
>> -
>> +	    forcemachine => get_standard_option('forcemachine',{ optional
>> => 1
>
> can we simply name if 'machine' (instead of forcemachine)?

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

>> +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-\.]?

Stefan



More information about the pve-devel mailing list