]> git.proxmox.com Git - mirror_qemu.git/commit
accel: Unbreak accelerator fallback
authorMarkus Armbruster <armbru@redhat.com>
Mon, 1 Apr 2019 09:08:27 +0000 (11:08 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 2 Apr 2019 11:50:09 +0000 (13:50 +0200)
commit79b9d4bde7db3f760851217b329c68a883184c6b
tree289d353e260897e016128a403c7a101d83459772
parent0427b6257e2a901d60c58cad6f1b750a76fad4a8
accel: Unbreak accelerator fallback

When the user specifies a list of accelerators, we pick the first one
that initializes successfully.  Recent commit 1a3ec8c1564 broke that.
Reproducer:

    $ qemu-system-x86_64 --machine accel=xen:tcg
    xencall: error: Could not obtain handle on privileged command interface: No such file or directory
    xen be core: xen be core: can't open xen interface
    can't open xen interface
    qemu-system-x86_64: failed to initialize Xen: Operation not permitted
    qemu-system-x86_64: /home/armbru/work/qemu/qom/object.c:436: object_set_accelerator_compat_props: Assertion `!object_compat_props[0]' failed.

Root cause: we register accelerator compat properties even when the
accelerator fails.  The failed assertion is
object_set_accelerator_compat_props() telling us off.  Fix by calling
it only for the accelerator that succeeded.

Fixes: 1a3ec8c1564f51628cce10d435a2e22559ea29fd
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20190401090827.20793-6-armbru@redhat.com>
accel/accel.c