mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-22 20:45:21 +00:00
vmm: Add support for multiple children per DeviceNode
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
daaeba5142
commit
0805d458c4
@ -563,7 +563,7 @@ impl Drop for ActivatedBackend {
|
||||
struct DeviceNode {
|
||||
resources: Vec<Resource>,
|
||||
parent: Option<String>,
|
||||
child: Option<String>,
|
||||
children: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
@ -2138,7 +2138,7 @@ impl DeviceManager {
|
||||
|
||||
// Add the new virtio-pci node to the device tree.
|
||||
let node = DeviceNode {
|
||||
child: Some(virtio_device_id.clone()),
|
||||
children: vec![virtio_device_id.clone()],
|
||||
..Default::default()
|
||||
};
|
||||
self.device_tree.insert(id.clone(), node);
|
||||
@ -2286,7 +2286,7 @@ impl DeviceManager {
|
||||
} else {
|
||||
// Add the new virtio-mmio node to the device tree.
|
||||
let node = DeviceNode {
|
||||
child: Some(virtio_device_id.clone()),
|
||||
children: vec![virtio_device_id.clone()],
|
||||
..Default::default()
|
||||
};
|
||||
self.device_tree.insert(id.clone(), node);
|
||||
@ -3052,7 +3052,7 @@ impl Snapshottable for DeviceManager {
|
||||
// the device tree is the right way to ensure we restore a child before
|
||||
// its parent node.
|
||||
for (id, node) in self.device_tree.iter() {
|
||||
if node.child.is_some() {
|
||||
if !node.children.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user