[pve-devel] [PATCH qemu-server 02/13] add 'arch' vm configuration

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Oct 29 12:17:36 CET 2018


On Mon, Oct 29, 2018 at 11:31:23AM +0100, Thomas Lamprecht wrote:
> Am 10/29/2018 um 11:17 AM schrieb Dominik Csapak:
> > On 10/29/18 10:28 AM, Thomas Lamprecht wrote:
> >> Am 10/25/2018 um 04:19 PM schrieb Dominik Csapak:
> >>> On 10/24/18 10:56 AM, Wolfgang Bumiller wrote:
> >>>> @@ -3175,7 +3215,7 @@ sub config_to_command {
> >>>>          my $q35 = machine_type_is_q35($conf);
> >>>>        my $hotplug_features = parse_hotplug_features(defined($conf->{hotplug}) ? $conf->{hotplug} : '1');
> >>>> -    my $machine_type = $forcemachine || $conf->{machine};
> >>>> +    my $machine_type = $forcemachine || $base_machine;
> >>>
> >>> this seems wrong, since we lose all version info about the machine
> >>> (e.g. if someone uses pc-2.5)
> >>
> >> the get_basic_machine_info sub uses $conf->{machine} so your implication is wrong?
> >> This look OK, AFAICT.
> > 
> > but get_basic_machine_info removes that:
> > 
> > sub get_basic_machine_info {
> >     my ($conf) = @_;
> > 
> >     my $arch = $conf->{arch} // get_host_arch();
> > 
> >     # $base_machine is the "base" type (q35, i440fx, virt) without version or pxe
> >     # suffix...
> >     my $base_machine = $conf->{machine} || $default_machines->{$arch};
> >     $base_machine =~ s/-\d.*$//;
> >     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ here the versions get removed
> 
> Hmm, OK - true. (maybe next time I should read the comment above ^^)
> 
> But versioned virt-x.y works just fine:
> 
> > kvm -machine \?                                                                                                                                                                                                      
> > Supported machines are:                                                                                                                                                                                                               
> > akita                Sharp SL-C1000 (Akita) PDA (PXA270)
> > [...]
> > virt-2.10            QEMU 2.10 ARM Virtual Machine
> > virt-2.11            QEMU 2.11 ARM Virtual Machine
> > virt                 QEMU 2.12 ARM Virtual Machine (alias of virt-2.12)
> > virt-2.12            QEMU 2.12 ARM Virtual Machine
> > virt-2.6             QEMU 2.6 ARM Virtual Machine
> > virt-2.7             QEMU 2.7 ARM Virtual Machine
> > virt-2.8             QEMU 2.8 ARM Virtual Machine
> > virt-2.9             QEMU 2.9 ARM Virtual Machine
> > xilinx-zynq-a9       Xilinx Zynq Platform Baseboard for Cortex-A9
> > xlnx-ep108           Xilinx ZynqMP EP108 board (Deprecated, please use xlnx-zcu102)
> > xlnx-zcu102          Xilinx ZynqMP ZCU102 board with 4xA53s and 2xR5s based on the value of smp
> > z2                   Zipit Z2 (PXA27x)
> 
> so what's the point in doing that, wolfgang?

Changing $machine_type was a leftover and should be removed from the
patch. $base_machine is supposed to describe the base hardware. 'pc',
'q35', 'virt', to make it easier to actually use it in eg. PCI.pm
without having to regex-match the types all the time because of version
numbers interfering with a simple `eq` check ;-)

> 
> > 
> >     return ($arch, $base_machine);
> > }
> > 
> > 
> >>
> >>>
> >>>>        my $use_old_bios_files = undef;
> >>>>        ($use_old_bios_files, $machine_type) = qemu_use_old_bios_files($machine_type);
> >>>>   
> 




More information about the pve-devel mailing list