File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -828,6 +828,17 @@ Object *qdev_get_machine(void)
828
828
return dev ;
829
829
}
830
830
831
+ Object * machine_get_container (const char * name )
832
+ {
833
+ Object * container , * machine ;
834
+
835
+ machine = qdev_get_machine ();
836
+ container = object_resolve_path_component (machine , name );
837
+ assert (object_dynamic_cast (container , TYPE_CONTAINER ));
838
+
839
+ return container ;
840
+ }
841
+
831
842
char * qdev_get_human_name (DeviceState * dev )
832
843
{
833
844
g_assert (dev != NULL );
Original file line number Diff line number Diff line change @@ -1033,6 +1033,16 @@ Object *qdev_get_machine(void);
1033
1033
*/
1034
1034
void qdev_create_fake_machine (void );
1035
1035
1036
+ /**
1037
+ * machine_get_container:
1038
+ * @name: The name of container to lookup
1039
+ *
1040
+ * Get a container of the machine (QOM path "/machine/NAME").
1041
+ *
1042
+ * Returns: the machine container object.
1043
+ */
1044
+ Object * machine_get_container (const char * name );
1045
+
1036
1046
/**
1037
1047
* qdev_get_human_name() - Return a human-readable name for a device
1038
1048
* @dev: The device. Must be a valid and non-NULL pointer.
You can’t perform that action at this time.
0 commit comments