Commit Graph

6400 Commits

Author SHA1 Message Date
Daniel P. Berrangé
ecfc4094d8 storage: add support for qcow2 LUKS encryption
The storage driver was wired up to support creating raw volumes in LUKS
format, but was never adapted to support LUKS-in-qcow2. This is trivial
as it merely requires the encryption properties to be prefixed with
the "encrypt." prefix, and "encrypt.format=luks" when creating the
volume.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-18 11:22:28 +01:00
Daniel P. Berrangé
093ee8b3e2 tests: remove redundant LUKS volume data files
The two removed files have exactly the same config as other LUKS volume
data files, simply with different file names. Consolidate down to just
two LUKS volume data files as that's all that we need for the test
coverage.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-18 11:22:26 +01:00
Marek Marczykowski-Górecki
f253dc90f5 libxl: use b_info->{acpi,acpi} when available
b_info->u.hvm.{acpi,apic} are deprecated. But also, on recent libxl
version (4.14) the old one seems to be broken. While libxl part should
be fixed too, update the usage here and at some point drop support for
the old version.
b_info->acpi was added in Xen 4.8
b_info->apic was added in Xen 4.10
Xen 4.10 is the oldest version that still has security support (until
December 2020).

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
2020-09-18 08:51:47 +02:00
Pavel Hrdina
cf6cc86cd2 drop libdbus from libvirt
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-09-17 18:20:33 +02:00
Pavel Hrdina
bf5f2ed09c src/util/virsystemd: convert to use GLib DBus
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-09-17 18:20:03 +02:00
Pavel Hrdina
10cf523a8d src/util/virfirewalld: convert to use GLib DBus
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-09-17 18:20:01 +02:00
Pavel Hrdina
10926108f6 src/util/virpolkit: convert to use GLib DBus
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-09-17 18:19:59 +02:00
Pavel Hrdina
e8f00bc82c tests: introduce virgdbusmock to mock GLib DBus functions
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-09-17 18:19:56 +02:00
Pavel Hrdina
65674622d6 tests/virmock: extend number of arguments
Rewrite to use GLib DBus instead of libdbus will introduce function with
large number of arguments that we will have to mock for our tests so we
need to extend the number of arguments for our macros.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-09-17 18:19:53 +02:00
Pavel Hrdina
1db95f72e1 tests: mock libdbus in networkxml2firewalltest
This test calls into src/util/virfirewalld.c where it uses DBus to
figure out if firewalld is registered. Without the mock it luckily
fails and the test works correctly.

To isolate the tests from host environment we should mock the DBus
calls.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-09-17 18:19:46 +02:00
Peter Krempa
f2d90b558f qemuBuildHostdevSCSIAttachPrepare: Propagate 'readonly' flag also for iSCSI
The 'readonly' hostdev property is stored separately from the
virStorageSource as some hostdevs are not described by a virStorage
source. We need to propagate the flag to the virStorage source also for
iSCSI backends as it's used to generate the backend properties.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1868856

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-09-16 09:08:56 +02:00
Peter Krempa
c58c970586 qemuxml2argvtest: hostdev-scsi-virtio-scsi: Add <readonly/> to one of the iSCSI hostdevs
Test a readonly iSCSI backend as well.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-09-16 09:08:56 +02:00
Peter Krempa
6c2d91118d qemustatusxml2xml: backup-pull: Test private data formatting/parsing
Modify the test case to enable TLS and add private data containing
aliases of objects corresponding to a TLS setup.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-09-15 15:25:22 +02:00
Peter Krempa
2f7ee6914d qemuxml2argvtest: hostdev-scsi-virtio-scsi: Use longer user-alias for SCSI hostdev
Test that we can cope with a long useralias when generating SCSI hostdev
commandline.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-09-15 15:20:23 +02:00
Peter Krempa
e5dc1427d7 qemuDomainPrepareHostdev: Don't base backend nodename on device alias
QEMU's blockdev nodenames which are used to back SCSI/iSCSI hostdevs are
limited to 32 characters. If a user passes a very long user alias as
name of the host device it's easy to end up with a too-long nodename.

To prevent this from happening don't base the nodename on the possibly
user-specified alias but on the normal sequential node name generator.

We then store the name in the status XML for further use.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-09-15 15:20:23 +02:00
Peter Krempa
a669d68336 qemuDomainPrepareHostdev: base hostdev secret object names on backend alias
The secret object is used to pass data to the backend so it's better
fitting to base the secret object name on the SCSI host device backend
name.

Since we store the object alias in the status XML this modification is
safe in regards to existing guests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-09-15 15:20:23 +02:00
Peter Krempa
482c52b177 qemu: domain: Fill in (i)SCSI backend nodename if it is not present in status XML
For upgrade reasons so that we can modify the used nodename we must
generate the old version for all status XMLs which don't have it stored
explicitly.

The change will be required as using the user-provided alias may result
in too-long nodenames which will be rejected by qemu.

Add code which fills in the appropriate old value and add test cases to
validate that it's added and also that existing nodenames are not
overwritten.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-09-15 15:20:23 +02:00
Peter Krempa
8e008c1013 tests: qemustatusxml2xmldata: Add local SCSI hostdev to 'upgrade' case
Add a local SCSI host device to validate upcoming generated data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-09-15 15:20:23 +02:00
Peter Krempa
d240e599e6 tests: qemustatusxml2xmldata: Rename 'disk-secinfo-upgrade' case to 'upgrade'
The test case tests other things besides disk secinfos, so we can make
it more universal.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-09-15 15:20:23 +02:00
Peter Krempa
baea669e80 qemuxml2argvtest: hostdev-scsi-virtio-scsi: Add hostdev with useralias
Add a SCSI host device with a user-specified alias to illustrate the
upcoming changes.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-09-15 15:20:23 +02:00
Boris Fiuczynski
05e6cdafa6 node_device: detect CSS devices
Make channel subsystem (CSS) devices available in the node_device driver.
The CCS devices reside in the computer system and provide CCW devices, e.g.:

  +- css_0_0_003a
      |
      +- ccw_0_0_1a2b
          |
          +- scsi_host0
              |
              +- scsi_target0_0_0
                  |
                  +- scsi_0_0_0_0

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2020-09-15 09:06:15 +02:00
Tim Wiederhake
1fb2a560c3 tests: Use glib memory function in testConfRoundTrip
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-09-14 17:28:51 +02:00
Tim Wiederhake
4b53ce9fa7 tests: Fix false positive in testConfRoundTrip
testConfRoundTrip would return 0 (success) if virConfWriteMem succeeded
and virTestCompareToFile failed.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-09-14 17:28:51 +02:00
Tim Wiederhake
d91faa4fc3 tests: Use glib memory functions in pci_driver_new
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-09-11 18:19:59 +02:00
Tim Wiederhake
f3bfebb0b4 tests: Use glib memory functions in add_fd
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-09-11 18:19:59 +02:00
Tim Wiederhake
e228d6b92a tests: Use glib memory functions in virpcimock.c
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-09-11 18:19:58 +02:00
Daniel P. Berrangé
f8ec7c842d rpc: use new virt-ssh-helper binary for remote tunnelling
This wires up support for using the new virt-ssh-helper binary with the ssh,
libssh and libssh2 protocols.

The new binary will be used preferentially if it is available in $PATH,
otherwise we fall back to traditional netcat.

The "proxy" URI parameter can be used to force use of netcat e.g.

  qemu+ssh://host/system?proxy=netcat

or the disable fallback e.g.

  qemu+ssh://host/system?proxy=native

With use of virt-ssh-helper, we can now support remote session URIs

  qemu+ssh://host/session

and this will only use virt-ssh-helper, with no fallback. This also lets
the libvirtd process be auto-started, and connect directly to the
modular daemons, avoiding use of virtproxyd back-compat tunnelling.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-09 16:46:22 +01:00
Daniel P. Berrangé
019b13dd20 rpc: merge logic for generating remote SSH shell script
Three parts of the code all build up the same SSH shell script
snippet for remote tunneling the RPC protocol, but in slightly
different ways. Combine them all into one helper method in the
virNetClient code, since this logic doesn't really belong in
the virNetSocket code.

Note that the this change means the shell snippet is passed to
the SSH binary as a single arg, instead of three separate args,
but this is functionally identical, as the three separate args
were combined into one already when passed to the remote system.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-09 16:46:22 +01:00
Ján Tomko
92b252456e check for NULL before calling g_regex_unref
g_regex_unref reports an error if called with a NULL argument.

We have two cases in the code where we (possibly) call it on a NULL
argument. The interesting one is in virDomainQemuMonitorEventCleanup.

Based on VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX, we unref
data->regex, which has two problems:

* On the client side, flags is -1 so the comparison is true even if no
  regex was used, reproducible by:
  $ virsh qemu-monitor-event --timeout 1
  which results in an ugly error:
(process:1289846): GLib-CRITICAL **: 14:58:42.631: g_regex_unref: assertion 'regex != NULL' failed
* On the server side, we only create the regex if both the flag and the
  string are present, so it's possible to trigger this message by:
  $ virsh qemu-monitor-event --regex --timeout 1

Use a non-NULL comparison instead of the flag to decide whether we need
to unref the regex. And add a non-NULL check to the unref in the
VirtualBox test too.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 71efb59a4d
https://bugzilla.redhat.com/show_bug.cgi?id=1876907
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2020-09-08 16:07:47 +02:00
Michal Privoznik
d92c2bbc65 lib: Prefer g_autoptr() declaration of virQEMUDriverConfigPtr
In the past we had to declare @cfg and then explicitly unref it.
But now, with glib we can use g_autoptr() which will do the unref
automatically and thus is more bulletproof.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2020-09-07 10:47:54 +02:00
Martin Kletzander
c69915ccaf peer2peer migration: allow connecting to local sockets
Local socket connections were outright disabled because there was no "server"
part in the URI.  However, given how requirements and usage scenarios are
evolving, some management apps might need the source libvirt daemon to connect
to the destination daemon over a UNIX socket for peer2peer migration.  Since we
cannot know where the socket leads (whether the same daemon or not) let's decide
that based on whether the socket path is non-standard, or rather explicitly
specified in the URI.  Checking non-standard path would require to ask the
daemon for configuration and the only misuse that it would prevent would be a
pretty weird one.  And that's not worth it.  The assumption is that whenever
someone uses explicit UNIX socket paths in the URI for migration they better
know what they are doing.

Partially resolves: https://bugzilla.redhat.com/1638889

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2020-09-04 10:20:49 +02:00
Martin Kletzander
c5872b9a1b tests: Add simple test for virDomainMigrateCheckNotLocal
For this we need to make the function accessible (at least privately).  The
behaviour will change in following patches and the test helps explaining the
change.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2020-09-04 10:20:49 +02:00
Jonathon Jongsma
a5af3bd862 tests: change confusing macro agument names
Rather than use the names "fial" and "kep", use "fail" and "keep". In
the DO_TEST() macro, to prevent the preprocessor replacing the struct
member names during assignment, use the names "fail_" and "keep_"
instead.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2020-09-02 23:45:39 -04:00
Michal Privoznik
95b9db4ee2 lib: Prefer WITH_* prefix for #if conditionals
Currently, we are mixing: #if HAVE_BLAH with #if WITH_BLAH.
Things got way better with Pavel's work on meson, but apparently,
mixing these two lead to confusing and easy to miss bugs (see
31fb929eca for instance). While we were forced to use HAVE_
prefix with autotools, we are free to chose our own prefix with
meson and since WITH_ prefix appears to be more popular let's use
it everywhere.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-09-02 10:28:10 +02:00
Scott Shambarger
234a0ea306 tests/meson: fix mock library link on MacOS
MacOS can not pre-load modules, so mock libraries must be built
as shared libraries (without asneeded striping, and undefined
symbols allowed).

Signed-off-by: Scott Shambarger <scott-libvirt@shambarger.net>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-09-01 23:42:30 +02:00
Ján Tomko
cec43376fb tests: fix license blurb in virsh-undefine
Assume commit 0466ff28f2 used case-insensitive replace s/OUT/EXP/
by mistake and this file is still licensed under GPLv2.0+

Undo the change.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
FIxes: 0466ff28f2
Cc: Cole Robinson <crobinso@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Pino Toscano <ptoscano@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Pino Toscano <ptoscano@redhat.com>
2020-09-01 23:14:16 +02:00
Jim Fehlig
01ad5de41d Xen: Add support for writeFiltering in config converter
Add support for the writeFiltering attribute in the domXML to native
config converter. Also include a test.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-01 14:29:46 -06:00
Jim Fehlig
9d15647dcb Xen: Add writeFiltering option for PCI devices
By default Xen only allows guests to write "known safe" values into PCI
configuration space, yet many devices require writes to other areas of
the configuration space in order to operate properly. To allow writing
any values Xen supports the 'permissive' setting, see xl.cfg(5) man page.

This change models Xen's permissive setting by adding a writeFiltering
attribute on the <source> element of a PCI hostdev. When writeFiltering
is set to 'no', the Xen permissive setting will be enabled and guests
will be able to write any values into the device's configuration space.
The permissive setting remains disabled in the absense of the
writeFiltering attribute, of if it is explicitly set to 'yes'.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-01 14:29:17 -06:00
Ján Tomko
6fab37da59 Prefer https: everywhere where possible
Use https: links for websites that support them.

The URIs which are used as namespace identifiers
are left alone.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
2020-09-01 21:58:46 +02:00
Michal Privoznik
fc19155819 qemu: Validate memory hotplug in domainValidateCallback instead of cmd line generator
When editing a domain with hotplug enabled, I removed the only
NUMA node it had and got no error. I got the error later though,
when starting the domain. This is not as user friendly as it can
be. Move the validation call out from command line generator and
into domain validator (which is called prior to starting cmd line
generation anyway).

When doing this, I had to remove memory-hotplug-nonuma xml2xml
test case because there is no way the test case can succeed,
obviously.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2020-09-01 09:30:27 +02:00
Daniel Henrique Barboza
46d88d8dba domaincapsmock: mock virHostCPUGetMicrocodeVersion()
Previous patch handled the runtime case where a non-x86 host is
fetching /proc/cpuinfo data for a microcode info that we know
it doesn't exist. This change alone speeded everything by a
bit for non-x86, but there is at least one major culprit left.

qemuxml2argvtest does several arch-specific tests, and a good
chunk of them are x86 exclusive. This means that 'hostArch'
will be seen as x86 for these tests, even when running in
non-x86 hosts. In a Power 9 server with 128 CPUs, qemuxml2argvtest
takes 298 seconds to complete in average, and 'perf record'
indicates that 95% of the time is spent in
virHostCPUGetMicrocodeVersion().

This patch mocks virHostCPUGetMicrocodeVersion() to always return
0 in the tests, avoiding /proc/cpuinfo reads. This will make all
tests behave arch-agnostic, and the microcode value being 0 has no
impact on any existing test.

This is a CI speed across the board for all archs, including x86,
given that we're not reading /proc/cpuinfo in the tests. For
a Thinkpad T480 laptop with 8 Intel i7 CPUs, qemuxml2argvtest
went from 15.50 sec to 12.50 seconds. The performance gain is even
more noticeable for huge servers with lots of CPUs. For the
Power 9 server mentioned above, this patch speeds qemuxml2argvtest
to 9 seconds, down from 298 sec.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2020-08-25 19:44:43 +02:00
Ján Tomko
fd7644cba9 tests: use VIR_WARNINGS_NO_DECLARATION_AFTER_STATEMENT
Some test rely too much on declaring variables in the middle
of the function. Use the macro to locally suppress the warning

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-08-25 19:03:13 +02:00
Ján Tomko
aeb59ff576 tests: iscsitest: split out testISCSIScanTargetsTests
The ScanTargets testing code declares some variables
in the middle of main.

Split it out into a separate function.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-08-25 19:03:12 +02:00
Ján Tomko
33e3c69320 tests: authconfigtest: move declarations
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-08-25 19:03:12 +02:00
Ján Tomko
7923996d77 tests: sockettest: move declarations
Declare the structs: at the beginning of the block.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-08-25 19:03:12 +02:00
Ján Tomko
0a37e0695b Split declarations from initializations
Split those initializations that depend on a statement
above them.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-08-25 19:03:11 +02:00
Ján Tomko
a5152f23e7 Move declarations before statements
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-08-25 19:03:11 +02:00
Jim Fehlig
3d76f4fceb Xen: Add support for qemu commandline passthrough to config converter
Support qemu commandline passthrough in the domXML to native config
converter. Add tests to check the conversion.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2020-08-25 10:13:58 -06:00
Roman Bogorodskiy
26a13ec469 bhyve: allow to specify host sound device
Allow to map sound playback and recording devices to host devices
using "<audio type='oss'/>" OSS audio backend.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-08-25 08:42:16 +04:00
Roman Bogorodskiy
5d3137bbfb bhyve: implement sound device support
bhyve supports intel hda sound devices that could be specified
on the command like using "-1:0,hda,play=$play_dev,rec=$rec_dev",
where "1:0" is a PCI address, and "$play_dev" and "$rec_dev"
point to the playback and recording device on the host respectively.
Currently, schema of the 'sound' element doesn't allow specifying
neither playback nor recording devices, so for now hardcode
/dev/dsp0, which is the first audio device on the host.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2020-08-25 08:42:16 +04:00