properly link instacne device with reserved flag
This commit is contained in:
parent
58423d21df
commit
73a53d4d47
@ -160,6 +160,7 @@ func (instance *Instance) RebuildDevice(host Host, deviceid string) error {
|
|||||||
hostSuperDevice := host.Hardware[hostDeviceBusID]
|
hostSuperDevice := host.Hardware[hostDeviceBusID]
|
||||||
subDevices := []*HostDevice{}
|
subDevices := []*HostDevice{}
|
||||||
for _, v := range hostSuperDevice.Devices {
|
for _, v := range hostSuperDevice.Devices {
|
||||||
|
v.Reserved = true
|
||||||
subDevices = append(subDevices, v)
|
subDevices = append(subDevices, v)
|
||||||
}
|
}
|
||||||
instance.Device[uint(instanceDeviceBusID)] = &InstanceDevice{
|
instance.Device[uint(instanceDeviceBusID)] = &InstanceDevice{
|
||||||
@ -171,10 +172,10 @@ func (instance *Instance) RebuildDevice(host Host, deviceid string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
v := host.Hardware[hostDeviceBusID].Devices[hostSubdeviceBusID]
|
||||||
|
v.Reserved = true
|
||||||
instance.Device[uint(instanceDeviceBusID)] = &InstanceDevice{
|
instance.Device[uint(instanceDeviceBusID)] = &InstanceDevice{
|
||||||
Device: []*HostDevice{
|
Device: []*HostDevice{v},
|
||||||
host.Hardware[hostDeviceBusID].Devices[hostSubdeviceBusID],
|
|
||||||
},
|
|
||||||
PCIE: strings.Contains(instanceDevice, "pcie=1"),
|
PCIE: strings.Contains(instanceDevice, "pcie=1"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user