Files
kata-containers/virtcontainers/device/api/mockDeviceReceiver.go
Vijay Dhanraj f246a799aa virtcontainers: Add support for updating virtio-blk based container rootfs
Thist patch adds the following,
1. ACRN only supports virtio-blk and so the rootfs for the VM
   sits at /dev/vda. So to get the container rootfs increment the
   globalIndex by 1.
2. ACRN doesn't hot-plug container rootfs (but uses blkrescan) to
   update the container rootfs. So the agent can be provided the virtpath
   rather than the PCIaddr avoiding unneccessary rescaning to find the
   virthpath.

v1->v2:
Removed the workaround of incrementing index for
virtio-blk device and addressed it acrn.

Fixes: #1778

Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
2019-07-10 10:49:24 -07:00

44 lines
1.1 KiB
Go

// Copyright (c) 2018 Huawei Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package api
import (
"github.com/kata-containers/runtime/virtcontainers/device/config"
)
// MockDeviceReceiver is a fake DeviceReceiver API implementation only used for test
type MockDeviceReceiver struct{}
// HotplugAddDevice adds a new device
func (mockDC *MockDeviceReceiver) HotplugAddDevice(Device, config.DeviceType) error {
return nil
}
// HotplugRemoveDevice removes a device
func (mockDC *MockDeviceReceiver) HotplugRemoveDevice(Device, config.DeviceType) error {
return nil
}
// GetAndSetSandboxBlockIndex is used for get and set virtio-blk indexes
func (mockDC *MockDeviceReceiver) GetAndSetSandboxBlockIndex() (int, error) {
return 0, nil
}
// DecrementSandboxBlockIndex decreases virtio-blk index by one
func (mockDC *MockDeviceReceiver) DecrementSandboxBlockIndex() error {
return nil
}
// AppendDevice adds new vhost user device
func (mockDC *MockDeviceReceiver) AppendDevice(Device) error {
return nil
}
// GetHypervisorType is used for getting Hypervisor name currently used.
func (mockDC *MockDeviceReceiver) GetHypervisorType() string {
return ""
}