diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2019-11-13 10:56:53 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-12-17 19:32:27 +0100 |
commit | 46472d82322d0af23c7074c1101a791b5a27ca46 (patch) | |
tree | abb8efdc8c80feeca312e22b7443f943ca1904b3 /vl.c | |
parent | fe174132478b4e7b0086f2305a511fd94c9aca8b (diff) |
xen: convert "-machine igd-passthru" to an accelerator property
The first machine property to fall is Xen's Intel integrated graphics
passthrough. The "-machine igd-passthru" option does not set anymore
a property on the machine object, but desugars to a GlobalProperty on
accelerator objects.
The setter is very simple, since the value ends up in a
global variable, so this patch also provides an example before the more
complicated cases that follow it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -1133,13 +1133,6 @@ static void configure_msg(QemuOpts *opts) } -/* Now we still need this for compatibility with XEN. */ -bool has_igd_gfx_passthru; -static void igd_gfx_passthru(void) -{ - has_igd_gfx_passthru = current_machine->igd_gfx_passthru; -} - /***********************************************************/ /* USB devices */ @@ -2517,6 +2510,10 @@ static int machine_set_property(void *opaque, if (g_str_equal(qom_name, "accel")) { return 0; } + if (g_str_equal(qom_name, "igd-passthru")) { + object_register_sugar_prop(ACCEL_CLASS_NAME("xen"), qom_name, value); + return 0; + } return object_parse_property_opt(opaque, name, value, "type", errp); } @@ -4297,9 +4294,6 @@ int main(int argc, char **argv, char **envp) exit(1); } - /* Check if IGD GFX passthrough. */ - igd_gfx_passthru(); - /* init generic devices */ rom_set_order_override(FW_CFG_ORDER_OVERRIDE_DEVICE); qemu_opts_foreach(qemu_find_opts("device"), |