machine + QOM queue, 2020-10-14
* Register some properties as class properties (Eduardo Habkost) * authz-list-file: Fix crash when filename is not set (Eduardo Habkost) * can-host-socketcan: Fix crash when 'if' option is not set (Eduardo Habkost) -----BEGIN PGP SIGNATURE----- iQJIBAABCAAyFiEEWjIv1avE09usz9GqKAeTb5hNxaYFAl+HDC0UHGVoYWJrb3N0 QHJlZGhhdC5jb20ACgkQKAeTb5hNxaZTqA/+LnV/VHN6WmwTkJDNKrjob6Yslwzp AVX3IPhX2c2tMeL4+zsH2x3N+DDP2ADFDfVln4Pp0jyq3aYy1uB7pa6bCioGnDta CmUIujI9uOXiEw157mUJHQd1HUE20YEwJGeY3vL17wP6NvGQHs8NNFibEErCSTPG hsC93zGCo3UgGWpKNFJ349cdsm644WBjDFueEy8RF7NQIMhYbGqhmCvIKf2j1BAY XkdUcnulOynFMDEuIL/nhcwDmAObdNO2xPDsKf00WJMkktWa745l1NG5d7Ryy5em BdgYjIN95tz5esKSwkYWzdrj9UInYCXCKo4hDm5/RGhvUJdU9SUanfEAEalxAM/2 U4L/pZ6IztoDeKBLyq2A7ZCUk2sxEBWsLEaCWzy6W8V1MlC9/fzoJ+ZAz5ov1K6X NxjtOdK3Jk9GaQKG3pa7YSWJ6Uc1/bv1VkHieemr3Qd9DCsVDn+OczZ3TnMl+WHq v2q9eLaulXlOBbtHiJdmmf6kmflxL8OxevVGkUhXnfD4aD6m3zXrKFSwr8wvlDul vzl8ywlCztN5x0CRNIINIj3PKsJyKnBOjVMWcLMcCPJCVwQW+u54vYKaj9xpwq35 1COfW2IP6D6QIyMrhSN+RFgSR7RNqp2lZHUmeFPCp4s51bJg+bnMeZvk8zG0eVRO e8gpodp6zCaYGgE= =5B9N -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging machine + QOM queue, 2020-10-14 * Register some properties as class properties (Eduardo Habkost) * authz-list-file: Fix crash when filename is not set (Eduardo Habkost) * can-host-socketcan: Fix crash when 'if' option is not set (Eduardo Habkost) # gpg: Signature made Wed 14 Oct 2020 15:33:17 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: can-host-socketcan: Fix crash when 'if' option is not set authz-list-file: Fix crash when filename is not set vhost-user: Register "chardev" as class property vga-pci: Register "big-endian-framebuffer" as class property i386: Register most CPU properties as class properties input-barrier: Register properties as class properties input-linux: Register properties as class properties rng: Register "opened" as class property rng-random: register "filename" as class property rng-egd: Register "chardev" as class property Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
		
						commit
						e545512b5e
					
				| @ -122,6 +122,11 @@ qauthz_list_file_complete(UserCreatable *uc, Error **errp) | ||||
|     QAuthZListFile *fauthz = QAUTHZ_LIST_FILE(uc); | ||||
|     gchar *dir = NULL, *file = NULL; | ||||
| 
 | ||||
|     if (!fauthz->filename) { | ||||
|         error_setg(errp, "filename not provided"); | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     fauthz->list = qauthz_list_file_load(fauthz, errp); | ||||
| 
 | ||||
|     if (!fauthz->refresh) { | ||||
|  | ||||
| @ -135,12 +135,6 @@ static char *rng_egd_get_chardev(Object *obj, Error **errp) | ||||
|     return NULL; | ||||
| } | ||||
| 
 | ||||
| static void rng_egd_init(Object *obj) | ||||
| { | ||||
|     object_property_add_str(obj, "chardev", | ||||
|                             rng_egd_get_chardev, rng_egd_set_chardev); | ||||
| } | ||||
| 
 | ||||
| static void rng_egd_finalize(Object *obj) | ||||
| { | ||||
|     RngEgd *s = RNG_EGD(obj); | ||||
| @ -155,6 +149,8 @@ static void rng_egd_class_init(ObjectClass *klass, void *data) | ||||
| 
 | ||||
|     rbc->request_entropy = rng_egd_request_entropy; | ||||
|     rbc->opened = rng_egd_opened; | ||||
|     object_class_property_add_str(klass, "chardev", | ||||
|                                   rng_egd_get_chardev, rng_egd_set_chardev); | ||||
| } | ||||
| 
 | ||||
| static const TypeInfo rng_egd_info = { | ||||
| @ -162,7 +158,6 @@ static const TypeInfo rng_egd_info = { | ||||
|     .parent = TYPE_RNG_BACKEND, | ||||
|     .instance_size = sizeof(RngEgd), | ||||
|     .class_init = rng_egd_class_init, | ||||
|     .instance_init = rng_egd_init, | ||||
|     .instance_finalize = rng_egd_finalize, | ||||
| }; | ||||
| 
 | ||||
|  | ||||
| @ -108,10 +108,6 @@ static void rng_random_init(Object *obj) | ||||
| { | ||||
|     RngRandom *s = RNG_RANDOM(obj); | ||||
| 
 | ||||
|     object_property_add_str(obj, "filename", | ||||
|                             rng_random_get_filename, | ||||
|                             rng_random_set_filename); | ||||
| 
 | ||||
|     s->filename = g_strdup("/dev/urandom"); | ||||
|     s->fd = -1; | ||||
| } | ||||
| @ -134,6 +130,10 @@ static void rng_random_class_init(ObjectClass *klass, void *data) | ||||
| 
 | ||||
|     rbc->request_entropy = rng_random_request_entropy; | ||||
|     rbc->opened = rng_random_opened; | ||||
|     object_class_property_add_str(klass, "filename", | ||||
|                                   rng_random_get_filename, | ||||
|                                   rng_random_set_filename); | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| static const TypeInfo rng_random_info = { | ||||
|  | ||||
| @ -105,10 +105,6 @@ static void rng_backend_init(Object *obj) | ||||
|     RngBackend *s = RNG_BACKEND(obj); | ||||
| 
 | ||||
|     QSIMPLEQ_INIT(&s->requests); | ||||
| 
 | ||||
|     object_property_add_bool(obj, "opened", | ||||
|                              rng_backend_prop_get_opened, | ||||
|                              rng_backend_prop_set_opened); | ||||
| } | ||||
| 
 | ||||
| static void rng_backend_finalize(Object *obj) | ||||
| @ -123,6 +119,10 @@ static void rng_backend_class_init(ObjectClass *oc, void *data) | ||||
|     UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc); | ||||
| 
 | ||||
|     ucc->complete = rng_backend_complete; | ||||
| 
 | ||||
|     object_class_property_add_bool(oc, "opened", | ||||
|                                    rng_backend_prop_get_opened, | ||||
|                                    rng_backend_prop_set_opened); | ||||
| } | ||||
| 
 | ||||
| static const TypeInfo rng_backend_info = { | ||||
|  | ||||
| @ -175,9 +175,9 @@ static char *get_chardev(Object *obj, Error **errp) | ||||
|     return NULL; | ||||
| } | ||||
| 
 | ||||
| static void vhost_user_backend_init(Object *obj) | ||||
| static void vhost_user_backend_class_init(ObjectClass *oc, void *data) | ||||
| { | ||||
|     object_property_add_str(obj, "chardev", get_chardev, set_chardev); | ||||
|     object_class_property_add_str(oc, "chardev", get_chardev, set_chardev); | ||||
| } | ||||
| 
 | ||||
| static void vhost_user_backend_finalize(Object *obj) | ||||
| @ -195,7 +195,7 @@ static const TypeInfo vhost_user_backend_info = { | ||||
|     .name = TYPE_VHOST_USER_BACKEND, | ||||
|     .parent = TYPE_OBJECT, | ||||
|     .instance_size = sizeof(VhostUserBackend), | ||||
|     .instance_init = vhost_user_backend_init, | ||||
|     .class_init = vhost_user_backend_class_init, | ||||
|     .instance_finalize = vhost_user_backend_finalize, | ||||
| }; | ||||
| 
 | ||||
|  | ||||
| @ -267,13 +267,6 @@ static void pci_std_vga_realize(PCIDevice *dev, Error **errp) | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| static void pci_std_vga_init(Object *obj) | ||||
| { | ||||
|     /* Expose framebuffer byteorder via QOM */ | ||||
|     object_property_add_bool(obj, "big-endian-framebuffer", | ||||
|                              vga_get_big_endian_fb, vga_set_big_endian_fb); | ||||
| } | ||||
| 
 | ||||
| static void pci_secondary_vga_realize(PCIDevice *dev, Error **errp) | ||||
| { | ||||
|     PCIVGAState *d = PCI_VGA(dev); | ||||
| @ -386,6 +379,10 @@ static void vga_class_init(ObjectClass *klass, void *data) | ||||
|     k->class_id = PCI_CLASS_DISPLAY_VGA; | ||||
|     device_class_set_props(dc, vga_pci_properties); | ||||
|     dc->hotpluggable = false; | ||||
| 
 | ||||
|     /* Expose framebuffer byteorder via QOM */ | ||||
|     object_class_property_add_bool(klass, "big-endian-framebuffer", | ||||
|                                    vga_get_big_endian_fb, vga_set_big_endian_fb); | ||||
| } | ||||
| 
 | ||||
| static void secondary_class_init(ObjectClass *klass, void *data) | ||||
| @ -403,7 +400,6 @@ static void secondary_class_init(ObjectClass *klass, void *data) | ||||
| static const TypeInfo vga_info = { | ||||
|     .name          = "VGA", | ||||
|     .parent        = TYPE_PCI_VGA, | ||||
|     .instance_init = pci_std_vga_init, | ||||
|     .class_init    = vga_class_init, | ||||
| }; | ||||
| 
 | ||||
|  | ||||
| @ -194,6 +194,11 @@ static void can_host_socketcan_connect(CanHostState *ch, Error **errp) | ||||
|     struct sockaddr_can addr; | ||||
|     struct ifreq ifr; | ||||
| 
 | ||||
|     if (!c->ifname) { | ||||
|         error_setg(errp, "'if' property not set"); | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     /* open socket */ | ||||
|     s = qemu_socket(PF_CAN, SOCK_RAW, CAN_RAW); | ||||
|     if (s < 0) { | ||||
|  | ||||
| @ -6925,44 +6925,12 @@ static void x86_cpu_initfn(Object *obj) | ||||
|     env->nr_dies = 1; | ||||
|     cpu_set_cpustate_pointers(cpu); | ||||
| 
 | ||||
|     object_property_add(obj, "family", "int", | ||||
|                         x86_cpuid_version_get_family, | ||||
|                         x86_cpuid_version_set_family, NULL, NULL); | ||||
|     object_property_add(obj, "model", "int", | ||||
|                         x86_cpuid_version_get_model, | ||||
|                         x86_cpuid_version_set_model, NULL, NULL); | ||||
|     object_property_add(obj, "stepping", "int", | ||||
|                         x86_cpuid_version_get_stepping, | ||||
|                         x86_cpuid_version_set_stepping, NULL, NULL); | ||||
|     object_property_add_str(obj, "vendor", | ||||
|                             x86_cpuid_get_vendor, | ||||
|                             x86_cpuid_set_vendor); | ||||
|     object_property_add_str(obj, "model-id", | ||||
|                             x86_cpuid_get_model_id, | ||||
|                             x86_cpuid_set_model_id); | ||||
|     object_property_add(obj, "tsc-frequency", "int", | ||||
|                         x86_cpuid_get_tsc_freq, | ||||
|                         x86_cpuid_set_tsc_freq, NULL, NULL); | ||||
|     object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", | ||||
|                         x86_cpu_get_feature_words, | ||||
|                         NULL, NULL, (void *)env->features); | ||||
|     object_property_add(obj, "filtered-features", "X86CPUFeatureWordInfo", | ||||
|                         x86_cpu_get_feature_words, | ||||
|                         NULL, NULL, (void *)cpu->filtered_features); | ||||
|     /*
 | ||||
|      * The "unavailable-features" property has the same semantics as | ||||
|      * CpuDefinitionInfo.unavailable-features on the "query-cpu-definitions" | ||||
|      * QMP command: they list the features that would have prevented the | ||||
|      * CPU from running if the "enforce" flag was set. | ||||
|      */ | ||||
|     object_property_add(obj, "unavailable-features", "strList", | ||||
|                         x86_cpu_get_unavailable_features, | ||||
|                         NULL, NULL, NULL); | ||||
| 
 | ||||
| #if !defined(CONFIG_USER_ONLY) | ||||
|     object_property_add(obj, "crash-information", "GuestPanicInformation", | ||||
|                         x86_cpu_get_crash_info_qom, NULL, NULL, NULL); | ||||
| #endif | ||||
| 
 | ||||
|     for (w = 0; w < FEATURE_WORDS; w++) { | ||||
|         int bitnr; | ||||
| @ -7312,6 +7280,40 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) | ||||
|     cc->disas_set_info = x86_disas_set_info; | ||||
| 
 | ||||
|     dc->user_creatable = true; | ||||
| 
 | ||||
|     object_class_property_add(oc, "family", "int", | ||||
|                               x86_cpuid_version_get_family, | ||||
|                               x86_cpuid_version_set_family, NULL, NULL); | ||||
|     object_class_property_add(oc, "model", "int", | ||||
|                               x86_cpuid_version_get_model, | ||||
|                               x86_cpuid_version_set_model, NULL, NULL); | ||||
|     object_class_property_add(oc, "stepping", "int", | ||||
|                               x86_cpuid_version_get_stepping, | ||||
|                               x86_cpuid_version_set_stepping, NULL, NULL); | ||||
|     object_class_property_add_str(oc, "vendor", | ||||
|                                   x86_cpuid_get_vendor, | ||||
|                                   x86_cpuid_set_vendor); | ||||
|     object_class_property_add_str(oc, "model-id", | ||||
|                                   x86_cpuid_get_model_id, | ||||
|                                   x86_cpuid_set_model_id); | ||||
|     object_class_property_add(oc, "tsc-frequency", "int", | ||||
|                               x86_cpuid_get_tsc_freq, | ||||
|                               x86_cpuid_set_tsc_freq, NULL, NULL); | ||||
|     /*
 | ||||
|      * The "unavailable-features" property has the same semantics as | ||||
|      * CpuDefinitionInfo.unavailable-features on the "query-cpu-definitions" | ||||
|      * QMP command: they list the features that would have prevented the | ||||
|      * CPU from running if the "enforce" flag was set. | ||||
|      */ | ||||
|     object_class_property_add(oc, "unavailable-features", "strList", | ||||
|                               x86_cpu_get_unavailable_features, | ||||
|                               NULL, NULL, NULL); | ||||
| 
 | ||||
| #if !defined(CONFIG_USER_ONLY) | ||||
|     object_class_property_add(oc, "crash-information", "GuestPanicInformation", | ||||
|                               x86_cpu_get_crash_info_qom, NULL, NULL, NULL); | ||||
| #endif | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| static const TypeInfo x86_cpu_type_info = { | ||||
|  | ||||
| @ -689,28 +689,6 @@ static void input_barrier_instance_init(Object *obj) | ||||
|     ib->y_origin = 0; | ||||
|     ib->width = 1920; | ||||
|     ib->height = 1080; | ||||
| 
 | ||||
|     object_property_add_str(obj, "name", | ||||
|                             input_barrier_get_name, | ||||
|                             input_barrier_set_name); | ||||
|     object_property_add_str(obj, "server", | ||||
|                             input_barrier_get_server, | ||||
|                             input_barrier_set_server); | ||||
|     object_property_add_str(obj, "port", | ||||
|                             input_barrier_get_port, | ||||
|                             input_barrier_set_port); | ||||
|     object_property_add_str(obj, "x-origin", | ||||
|                             input_barrier_get_x_origin, | ||||
|                             input_barrier_set_x_origin); | ||||
|     object_property_add_str(obj, "y-origin", | ||||
|                             input_barrier_get_y_origin, | ||||
|                             input_barrier_set_y_origin); | ||||
|     object_property_add_str(obj, "width", | ||||
|                             input_barrier_get_width, | ||||
|                             input_barrier_set_width); | ||||
|     object_property_add_str(obj, "height", | ||||
|                             input_barrier_get_height, | ||||
|                             input_barrier_set_height); | ||||
| } | ||||
| 
 | ||||
| static void input_barrier_class_init(ObjectClass *oc, void *data) | ||||
| @ -718,6 +696,28 @@ static void input_barrier_class_init(ObjectClass *oc, void *data) | ||||
|     UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc); | ||||
| 
 | ||||
|     ucc->complete = input_barrier_complete; | ||||
| 
 | ||||
|     object_class_property_add_str(oc, "name", | ||||
|                                   input_barrier_get_name, | ||||
|                                   input_barrier_set_name); | ||||
|     object_class_property_add_str(oc, "server", | ||||
|                                   input_barrier_get_server, | ||||
|                                   input_barrier_set_server); | ||||
|     object_class_property_add_str(oc, "port", | ||||
|                                   input_barrier_get_port, | ||||
|                                   input_barrier_set_port); | ||||
|     object_class_property_add_str(oc, "x-origin", | ||||
|                                   input_barrier_get_x_origin, | ||||
|                                   input_barrier_set_x_origin); | ||||
|     object_class_property_add_str(oc, "y-origin", | ||||
|                                   input_barrier_get_y_origin, | ||||
|                                   input_barrier_set_y_origin); | ||||
|     object_class_property_add_str(oc, "width", | ||||
|                                   input_barrier_get_width, | ||||
|                                   input_barrier_set_width); | ||||
|     object_class_property_add_str(oc, "height", | ||||
|                                   input_barrier_get_height, | ||||
|                                   input_barrier_set_height); | ||||
| } | ||||
| 
 | ||||
| static const TypeInfo input_barrier_info = { | ||||
|  | ||||
| @ -490,19 +490,6 @@ static void input_linux_set_grab_toggle(Object *obj, int value, | ||||
| 
 | ||||
| static void input_linux_instance_init(Object *obj) | ||||
| { | ||||
|     object_property_add_str(obj, "evdev", | ||||
|                             input_linux_get_evdev, | ||||
|                             input_linux_set_evdev); | ||||
|     object_property_add_bool(obj, "grab_all", | ||||
|                              input_linux_get_grab_all, | ||||
|                              input_linux_set_grab_all); | ||||
|     object_property_add_bool(obj, "repeat", | ||||
|                              input_linux_get_repeat, | ||||
|                              input_linux_set_repeat); | ||||
|     object_property_add_enum(obj, "grab-toggle", "GrabToggleKeys", | ||||
|                              &GrabToggleKeys_lookup, | ||||
|                              input_linux_get_grab_toggle, | ||||
|                              input_linux_set_grab_toggle); | ||||
| } | ||||
| 
 | ||||
| static void input_linux_class_init(ObjectClass *oc, void *data) | ||||
| @ -510,6 +497,20 @@ static void input_linux_class_init(ObjectClass *oc, void *data) | ||||
|     UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc); | ||||
| 
 | ||||
|     ucc->complete = input_linux_complete; | ||||
| 
 | ||||
|     object_class_property_add_str(oc, "evdev", | ||||
|                                   input_linux_get_evdev, | ||||
|                                   input_linux_set_evdev); | ||||
|     object_class_property_add_bool(oc, "grab_all", | ||||
|                                    input_linux_get_grab_all, | ||||
|                                    input_linux_set_grab_all); | ||||
|     object_class_property_add_bool(oc, "repeat", | ||||
|                                    input_linux_get_repeat, | ||||
|                                    input_linux_set_repeat); | ||||
|     object_class_property_add_enum(oc, "grab-toggle", "GrabToggleKeys", | ||||
|                                    &GrabToggleKeys_lookup, | ||||
|                                    input_linux_get_grab_toggle, | ||||
|                                    input_linux_set_grab_toggle); | ||||
| } | ||||
| 
 | ||||
| static const TypeInfo input_linux_info = { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Peter Maydell
						Peter Maydell