aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ian.jackson@eu.citrix.com>2018-03-09 12:02:50 +0000
committerIan Jackson <Ian.Jackson@eu.citrix.com>2018-04-26 16:29:50 +0100
commit7a64c17f3b3015bf741593a019538275c764455f (patch)
tree09c3edbbe780fe0efb2049a58f18322a61e8b23a
parent5ac067a24a85fec57d2d87b2d12ae4ffa6aa2d9e (diff)
downloadqemu-7a64c17f3b3015bf741593a019538275c764455f.zip
qemu-7a64c17f3b3015bf741593a019538275c764455f.tar.gz
qemu-7a64c17f3b3015bf741593a019538275c764455f.tar.bz2
AccelClass: Introduce accel_setup_post
This is called just before os_setup_post. Currently none of the accelerators provide this hook, but the Xen one is going to provide one in a moment. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r--accel/accel.c9
-rw-r--r--include/sysemu/accel.h3
-rw-r--r--vl.c1
3 files changed, 13 insertions, 0 deletions
diff --git a/accel/accel.c b/accel/accel.c
index 93e2434..9cfab11 100644
--- a/accel/accel.c
+++ b/accel/accel.c
@@ -126,6 +126,15 @@ void accel_register_compat_props(AccelState *accel)
register_compat_props_array(class->global_props);
}
+void accel_setup_post(MachineState *ms)
+{
+ AccelState *accel = ms->accelerator;
+ AccelClass *acc = ACCEL_GET_CLASS(accel);
+ if (acc->setup_post) {
+ acc->setup_post(ms, accel);
+ }
+}
+
static void register_accel_types(void)
{
type_register_static(&accel_type);
diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h
index 5a632ce..637358f 100644
--- a/include/sysemu/accel.h
+++ b/include/sysemu/accel.h
@@ -40,6 +40,7 @@ typedef struct AccelClass {
const char *name;
int (*available)(void);
int (*init_machine)(MachineState *ms);
+ void (*setup_post)(MachineState *ms, AccelState *accel);
bool *allowed;
/*
* Array of global properties that would be applied when specific
@@ -68,5 +69,7 @@ extern unsigned long tcg_tb_size;
void configure_accelerator(MachineState *ms);
/* Register accelerator specific global properties */
void accel_register_compat_props(AccelState *accel);
+/* Called just before os_setup_post (ie just before drop OS privs) */
+void accel_setup_post(MachineState *ms);
#endif
diff --git a/vl.c b/vl.c
index 616956a..d37e857 100644
--- a/vl.c
+++ b/vl.c
@@ -4742,6 +4742,7 @@ int main(int argc, char **argv, char **envp)
vm_start();
}
+ accel_setup_post(current_machine);
os_setup_post();
main_loop();