optional => 1,
description => "Emulated CPU type.",
type => 'string',
- enum => [ qw(486 athlon pentium pentium2 pentium3 coreduo core2duo kvm32 kvm64 qemu32 qemu64 phenom Conroe Penryn Nehalem Westmere SandyBridge Haswell Opteron_G1 Opteron_G2 Opteron_G3 Opteron_G4 Opteron_G5 host) ],
+ enum => [ qw(486 athlon pentium pentium2 pentium3 coreduo core2duo kvm32 kvm64 qemu32 qemu64 phenom Conroe Penryn Nehalem Westmere SandyBridge Haswell Broadwell Opteron_G1 Opteron_G2 Opteron_G3 Opteron_G4 Opteron_G5 host) ],
default => 'kvm64',
},
parent => get_standard_option('pve-snapshot-name', {
my $MAX_USB_DEVICES = 5;
my $MAX_NETS = 32;
my $MAX_UNUSED_DISKS = 8;
-my $MAX_HOSTPCI_DEVICES = 2;
+my $MAX_HOSTPCI_DEVICES = 4;
my $MAX_SERIAL_PORTS = 4;
my $MAX_PARALLEL_PORTS = 3;
}
push @$devices, '-device', print_tabletdevice_full($conf) if $tablet;
-
+
# host pci devices
for (my $i = 0; $i < $MAX_HOSTPCI_DEVICES; $i++) {
my $d = parse_hostpci($conf->{"hostpci$i"});
my $rombar = $d->{rombar} && $d->{rombar} eq 'off' ? ",rombar=0" : "";
my $driver = $d->{driver} && $d->{driver} eq 'vfio' ? "vfio-pci" : "pci-assign";
my $xvga = $d->{'x-vga'} && $d->{'x-vga'} eq 'on' ? ",x-vga=on" : "";
+ if ($xvga && $xvga ne '') {
+ push @$cpuFlags, 'kvm=off';
+ $vga = 'none';
+ }
$driver = "vfio-pci" if $xvga ne '';
my $pcidevices = $d->{pciid};
my $multifunction = 1 if @$pcidevices > 1;
$spice_port = PVE::Tools::next_spice_port();
- push @$cmd, '-spice', "tls-port=${spice_port},addr=127.0.0.1,tls-ciphers=DES-CBC3-SHA,seamless-migration=on";
+ push @$devices, '-spice', "tls-port=${spice_port},addr=127.0.0.1,tls-ciphers=DES-CBC3-SHA,seamless-migration=on";
- push @$cmd, '-device', "virtio-serial,id=spice$pciaddr";
- push @$cmd, '-chardev', "spicevmc,id=vdagent,name=vdagent";
- push @$cmd, '-device', "virtserialport,chardev=vdagent,name=com.redhat.spice.0";
+ push @$devices, '-device', "virtio-serial,id=spice$pciaddr";
+ push @$devices, '-chardev', "spicevmc,id=vdagent,name=vdagent";
+ push @$devices, '-device', "virtserialport,chardev=vdagent,name=com.redhat.spice.0";
}
# enable balloon by default, unless explicitly disabled
die "can't unbind/bind to stub pci device '$pciid'\n" if !pci_dev_bind_to_stub($info);
}
- die "can't reset pci device '$pciid'\n" if !pci_dev_reset($info);
+ die "can't reset pci device '$pciid'\n" if $info->{has_fl_reset} and !pci_dev_reset($info);
}
}
vga1 => { bus => 0, addr => 24 },
vga2 => { bus => 0, addr => 25 },
vga3 => { bus => 0, addr => 26 },
+ hostpci2 => { bus => 0, addr => 27 },
+ hostpci3 => { bus => 0, addr => 28 },
#addr29 : usb-host (pve-usb.cfg)
'pci.1' => { bus => 0, addr => 30 },
'pci.2' => { bus => 0, addr => 31 },
die "snapshot '$snapname' does not exist\n" if !defined($snap);
# remove parent refs
- &$unlink_parent($conf, $snap->{parent});
- foreach my $sn (keys %{$conf->{snapshots}}) {
- next if $sn eq $snapname;
- &$unlink_parent($conf->{snapshots}->{$sn}, $snap->{parent});
+ if (!$prepare) {
+ &$unlink_parent($conf, $snap->{parent});
+ foreach my $sn (keys %{$conf->{snapshots}}) {
+ next if $sn eq $snapname;
+ &$unlink_parent($conf->{snapshots}->{$sn}, $snap->{parent});
+ }
}
if ($remove_drive) {