machine: Clean up -machine handling
PATCH 1/1 machine: Clean up -machine handling
Since commit c4090f8, -object options are no longer handled through object_set_property(), so clean up -object leftovers by renaming the function and dropping special-casing of qom-type and id properties.
--- vl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
vl.c +4 -4
@@ -2818,15 +2818,15 @@ static void free_and_trace(gpointer mem)free (mem); } -static int object_set_property (const char *name,const char *value,void *opaque) +static int machine_set_property (const char *name,const char *value, +void *opaque) {Object *obj =OBJECT (opaque);StringInputVisitor *siv;Error *local_err =NULL ;char *c, *qom_name; -if (strcmp (name,"qom-type" ) ==0 ||strcmp (name,"id" ) ==0 || -strcmp (name,"type" ) ==0 ) { +if (strcmp (name,"type" ) ==0 ) {return 0 ; }
@@ -4226,7 +4226,7 @@ int main(int argc, char **argv, char **envp) } machine_opts =qemu_get_machine_opts (); -if (qemu_opt_foreach (machine_opts, object_set_property, current_machine, +if (qemu_opt_foreach (machine_opts, machine_set_property, current_machine,1 ) <0 ) {object_unref (OBJECT (current_machine));exit (1 );
Signature · 1 line
1.8.4.5
----- Original Message -----
From: "Andreas Färber" <[email protected]>
To: [email protected]
Cc: "marcel a" <[email protected]>, "Andreas Färber" <[email protected]>, "Paolo Bonzini" <[email protected]>, "Anthony Liguori" <[email protected]>
Sent: Wednesday, July 23, 2014 5:32:11 PM
Subject: [PATCH qom-next] machine: Clean up -machine handling
Since commit c4090f8, -object options are no longer handled through object_set_property(), so clean up -object leftovers by renaming the function and dropping special-casing of qom-type and id properties.
--- vl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
vl.c +4 -4
@@ -2818,15 +2818,15 @@ static void free_and_trace(gpointer mem)free (mem); } -static int object_set_property (const char *name,const char *value,void *opaque) +static int machine_set_property (const char *name,const char *value, +void *opaque) {Object *obj =OBJECT (opaque);StringInputVisitor *siv;Error *local_err =NULL ;char *c, *qom_name; -if (strcmp (name,"qom-type" ) ==0 ||strcmp (name,"id" ) ==0 || -strcmp (name,"type" ) ==0 ) { +if (strcmp (name,"type" ) ==0 ) {return 0 ; }
@@ -4226,7 +4226,7 @@ int main(int argc, char **argv, char **envp) } machine_opts =qemu_get_machine_opts (); -if (qemu_opt_foreach (machine_opts, object_set_property, current_machine, +if (qemu_opt_foreach (machine_opts, machine_set_property, current_machine,1 ) <0 ) {object_unref (OBJECT (current_machine));exit (1 );
Signature · 7 lines
1.8.4.5 I was thinking about exactly the same thing. Reviewed-by Marcel Apfelbaum <[email protected]> Thanks, Marcel