mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-16 12:54:22 +01:00
runtime: device/persist: drop persist dependency from device pkgs
Rather than have device package depend on persist, let's define the (almost duplicate) structures within device itself, and have the Kata Container's persist pkg import these. This'll help avoid unecessary dependencies within our core packages. Signed-off-by: Eric Ernst <eric_ernst@apple.com>
This commit is contained in:
@@ -10,7 +10,6 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/kata-containers/kata-containers/src/runtime/pkg/device/config"
|
||||
persistapi "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/persist/api"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -78,10 +77,10 @@ type Device interface {
|
||||
Dereference() uint
|
||||
|
||||
// Save converts Device to DeviceState
|
||||
Save() persistapi.DeviceState
|
||||
Save() config.DeviceState
|
||||
|
||||
// Load loads DeviceState and converts it to specific device
|
||||
Load(persistapi.DeviceState)
|
||||
Load(config.DeviceState)
|
||||
}
|
||||
|
||||
// DeviceManager can be used to create a new device, this can be used as single
|
||||
@@ -94,5 +93,5 @@ type DeviceManager interface {
|
||||
IsDeviceAttached(string) bool
|
||||
GetDeviceByID(string) Device
|
||||
GetAllDevices() []Device
|
||||
LoadDevices([]persistapi.DeviceState)
|
||||
LoadDevices([]config.DeviceState)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user