MemoryBackend类层次结构
+------------------+ +----------------------+
| | | |
| ObjectClass | ------------------------------ | Object |
| class_init | | |
| | | |
+------------------+ +----------------------+
| |
| |
| |
v v
+--------------------------+ +----------------------+
| | | |
|HostMemoryBackendClass | ------------------------------------ | HostMemoryBackend |
| class_init | host_memory_backend_class_init | instance_init | host_memory_backend_init
| | | |
| +-----------------------+ | |
| |UserCreatableClass | | |
| | complete | host_memory_backend_memory_complete | |
+--+-----------------------+ +---+------------------+
| |
| |
| |
| |
| TYPE_MEMORY_BACKEND_RAM |
| +-----------------------+ | +----------------------+
| | | | | |
+--- |HostMemoryBackendClass | +--- |HostMemoryBackend |
| | class_init | ram_backend_class_init | | instance_init |
| | bc->alloc | ram_backend_memory_alloc | | |
| +-----------------------+ | +----------------------+
| |
| TYPE_MEMORY_BACKEND_FILE |
| +-----------------------+ | +----------------------+
| | | | | |
+--- |HostMemoryBackendClass | +--- |HostMemoryBackendFile |
| | class_init | file_backend_class_init | | instance_init |
| | bc->alloc | file_backend_memory_alloc | | |
| +-----------------------+ | +----------------------+
| |
| TYPE_MEMORY_BACKEND_RAM |
| +-----------------------+ | +----------------------+
| | | | | |
+--- |HostMemoryBackendClass | +--- |HostMemoryBackendMemfd|
| class_init | memfd_backend_class_init | instance_init | memfd_backend_instance_init
| bc->alloc | memfd_backend_memory_alloc | |
+-----------------------+ +----------------------+Last updated