mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-07-09 07:26:04 +00:00
add qemu_machine_pxe
return machinename with .pxe suffix if a nic with pxe romfile exist Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
ffb88d68e8
commit
42dbd2ee30
@ -141,16 +141,8 @@ sub prepare {
|
||||
if (my $pid = PVE::QemuServer::check_running($vmid)) {
|
||||
die "cant migrate running VM without --online\n" if !$online;
|
||||
$running = $pid;
|
||||
$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;
|
||||
}
|
||||
$self->{forcemachine} = PVE::QemuServer::qemu_machine_pxe($vmid, $conf);
|
||||
|
||||
}
|
||||
|
||||
|
@ -6365,6 +6365,22 @@ sub qemu_machine_feature_enabled {
|
||||
|
||||
}
|
||||
|
||||
sub qemu_machine_pxe {
|
||||
my ($vmid, $conf, $machine) = @_;
|
||||
|
||||
$machine = PVE::QemuServer::get_current_qemu_machine($vmid) if !$machine;
|
||||
|
||||
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');
|
||||
return $machine.".pxe" if $romfile =~ m/pxe/;
|
||||
last;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub lspci {
|
||||
|
||||
my $devices = {};
|
||||
|
Loading…
Reference in New Issue
Block a user