mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-14 10:19:29 +00:00
use qom-get to check if pxe file are used V2
fix qemu 2.4 pxe -> qemu 2.4 efi Changelog : forget to add a check on qom-get result Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
407e0b8bef
commit
7bac824e19
@ -142,6 +142,16 @@ sub prepare {
|
|||||||
die "cant migrate running VM without --online\n" if !$online;
|
die "cant migrate running VM without --online\n" if !$online;
|
||||||
$running = $pid;
|
$running = $pid;
|
||||||
$self->{forcemachine} = PVE::QemuServer::get_current_qemu_machine($vmid);
|
$self->{forcemachine} = PVE::QemuServer::get_current_qemu_machine($vmid);
|
||||||
|
|
||||||
|
foreach my $opt (keys %$conf) {
|
||||||
|
next if $opt !~ m/^net(\d+)$/;
|
||||||
|
my $net = PVE::QemuServer::parse_net($conf->{$opt});
|
||||||
|
next if !$net;
|
||||||
|
my $romfile = PVE::QemuServer::vm_mon_cmd_nocheck($vmid, 'qom-get', path => $opt, property => 'romfile');
|
||||||
|
$self->{forcemachine} .= '.pxe' if $romfile =~ m/pxe/;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (my $loc_res = PVE::QemuServer::check_local_resources($conf, 1)) {
|
if (my $loc_res = PVE::QemuServer::check_local_resources($conf, 1)) {
|
||||||
|
@ -373,7 +373,7 @@ EODESCR
|
|||||||
machine => {
|
machine => {
|
||||||
description => "Specific the Qemu machine type.",
|
description => "Specific the Qemu machine type.",
|
||||||
type => 'string',
|
type => 'string',
|
||||||
pattern => '(pc|pc(-i440fx)?-\d+\.\d+|q35|pc-q35-\d+\.\d+)',
|
pattern => '(pc|pc(-i440fx)?-\d+\.\d+(\.pxe)?|q35|pc-q35-\d+\.\d+(\.pxe)?)',
|
||||||
maxLength => 40,
|
maxLength => 40,
|
||||||
optional => 1,
|
optional => 1,
|
||||||
},
|
},
|
||||||
@ -2657,12 +2657,20 @@ sub config_to_command {
|
|||||||
push @$cmd, '-p', "CPUQuota=$cpulimit\%";
|
push @$cmd, '-p', "CPUQuota=$cpulimit\%";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Note: kvm version < 2.4 use non-efi pxe files, and have problems when we
|
|
||||||
# load new efi bios files on migration. So this hack is required to allow
|
my $use_old_bios_files = undef;
|
||||||
# live migration from qemu-2.2 to qemu-2.4, which is sometimes used when
|
|
||||||
# updrading from proxmox-ve-3.X to proxmox-ve 4.0
|
if ($machine_type && $machine_type =~ m/^(\S+)\.pxe$/){
|
||||||
my $use_old_bios_files = !qemu_machine_feature_enabled ($machine_type, $kvmver, 2, 4);
|
$machine_type = $1;
|
||||||
|
$use_old_bios_files = 1;
|
||||||
|
} else {
|
||||||
|
# Note: kvm version < 2.4 use non-efi pxe files, and have problems when we
|
||||||
|
# load new efi bios files on migration. So this hack is required to allow
|
||||||
|
# live migration from qemu-2.2 to qemu-2.4, which is sometimes used when
|
||||||
|
# updrading from proxmox-ve-3.X to proxmox-ve 4.0
|
||||||
|
$use_old_bios_files = !qemu_machine_feature_enabled ($machine_type, $kvmver, 2, 4);
|
||||||
|
}
|
||||||
|
|
||||||
push @$cmd, '/usr/bin/kvm';
|
push @$cmd, '/usr/bin/kvm';
|
||||||
|
|
||||||
push @$cmd, '-id', $vmid;
|
push @$cmd, '-id', $vmid;
|
||||||
|
Loading…
Reference in New Issue
Block a user