mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
* fix WHPX debugging * misc qga-vss fixes * remove the deprecated CPU model 'Icelake-Client' * support for x86 architectural LBR * remove deprecated properties * replace deprecated -soundhw with -audio # -----BEGIN PGP SIGNATURE----- # # iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmJ/hZ4UHHBib256aW5p # QHJlZGhhdC5jb20ACgkQv/vSX3jHroN2Igf/bFs+yluOikt0eFNmXYnshrGBWPXr # oam0iumPox34vTzZnjpSjF6tJGxHWOgi+wbgIvbwOYHA/ONxx8akW580j+1VhEWa # X29VyUzjZBffgFtmlF4fM74/ELYm7s4c1a1/D9TpVP6Dr0fSWbMujbx4dfeVstvf # sONN+A8sVxaNdV9QKPE6BvqfMlPLoCiigrOetf6iY1KuUtkQDF8xDB0MdzdutqAQ # szAtQ0rrzjxDx9EuGN1SECFM1/riDUbtOOoA9g2C7gGKrx3/iUc6pzrkIcAfWLFK # xXbH7+6Wynia0cbUxnrvRdY4daMIxm4N3wUvN7szXgF9kxYxeQcsdgGsNA== # =n4lu # -----END PGP SIGNATURE----- # gpg: Signature made Sat 14 May 2022 03:34:06 AM PDT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [undefined] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [undefined] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (23 commits) configure: remove duplicate help messages configure: remove another dead variable build: remove useless dependency introduce -audio as a replacement for -soundhw soundhw: move help handling to vl.c soundhw: unify initialization for ISA and PCI soundhw soundhw: extract soundhw help to a separate function soundhw: remove ability to create multiple soundcards rng: make opened property read-only crypto: make loaded property read-only target/i386: Support Arch LBR in CPUID enumeration target/i386: introduce helper to access supported CPUID target/i386: Enable Arch LBR migration states in vmstate target/i386: Add MSR access interface for Arch LBR target/i386: Add XSAVES support for Arch LBR target/i386: Enable support for XSAVES based features target/i386: Add kvm_get_one_msr helper target/i386: Add lbr-fmt vPMU option to support guest LBR qdev-properties: Add a new macro with bitmask check for uint64_t property i386/cpu: Remove the deprecated cpu model 'Icelake-Client' ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -165,10 +165,7 @@ ifneq ($(filter $(ninja-targets), $(ninja-cmd-goals)),)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Force configure to re-run if the API symbols are updated
|
||||
ifeq ($(CONFIG_PLUGIN),y)
|
||||
config-host.mak: $(SRC_PATH)/plugins/qemu-plugins.symbols
|
||||
|
||||
.PHONY: plugins
|
||||
plugins:
|
||||
$(call quiet-command,\
|
||||
|
||||
+7
-1
@@ -2099,13 +2099,19 @@ static void audio_validate_opts(Audiodev *dev, Error **errp)
|
||||
|
||||
void audio_parse_option(const char *opt)
|
||||
{
|
||||
AudiodevListEntry *e;
|
||||
Audiodev *dev = NULL;
|
||||
|
||||
Visitor *v = qobject_input_visitor_new_str(opt, "driver", &error_fatal);
|
||||
visit_type_Audiodev(v, NULL, &dev, &error_fatal);
|
||||
visit_free(v);
|
||||
|
||||
audio_define(dev);
|
||||
}
|
||||
|
||||
void audio_define(Audiodev *dev)
|
||||
{
|
||||
AudiodevListEntry *e;
|
||||
|
||||
audio_validate_opts(dev, &error_fatal);
|
||||
|
||||
e = g_new0(AudiodevListEntry, 1);
|
||||
|
||||
@@ -168,6 +168,7 @@ void audio_sample_to_uint64(const void *samples, int pos,
|
||||
void audio_sample_from_uint64(void *samples, int pos,
|
||||
uint64_t left, uint64_t right);
|
||||
|
||||
void audio_define(Audiodev *audio);
|
||||
void audio_parse_option(const char *opt);
|
||||
void audio_init_audiodevs(void);
|
||||
void audio_legacy_help(void);
|
||||
|
||||
+2
-16
@@ -48,24 +48,10 @@ static bool rng_backend_prop_get_opened(Object *obj, Error **errp)
|
||||
|
||||
static void rng_backend_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
object_property_set_bool(OBJECT(uc), "opened", true, errp);
|
||||
}
|
||||
|
||||
static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp)
|
||||
{
|
||||
RngBackend *s = RNG_BACKEND(obj);
|
||||
RngBackend *s = RNG_BACKEND(uc);
|
||||
RngBackendClass *k = RNG_BACKEND_GET_CLASS(s);
|
||||
Error *local_err = NULL;
|
||||
|
||||
if (value == s->opened) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!value && s->opened) {
|
||||
error_setg(errp, QERR_PERMISSION_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (k->opened) {
|
||||
k->opened(s, &local_err);
|
||||
if (local_err) {
|
||||
@@ -122,7 +108,7 @@ static void rng_backend_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
object_class_property_add_bool(oc, "opened",
|
||||
rng_backend_prop_get_opened,
|
||||
rng_backend_prop_set_opened);
|
||||
NULL);
|
||||
}
|
||||
|
||||
static const TypeInfo rng_backend_info = {
|
||||
|
||||
@@ -1043,10 +1043,6 @@ Advanced options (experts only):
|
||||
--enable-tsan enable thread sanitizer
|
||||
--disable-werror disable compilation abort on warning
|
||||
--disable-stack-protector disable compiler-provided stack protection
|
||||
--audio-drv-list=LIST set audio drivers to try if -audiodev is not used
|
||||
--block-drv-whitelist=L Same as --block-drv-rw-whitelist=L
|
||||
--with-trace-file=NAME Full PATH,NAME of file to store traces
|
||||
Default:trace-<pid>
|
||||
--cpu=CPU Build for host CPU [$cpu]
|
||||
--with-coroutine=BACKEND coroutine backend. Supported options:
|
||||
ucontext, sigaltstack, windows
|
||||
@@ -1992,7 +1988,6 @@ fi
|
||||
if test "$static" = "yes" ; then
|
||||
echo "CONFIG_STATIC=y" >> $config_host_mak
|
||||
fi
|
||||
qemu_version=$(head $source_path/VERSION)
|
||||
echo "SRC_PATH=$source_path" >> $config_host_mak
|
||||
echo "TARGET_DIRS=$target_list" >> $config_host_mak
|
||||
if test "$modules" = "yes"; then
|
||||
|
||||
+35
-49
@@ -138,36 +138,44 @@ static void qcrypto_secret_decode(const uint8_t *input,
|
||||
|
||||
|
||||
static void
|
||||
qcrypto_secret_prop_set_loaded(Object *obj,
|
||||
bool value,
|
||||
Error **errp)
|
||||
qcrypto_secret_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
QCryptoSecretCommon *secret = QCRYPTO_SECRET_COMMON(obj);
|
||||
QCryptoSecretCommon *secret = QCRYPTO_SECRET_COMMON(uc);
|
||||
QCryptoSecretCommonClass *sec_class
|
||||
= QCRYPTO_SECRET_COMMON_GET_CLASS(obj);
|
||||
= QCRYPTO_SECRET_COMMON_GET_CLASS(uc);
|
||||
|
||||
if (value) {
|
||||
Error *local_err = NULL;
|
||||
uint8_t *input = NULL;
|
||||
size_t inputlen = 0;
|
||||
uint8_t *output = NULL;
|
||||
size_t outputlen = 0;
|
||||
Error *local_err = NULL;
|
||||
uint8_t *input = NULL;
|
||||
size_t inputlen = 0;
|
||||
uint8_t *output = NULL;
|
||||
size_t outputlen = 0;
|
||||
|
||||
if (sec_class->load_data) {
|
||||
sec_class->load_data(secret, &input, &inputlen, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
error_setg(errp, "%s provides no 'load_data' method'",
|
||||
object_get_typename(obj));
|
||||
if (sec_class->load_data) {
|
||||
sec_class->load_data(secret, &input, &inputlen, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
error_setg(errp, "%s provides no 'load_data' method'",
|
||||
object_get_typename(OBJECT(uc)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (secret->keyid) {
|
||||
qcrypto_secret_decrypt(secret, input, inputlen,
|
||||
&output, &outputlen, &local_err);
|
||||
if (secret->keyid) {
|
||||
qcrypto_secret_decrypt(secret, input, inputlen,
|
||||
&output, &outputlen, &local_err);
|
||||
g_free(input);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
input = output;
|
||||
inputlen = outputlen;
|
||||
} else {
|
||||
if (secret->format == QCRYPTO_SECRET_FORMAT_BASE64) {
|
||||
qcrypto_secret_decode(input, inputlen,
|
||||
&output, &outputlen, &local_err);
|
||||
g_free(input);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
@@ -175,26 +183,11 @@ qcrypto_secret_prop_set_loaded(Object *obj,
|
||||
}
|
||||
input = output;
|
||||
inputlen = outputlen;
|
||||
} else {
|
||||
if (secret->format == QCRYPTO_SECRET_FORMAT_BASE64) {
|
||||
qcrypto_secret_decode(input, inputlen,
|
||||
&output, &outputlen, &local_err);
|
||||
g_free(input);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
input = output;
|
||||
inputlen = outputlen;
|
||||
}
|
||||
}
|
||||
|
||||
secret->rawdata = input;
|
||||
secret->rawlen = inputlen;
|
||||
} else if (secret->rawdata) {
|
||||
error_setg(errp, "Cannot unload secret");
|
||||
return;
|
||||
}
|
||||
|
||||
secret->rawdata = input;
|
||||
secret->rawlen = inputlen;
|
||||
}
|
||||
|
||||
|
||||
@@ -268,13 +261,6 @@ qcrypto_secret_prop_get_keyid(Object *obj,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
qcrypto_secret_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
object_property_set_bool(OBJECT(uc), "loaded", true, errp);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
qcrypto_secret_finalize(Object *obj)
|
||||
{
|
||||
@@ -294,7 +280,7 @@ qcrypto_secret_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
object_class_property_add_bool(oc, "loaded",
|
||||
qcrypto_secret_prop_get_loaded,
|
||||
qcrypto_secret_prop_set_loaded);
|
||||
NULL);
|
||||
object_class_property_add_enum(oc, "format",
|
||||
"QCryptoSecretFormat",
|
||||
&QCryptoSecretFormat_lookup,
|
||||
|
||||
+4
-16
@@ -119,16 +119,11 @@ qcrypto_tls_creds_anon_unload(QCryptoTLSCredsAnon *creds G_GNUC_UNUSED)
|
||||
|
||||
|
||||
static void
|
||||
qcrypto_tls_creds_anon_prop_set_loaded(Object *obj,
|
||||
bool value,
|
||||
Error **errp)
|
||||
qcrypto_tls_creds_anon_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
QCryptoTLSCredsAnon *creds = QCRYPTO_TLS_CREDS_ANON(obj);
|
||||
QCryptoTLSCredsAnon *creds = QCRYPTO_TLS_CREDS_ANON(uc);
|
||||
|
||||
qcrypto_tls_creds_anon_unload(creds);
|
||||
if (value) {
|
||||
qcrypto_tls_creds_anon_load(creds, errp);
|
||||
}
|
||||
qcrypto_tls_creds_anon_load(creds, errp);
|
||||
}
|
||||
|
||||
|
||||
@@ -163,13 +158,6 @@ qcrypto_tls_creds_anon_prop_get_loaded(Object *obj G_GNUC_UNUSED,
|
||||
#endif /* ! CONFIG_GNUTLS */
|
||||
|
||||
|
||||
static void
|
||||
qcrypto_tls_creds_anon_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
object_property_set_bool(OBJECT(uc), "loaded", true, errp);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
qcrypto_tls_creds_anon_finalize(Object *obj)
|
||||
{
|
||||
@@ -188,7 +176,7 @@ qcrypto_tls_creds_anon_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
object_class_property_add_bool(oc, "loaded",
|
||||
qcrypto_tls_creds_anon_prop_get_loaded,
|
||||
qcrypto_tls_creds_anon_prop_set_loaded);
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-16
@@ -188,16 +188,11 @@ qcrypto_tls_creds_psk_unload(QCryptoTLSCredsPSK *creds G_GNUC_UNUSED)
|
||||
|
||||
|
||||
static void
|
||||
qcrypto_tls_creds_psk_prop_set_loaded(Object *obj,
|
||||
bool value,
|
||||
Error **errp)
|
||||
qcrypto_tls_creds_psk_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
QCryptoTLSCredsPSK *creds = QCRYPTO_TLS_CREDS_PSK(obj);
|
||||
QCryptoTLSCredsPSK *creds = QCRYPTO_TLS_CREDS_PSK(uc);
|
||||
|
||||
qcrypto_tls_creds_psk_unload(creds);
|
||||
if (value) {
|
||||
qcrypto_tls_creds_psk_load(creds, errp);
|
||||
}
|
||||
qcrypto_tls_creds_psk_load(creds, errp);
|
||||
}
|
||||
|
||||
|
||||
@@ -232,13 +227,6 @@ qcrypto_tls_creds_psk_prop_get_loaded(Object *obj G_GNUC_UNUSED,
|
||||
#endif /* ! CONFIG_GNUTLS */
|
||||
|
||||
|
||||
static void
|
||||
qcrypto_tls_creds_psk_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
object_property_set_bool(OBJECT(uc), "loaded", true, errp);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
qcrypto_tls_creds_psk_finalize(Object *obj)
|
||||
{
|
||||
@@ -276,7 +264,7 @@ qcrypto_tls_creds_psk_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
object_class_property_add_bool(oc, "loaded",
|
||||
qcrypto_tls_creds_psk_prop_get_loaded,
|
||||
qcrypto_tls_creds_psk_prop_set_loaded);
|
||||
NULL);
|
||||
object_class_property_add_str(oc, "username",
|
||||
qcrypto_tls_creds_psk_prop_get_username,
|
||||
qcrypto_tls_creds_psk_prop_set_username);
|
||||
|
||||
+4
-16
@@ -687,16 +687,11 @@ qcrypto_tls_creds_x509_unload(QCryptoTLSCredsX509 *creds G_GNUC_UNUSED)
|
||||
|
||||
|
||||
static void
|
||||
qcrypto_tls_creds_x509_prop_set_loaded(Object *obj,
|
||||
bool value,
|
||||
Error **errp)
|
||||
qcrypto_tls_creds_x509_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
QCryptoTLSCredsX509 *creds = QCRYPTO_TLS_CREDS_X509(obj);
|
||||
QCryptoTLSCredsX509 *creds = QCRYPTO_TLS_CREDS_X509(uc);
|
||||
|
||||
qcrypto_tls_creds_x509_unload(creds);
|
||||
if (value) {
|
||||
qcrypto_tls_creds_x509_load(creds, errp);
|
||||
}
|
||||
qcrypto_tls_creds_x509_load(creds, errp);
|
||||
}
|
||||
|
||||
|
||||
@@ -814,13 +809,6 @@ qcrypto_tls_creds_x509_reload(QCryptoTLSCreds *creds, Error **errp)
|
||||
#endif /* ! CONFIG_GNUTLS */
|
||||
|
||||
|
||||
static void
|
||||
qcrypto_tls_creds_x509_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
object_property_set_bool(OBJECT(uc), "loaded", true, errp);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
qcrypto_tls_creds_x509_init(Object *obj)
|
||||
{
|
||||
@@ -852,7 +840,7 @@ qcrypto_tls_creds_x509_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
object_class_property_add_bool(oc, "loaded",
|
||||
qcrypto_tls_creds_x509_prop_get_loaded,
|
||||
qcrypto_tls_creds_x509_prop_set_loaded);
|
||||
NULL);
|
||||
object_class_property_add_bool(oc, "sanity-check",
|
||||
qcrypto_tls_creds_x509_prop_get_sanity,
|
||||
qcrypto_tls_creds_x509_prop_set_sanity);
|
||||
|
||||
@@ -39,15 +39,6 @@ should specify an ``audiodev=`` property. Additionally, when using
|
||||
vnc, you should specify an ``audiodev=`` property if you plan to
|
||||
transmit audio through the VNC protocol.
|
||||
|
||||
Creating sound card devices using ``-soundhw`` (since 5.1)
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
Sound card devices should be created using ``-device`` instead. The
|
||||
names are the same for most devices. The exceptions are ``hda`` which
|
||||
needs two devices (``-device intel-hda -device hda-duplex``) and
|
||||
``pcspk`` which can be activated using ``-machine
|
||||
pcspk-audiodev=<name>``.
|
||||
|
||||
``-chardev`` backend aliases ``tty`` and ``parport`` (since 6.0)
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
@@ -90,25 +81,6 @@ the process listing. This is replaced by the new ``password-secret``
|
||||
option which lets the password be securely provided on the command
|
||||
line using a ``secret`` object instance.
|
||||
|
||||
``opened`` property of ``rng-*`` objects (since 6.0)
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
The only effect of specifying ``opened=on`` in the command line or QMP
|
||||
``object-add`` is that the device is opened immediately, possibly before all
|
||||
other options have been processed. This will either have no effect (if
|
||||
``opened`` was the last option) or cause errors. The property is therefore
|
||||
useless and should not be specified.
|
||||
|
||||
``loaded`` property of ``secret`` and ``secret_keyring`` objects (since 6.0)
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
The only effect of specifying ``loaded=on`` in the command line or QMP
|
||||
``object-add`` is that the secret is loaded immediately, possibly before all
|
||||
other options have been processed. This will either have no effect (if
|
||||
``loaded`` was the last option) or cause options to be effectively ignored as
|
||||
if they were not given. The property is therefore useless and should not be
|
||||
specified.
|
||||
|
||||
``-display sdl,window_close=...`` (since 6.1)
|
||||
'''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
@@ -270,12 +242,6 @@ from Linux upstream kernel, declare it deprecated.
|
||||
System emulator CPUS
|
||||
--------------------
|
||||
|
||||
``Icelake-Client`` CPU Model (since 5.2)
|
||||
''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
``Icelake-Client`` CPU Models are deprecated. Use ``Icelake-Server`` CPU
|
||||
Models instead.
|
||||
|
||||
MIPS ``I7200`` CPU Model (since 5.2)
|
||||
''''''''''''''''''''''''''''''''''''
|
||||
|
||||
|
||||
@@ -355,6 +355,21 @@ The ``-writeconfig`` option was not able to serialize the entire contents
|
||||
of the QEMU command line. It is thus considered a failed experiment
|
||||
and removed without a replacement.
|
||||
|
||||
``loaded`` property of ``secret`` and ``secret_keyring`` objects (removed in 7.1)
|
||||
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
The ``loaded=on`` option in the command line or QMP ``object-add`` either had
|
||||
no effect (if ``loaded`` was the last option) or caused options to be
|
||||
effectively ignored as if they were not given. The property is therefore
|
||||
useless and should simply be removed.
|
||||
|
||||
``opened`` property of ``rng-*`` objects (removed in 7.1)
|
||||
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
The ``opened=on`` option in the command line or QMP ``object-add`` either had
|
||||
no effect (if ``opened`` was the last option) or caused errors. The property
|
||||
is therefore useless and should simply be removed.
|
||||
|
||||
QEMU Machine Protocol (QMP) commands
|
||||
------------------------------------
|
||||
|
||||
@@ -557,6 +572,12 @@ Support for this CPU was removed from the upstream Linux kernel, and
|
||||
there is no available upstream toolchain to build binaries for it.
|
||||
Removed without replacement.
|
||||
|
||||
x86 ``Icelake-Client`` CPU (removed in 7.1)
|
||||
'''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
There isn't ever Icelake Client CPU, it is some wrong and imaginary one.
|
||||
Use ``Icelake-Server`` instead.
|
||||
|
||||
System emulator machines
|
||||
------------------------
|
||||
|
||||
@@ -633,6 +654,13 @@ tripped up the CI testing and was suspected to be quite broken. For that
|
||||
reason the maintainers strongly suspected no one actually used it.
|
||||
|
||||
|
||||
Creating sound card devices using ``-soundhw`` (removed in 7.1)
|
||||
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
Sound card devices should be created using ``-device`` or ``-audio``.
|
||||
The exception is ``pcspk`` which can be activated using ``-machine
|
||||
pcspk-audiodev=<name>``.
|
||||
|
||||
TCG introspection features
|
||||
--------------------------
|
||||
|
||||
|
||||
@@ -1311,17 +1311,16 @@ static const TypeInfo hda_codec_device_type_info = {
|
||||
* create intel hda controller with codec attached to it,
|
||||
* so '-soundhw hda' works.
|
||||
*/
|
||||
static int intel_hda_and_codec_init(PCIBus *bus)
|
||||
static int intel_hda_and_codec_init(PCIBus *bus, const char *audiodev)
|
||||
{
|
||||
DeviceState *controller;
|
||||
BusState *hdabus;
|
||||
DeviceState *codec;
|
||||
|
||||
warn_report("'-soundhw hda' is deprecated, "
|
||||
"please use '-device intel-hda -device hda-duplex' instead");
|
||||
controller = DEVICE(pci_create_simple(bus, -1, "intel-hda"));
|
||||
hdabus = QLIST_FIRST(&controller->child_bus);
|
||||
codec = qdev_new("hda-duplex");
|
||||
qdev_prop_set_string(codec, "audiodev", audiodev);
|
||||
qdev_realize_and_unref(codec, hdabus, &error_fatal);
|
||||
return 0;
|
||||
}
|
||||
|
||||
+60
-76
@@ -25,7 +25,9 @@
|
||||
#include "qemu/option.h"
|
||||
#include "qemu/help_option.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qom/object.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "hw/isa/isa.h"
|
||||
#include "hw/pci/pci.h"
|
||||
#include "hw/audio/soundhw.h"
|
||||
@@ -34,16 +36,15 @@ struct soundhw {
|
||||
const char *name;
|
||||
const char *descr;
|
||||
const char *typename;
|
||||
int enabled;
|
||||
int isa;
|
||||
int (*init_pci) (PCIBus *bus);
|
||||
int (*init_pci) (PCIBus *bus, const char *audiodev);
|
||||
};
|
||||
|
||||
static struct soundhw soundhw[9];
|
||||
static int soundhw_count;
|
||||
|
||||
void pci_register_soundhw(const char *name, const char *descr,
|
||||
int (*init_pci)(PCIBus *bus))
|
||||
int (*init_pci)(PCIBus *bus, const char *audiodev))
|
||||
{
|
||||
assert(soundhw_count < ARRAY_SIZE(soundhw) - 1);
|
||||
soundhw[soundhw_count].name = name;
|
||||
@@ -64,95 +65,78 @@ void deprecated_register_soundhw(const char *name, const char *descr,
|
||||
soundhw_count++;
|
||||
}
|
||||
|
||||
void select_soundhw(const char *optarg)
|
||||
void show_valid_soundhw(void)
|
||||
{
|
||||
struct soundhw *c;
|
||||
|
||||
if (is_help_option(optarg)) {
|
||||
show_valid_cards:
|
||||
|
||||
if (soundhw_count) {
|
||||
printf("Valid sound card names (comma separated):\n");
|
||||
for (c = soundhw; c->name; ++c) {
|
||||
printf ("%-11s %s\n", c->name, c->descr);
|
||||
}
|
||||
printf("\n-soundhw all will enable all of the above\n");
|
||||
} else {
|
||||
printf("Machine has no user-selectable audio hardware "
|
||||
"(it may or may not have always-present audio hardware).\n");
|
||||
}
|
||||
exit(!is_help_option(optarg));
|
||||
if (soundhw_count) {
|
||||
printf("Valid sound card names (comma separated):\n");
|
||||
for (c = soundhw; c->name; ++c) {
|
||||
printf ("%-11s %s\n", c->name, c->descr);
|
||||
}
|
||||
} else {
|
||||
printf("Machine has no user-selectable audio hardware "
|
||||
"(it may or may not have always-present audio hardware).\n");
|
||||
}
|
||||
else {
|
||||
size_t l;
|
||||
const char *p;
|
||||
char *e;
|
||||
int bad_card = 0;
|
||||
}
|
||||
|
||||
if (!strcmp(optarg, "all")) {
|
||||
for (c = soundhw; c->name; ++c) {
|
||||
c->enabled = 1;
|
||||
}
|
||||
return;
|
||||
static struct soundhw *selected = NULL;
|
||||
static const char *audiodev_id;
|
||||
|
||||
void select_soundhw(const char *optarg, const char *audiodev)
|
||||
{
|
||||
struct soundhw *c;
|
||||
|
||||
if (selected) {
|
||||
error_setg(&error_fatal, "only one -soundhw option is allowed");
|
||||
}
|
||||
|
||||
for (c = soundhw; c->name; ++c) {
|
||||
if (g_str_equal(c->name, optarg)) {
|
||||
selected = c;
|
||||
audiodev_id = audiodev;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
p = optarg;
|
||||
while (*p) {
|
||||
e = strchr(p, ',');
|
||||
l = !e ? strlen(p) : (size_t) (e - p);
|
||||
|
||||
for (c = soundhw; c->name; ++c) {
|
||||
if (!strncmp(c->name, p, l) && !c->name[l]) {
|
||||
c->enabled = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!c->name) {
|
||||
if (l > 80) {
|
||||
error_report("Unknown sound card name (too big to show)");
|
||||
}
|
||||
else {
|
||||
error_report("Unknown sound card name `%.*s'",
|
||||
(int) l, p);
|
||||
}
|
||||
bad_card = 1;
|
||||
}
|
||||
p += l + (e != NULL);
|
||||
}
|
||||
|
||||
if (bad_card) {
|
||||
goto show_valid_cards;
|
||||
}
|
||||
if (!c->name) {
|
||||
error_report("Unknown sound card name `%s'", optarg);
|
||||
show_valid_soundhw();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void soundhw_init(void)
|
||||
{
|
||||
struct soundhw *c;
|
||||
struct soundhw *c = selected;
|
||||
ISABus *isa_bus = (ISABus *) object_resolve_path_type("", TYPE_ISA_BUS, NULL);
|
||||
PCIBus *pci_bus = (PCIBus *) object_resolve_path_type("", TYPE_PCI_BUS, NULL);
|
||||
BusState *bus;
|
||||
|
||||
for (c = soundhw; c->name; ++c) {
|
||||
if (c->enabled) {
|
||||
if (c->typename) {
|
||||
warn_report("'-soundhw %s' is deprecated, "
|
||||
"please use '-device %s' instead",
|
||||
c->name, c->typename);
|
||||
if (c->isa) {
|
||||
isa_create_simple(isa_bus, c->typename);
|
||||
} else {
|
||||
pci_create_simple(pci_bus, -1, c->typename);
|
||||
}
|
||||
} else {
|
||||
assert(!c->isa);
|
||||
if (!pci_bus) {
|
||||
error_report("PCI bus not available for %s", c->name);
|
||||
exit(1);
|
||||
}
|
||||
c->init_pci(pci_bus);
|
||||
}
|
||||
if (!c) {
|
||||
return;
|
||||
}
|
||||
if (c->isa) {
|
||||
if (!isa_bus) {
|
||||
error_report("ISA bus not available for %s", c->name);
|
||||
exit(1);
|
||||
}
|
||||
bus = BUS(isa_bus);
|
||||
} else {
|
||||
if (!pci_bus) {
|
||||
error_report("PCI bus not available for %s", c->name);
|
||||
exit(1);
|
||||
}
|
||||
bus = BUS(pci_bus);
|
||||
}
|
||||
|
||||
if (c->typename) {
|
||||
DeviceState *dev = qdev_new(c->typename);
|
||||
qdev_prop_set_string(dev, "audiodev", audiodev_id);
|
||||
qdev_realize_and_unref(dev, bus, &error_fatal);
|
||||
} else {
|
||||
assert(!c->isa);
|
||||
c->init_pci(pci_bus, audiodev_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -428,6 +428,25 @@ const PropertyInfo qdev_prop_int64 = {
|
||||
.set_default_value = qdev_propinfo_set_default_value_int,
|
||||
};
|
||||
|
||||
static void set_uint64_checkmask(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
Property *prop = opaque;
|
||||
uint64_t *ptr = object_field_prop_ptr(obj, prop);
|
||||
|
||||
visit_type_uint64(v, name, ptr, errp);
|
||||
if (*ptr & ~prop->bitmask) {
|
||||
error_setg(errp, "Property value for '%s' has bits outside mask '0x%" PRIx64 "'",
|
||||
name, prop->bitmask);
|
||||
}
|
||||
}
|
||||
|
||||
const PropertyInfo qdev_prop_uint64_checkmask = {
|
||||
.name = "uint64",
|
||||
.get = get_uint64,
|
||||
.set = set_uint64_checkmask,
|
||||
};
|
||||
|
||||
/* --- string --- */
|
||||
|
||||
static void release_string(Object *obj, const char *name, void *opaque)
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
#define HW_SOUNDHW_H
|
||||
|
||||
void pci_register_soundhw(const char *name, const char *descr,
|
||||
int (*init_pci)(PCIBus *bus));
|
||||
int (*init_pci)(PCIBus *bus, const char *audiodev));
|
||||
void deprecated_register_soundhw(const char *name, const char *descr,
|
||||
int isa, const char *typename);
|
||||
|
||||
void soundhw_init(void);
|
||||
void select_soundhw(const char *optarg);
|
||||
void show_valid_soundhw(void);
|
||||
void select_soundhw(const char *optarg, const char *audiodev);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,6 +17,7 @@ struct Property {
|
||||
const PropertyInfo *info;
|
||||
ptrdiff_t offset;
|
||||
uint8_t bitnr;
|
||||
uint64_t bitmask;
|
||||
bool set_default;
|
||||
union {
|
||||
int64_t i;
|
||||
@@ -54,6 +55,7 @@ extern const PropertyInfo qdev_prop_uint16;
|
||||
extern const PropertyInfo qdev_prop_uint32;
|
||||
extern const PropertyInfo qdev_prop_int32;
|
||||
extern const PropertyInfo qdev_prop_uint64;
|
||||
extern const PropertyInfo qdev_prop_uint64_checkmask;
|
||||
extern const PropertyInfo qdev_prop_int64;
|
||||
extern const PropertyInfo qdev_prop_size;
|
||||
extern const PropertyInfo qdev_prop_string;
|
||||
@@ -103,6 +105,16 @@ extern const PropertyInfo qdev_prop_link;
|
||||
.set_default = true, \
|
||||
.defval.u = (bool)_defval)
|
||||
|
||||
/**
|
||||
* The DEFINE_PROP_UINT64_CHECKMASK macro checks a user-supplied value
|
||||
* against corresponding bitmask, rejects the value if it violates.
|
||||
* The default value is set in instance_init().
|
||||
*/
|
||||
#define DEFINE_PROP_UINT64_CHECKMASK(_name, _state, _field, _bitmask) \
|
||||
DEFINE_PROP(_name, _state, _field, qdev_prop_uint64_checkmask, uint64_t, \
|
||||
.bitmask = (_bitmask), \
|
||||
.set_default = false)
|
||||
|
||||
#define PROP_ARRAY_LEN_PREFIX "len-"
|
||||
|
||||
/**
|
||||
|
||||
+24
-27
@@ -661,6 +661,30 @@ SRST
|
||||
(deprecated) environment variables.
|
||||
ERST
|
||||
|
||||
DEF("audio", HAS_ARG, QEMU_OPTION_audio,
|
||||
"-audio [driver=]driver,model=value[,prop[=value][,...]]\n"
|
||||
" specifies the audio backend and device to use;\n"
|
||||
" apart from 'model', options are the same as for -audiodev.\n"
|
||||
" use '-audio model=help' to show possible devices.\n",
|
||||
QEMU_ARCH_ALL)
|
||||
SRST
|
||||
``-audio [driver=]driver,model=value[,prop[=value][,...]]``
|
||||
This option is a shortcut for configuring both the guest audio
|
||||
hardware and the host audio backend in one go.
|
||||
The host backend options are the same as with the corresponding
|
||||
``-audiodev`` options below. The guest hardware model can be set with
|
||||
``model=modelname``. Use ``model=help`` to list the available device
|
||||
types.
|
||||
|
||||
The following two example do exactly the same, to show how ``-audio``
|
||||
can be used to shorten the command line length:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
|qemu_system| -audiodev pa,id=pa -device sb16,audiodev=pa
|
||||
|qemu_system| -audio pa,model=sb16
|
||||
ERST
|
||||
|
||||
DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev,
|
||||
"-audiodev [driver=]driver,id=id[,prop[=value][,...]]\n"
|
||||
" specifies the audio backend to use\n"
|
||||
@@ -892,33 +916,6 @@ SRST
|
||||
``qemu.wav``.
|
||||
ERST
|
||||
|
||||
DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw,
|
||||
"-soundhw c1,... enable audio support\n"
|
||||
" and only specified sound cards (comma separated list)\n"
|
||||
" use '-soundhw help' to get the list of supported cards\n"
|
||||
" use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL)
|
||||
SRST
|
||||
``-soundhw card1[,card2,...] or -soundhw all``
|
||||
Enable audio and selected sound hardware. Use 'help' to print all
|
||||
available sound hardware. For example:
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
|qemu_system_x86| -soundhw sb16,adlib disk.img
|
||||
|qemu_system_x86| -soundhw es1370 disk.img
|
||||
|qemu_system_x86| -soundhw ac97 disk.img
|
||||
|qemu_system_x86| -soundhw hda disk.img
|
||||
|qemu_system_x86| -soundhw all disk.img
|
||||
|qemu_system_x86| -soundhw help
|
||||
|
||||
Note that Linux's i810\_audio OSS kernel (for AC97) module might
|
||||
require manually specifying clocking.
|
||||
|
||||
::
|
||||
|
||||
modprobe i810_audio clocking=48000
|
||||
ERST
|
||||
|
||||
DEF("device", HAS_ARG, QEMU_OPTION_device,
|
||||
"-device driver[,prop[=value][,...]]\n"
|
||||
" add device (based on driver)\n"
|
||||
|
||||
@@ -7,7 +7,7 @@ link_args = cc.get_supported_link_arguments([
|
||||
|
||||
qga_vss = shared_module(
|
||||
'qga-vss',
|
||||
['requester.cpp', 'provider.cpp', 'install.cpp'],
|
||||
['requester.cpp', 'provider.cpp', 'install.cpp', genh],
|
||||
name_prefix: '',
|
||||
cpp_args: ['-Wno-unknown-pragmas', '-Wno-delete-non-virtual-dtor', '-Wno-non-virtual-dtor'],
|
||||
link_args: link_args,
|
||||
|
||||
@@ -354,12 +354,12 @@ void requester_freeze(int *num_vols, void *mountpoints, ErrorSet *errset)
|
||||
if (FAILED(hr)) {
|
||||
err_set(errset, hr, "failed to add %S to snapshot set",
|
||||
volume_name_wchar);
|
||||
delete volume_name_wchar;
|
||||
delete[] volume_name_wchar;
|
||||
goto out;
|
||||
}
|
||||
num_mount_points++;
|
||||
|
||||
delete volume_name_wchar;
|
||||
delete[] volume_name_wchar;
|
||||
}
|
||||
|
||||
if (num_mount_points == 0) {
|
||||
|
||||
+28
-2
@@ -116,6 +116,8 @@
|
||||
#include "crypto/init.h"
|
||||
#include "sysemu/replay.h"
|
||||
#include "qapi/qapi-events-run-state.h"
|
||||
#include "qapi/qapi-types-audio.h"
|
||||
#include "qapi/qapi-visit-audio.h"
|
||||
#include "qapi/qapi-visit-block-core.h"
|
||||
#include "qapi/qapi-visit-compat.h"
|
||||
#include "qapi/qapi-visit-ui.h"
|
||||
@@ -2930,9 +2932,33 @@ void qemu_init(int argc, char **argv, char **envp)
|
||||
case QEMU_OPTION_audiodev:
|
||||
audio_parse_option(optarg);
|
||||
break;
|
||||
case QEMU_OPTION_soundhw:
|
||||
select_soundhw (optarg);
|
||||
case QEMU_OPTION_audio: {
|
||||
QDict *dict = keyval_parse(optarg, "driver", NULL, &error_fatal);
|
||||
char *model;
|
||||
Audiodev *dev = NULL;
|
||||
Visitor *v;
|
||||
|
||||
if (!qdict_haskey(dict, "id")) {
|
||||
qdict_put_str(dict, "id", "audiodev0");
|
||||
}
|
||||
if (!qdict_haskey(dict, "model")) {
|
||||
error_setg(&error_fatal, "Parameter 'model' is missing");
|
||||
}
|
||||
model = g_strdup(qdict_get_str(dict, "model"));
|
||||
qdict_del(dict, "model");
|
||||
if (is_help_option(model)) {
|
||||
show_valid_soundhw();
|
||||
exit(0);
|
||||
}
|
||||
v = qobject_input_visitor_new_keyval(QOBJECT(dict));
|
||||
qobject_unref(dict);
|
||||
visit_type_Audiodev(v, NULL, &dev, &error_fatal);
|
||||
visit_free(v);
|
||||
audio_define(dev);
|
||||
select_soundhw(model, dev->id);
|
||||
g_free(model);
|
||||
break;
|
||||
}
|
||||
case QEMU_OPTION_h:
|
||||
help(0);
|
||||
break;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user