mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 20:24:31 +00:00
device: add ColdPlug flag
Add ColdPlug flag to DeviceInfo and DeviceState to identify whether a device must be or was cold plugged Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
parent
e3a3818f7a
commit
3eb694c518
@ -117,6 +117,10 @@ type DeviceInfo struct {
|
|||||||
// for a nvdimm device in the guest.
|
// for a nvdimm device in the guest.
|
||||||
Pmem bool
|
Pmem bool
|
||||||
|
|
||||||
|
// ColdPlug specifies whether the device must be cold plugged (true)
|
||||||
|
// or hot plugged (false).
|
||||||
|
ColdPlug bool
|
||||||
|
|
||||||
// FileMode permission bits for the device.
|
// FileMode permission bits for the device.
|
||||||
FileMode os.FileMode
|
FileMode os.FileMode
|
||||||
|
|
||||||
|
@ -140,6 +140,7 @@ func (device *GenericDevice) Save() persistapi.DeviceState {
|
|||||||
dss.Major = info.Major
|
dss.Major = info.Major
|
||||||
dss.Minor = info.Minor
|
dss.Minor = info.Minor
|
||||||
dss.DriverOptions = info.DriverOptions
|
dss.DriverOptions = info.DriverOptions
|
||||||
|
dss.ColdPlug = info.ColdPlug
|
||||||
}
|
}
|
||||||
return dss
|
return dss
|
||||||
}
|
}
|
||||||
@ -155,5 +156,6 @@ func (device *GenericDevice) Load(ds persistapi.DeviceState) {
|
|||||||
Major: ds.Major,
|
Major: ds.Major,
|
||||||
Minor: ds.Minor,
|
Minor: ds.Minor,
|
||||||
DriverOptions: ds.DriverOptions,
|
DriverOptions: ds.DriverOptions,
|
||||||
|
ColdPlug: ds.ColdPlug,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -103,6 +103,10 @@ type DeviceState struct {
|
|||||||
Major int64
|
Major int64
|
||||||
Minor int64
|
Minor int64
|
||||||
|
|
||||||
|
// ColdPlug specifies whether the device must be cold plugged (true)
|
||||||
|
// or hot plugged (false).
|
||||||
|
ColdPlug bool
|
||||||
|
|
||||||
// DriverOptions is specific options for each device driver
|
// DriverOptions is specific options for each device driver
|
||||||
// for example, for BlockDevice, we can set DriverOptions["blockDriver"]="virtio-blk"
|
// for example, for BlockDevice, we can set DriverOptions["blockDriver"]="virtio-blk"
|
||||||
DriverOptions map[string]string
|
DriverOptions map[string]string
|
||||||
|
Loading…
Reference in New Issue
Block a user