format => $ivshmem_fmt,
description => "Inter-VM shared memory. Useful for direct communication between VMs, or to the host.",
optional => 1,
- }
+ },
+ audio0 => {
+ type => 'string',
+ enum => [qw(ich9-intel-hda intel-hda AC97)],
+ description => "Configure a audio device.",
+ optional => 1
+ },
};
my $cicustom_fmt = {
push @$cmd, '-drive', "if=pflash,unit=1,format=$format,id=drive-efidisk0,file=$path";
}
+ # load q35 config
+ if ($q35) {
+ # we use different pcie-port hardware for qemu >= 4.0 for passthrough
+ if (qemu_machine_feature_enabled($machine_type, $kvmver, 4, 0)) {
+ push @$devices, '-readconfig', '/usr/share/qemu-server/pve-q35-4.0.cfg';
+ } else {
+ push @$devices, '-readconfig', '/usr/share/qemu-server/pve-q35.cfg';
+ }
+ }
# add usb controllers
my @usbcontrollers = PVE::QemuServer::USB::get_usb_controllers($conf, $bridges, $arch, $machine_type, $usbdesc->{format}, $MAX_USB_DEVICES);
}
}
+ if ($conf->{"audio0"}) {
+ my $audiodevice = $conf->{audio0};
+ my $audiopciaddr = print_pci_addr("audio0", $bridges, $arch, $machine_type);
+
+ if ($audiodevice eq 'AC97') {
+ push @$devices, '-device', "AC97,id=sound0${audiopciaddr}";
+ } else {
+ push @$devices, '-device', "${audiodevice},id=sound5${audiopciaddr}";
+ push @$devices, '-device', "hda-micro,id=sound5-codec0,bus=sound5.0,cad=0";
+ push @$devices, '-device', "hda-duplex,id=sound5-codec1,bus=sound5.0,cad=1";
+ }
+ }
my $sockets = 1;
$sockets = $conf->{smp} if $conf->{smp}; # old style - no longer iused
push @$machineFlags, "type=${machine_type}";
}
- if ($conf->{startdate}) {
+ if (($conf->{startdate}) && ($conf->{startdate} ne 'now')) {
push @$rtcFlags, "base=$conf->{startdate}";
} elsif ($useLocaltime) {
push @$rtcFlags, 'base=localtime';
push @$cmd, '-k', $conf->{keyboard} if defined($conf->{keyboard});
- # enable sound
- #my $soundhw = $conf->{soundhw} || $defaults->{soundhw};
- #push @$cmd, '-soundhw', 'es1370';
- #push @$cmd, '-soundhw', $soundhw if $soundhw;
-
if (parse_guest_agent($conf)->{enabled}) {
my $qgasocket = qmp_socket($vmid, 1);
my $pciaddr = print_pci_addr("qga0", $bridges, $arch, $machine_type);