devices: remove interface VhostUserDevice

The interface "VhostUserDevice" has duplicate functions and fields with
Device, so we can merge them into one interface and manage them with one
group of interfaces.

Signed-off-by: Wei Zhang <zhangwei555@huawei.com>
This commit is contained in:
Wei Zhang
2018-07-01 10:36:59 +08:00
committed by z00280905
parent 2885eb0532
commit b54df7e127
11 changed files with 172 additions and 124 deletions

View File

@@ -35,17 +35,8 @@ type DeviceReceiver interface {
GetAndSetSandboxBlockIndex() (int, error)
DecrementSandboxBlockIndex() error
// this is for vhost_user devices
AddVhostUserDevice(VhostUserDevice, config.DeviceType) error
}
// VhostUserDevice represents a vhost-user device. Shared
// attributes of a vhost-user device can be retrieved using
// the Attrs() method. Unique data can be obtained by casting
// the object to the proper type.
type VhostUserDevice interface {
Attrs() *config.VhostUserDeviceAttrs
Type() config.DeviceType
// this is for appending device to hypervisor boot params
AppendDevice(Device) error
}
// Device is the virtcontainers device interface.