mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-20 15:54:19 +01:00
Merge pull request #4 from egernst/vhost-user-add-blk
Vhost-user: add block device support
This commit is contained in:
@@ -269,13 +269,24 @@ func TestAppendDeviceBlock(t *testing.T) {
|
||||
|
||||
var deviceVhostUserNetString = "-chardev socket,id=char1,path=/tmp/nonexistentsocket.socket -netdev type=vhost-user,id=net1,chardev=char1,vhostforce -device virtio-net-pci,netdev=net1,mac=00:11:22:33:44:55"
|
||||
var deviceVhostUserSCSIString = "-chardev socket,id=char1,path=/tmp/nonexistentsocket.socket -device vhost-user-scsi-pci,id=scsi1,chardev=char1"
|
||||
var deviceVhostUserBlkString = "-chardev socket,id=char2,path=/tmp/nonexistentsocket.socket -device vhost-user-blk-pci,logical_block_size=4096,size=512M,chardev=char2"
|
||||
|
||||
func TestAppendDeviceVhostUser(t *testing.T) {
|
||||
|
||||
vhostuserBlkDevice := VhostUserDevice{
|
||||
SocketPath: "/tmp/nonexistentsocket.socket",
|
||||
CharDevID: "char2",
|
||||
TypeDevID: "",
|
||||
Address: "",
|
||||
VhostUserType: VhostUserBlk,
|
||||
}
|
||||
testAppend(vhostuserBlkDevice, deviceVhostUserBlkString, t)
|
||||
|
||||
vhostuserSCSIDevice := VhostUserDevice{
|
||||
SocketPath: "/tmp/nonexistentsocket.socket",
|
||||
CharDevID: "char1",
|
||||
TypeDevID: "scsi1",
|
||||
MacAddress: "",
|
||||
Address: "",
|
||||
VhostUserType: VhostUserSCSI,
|
||||
}
|
||||
testAppend(vhostuserSCSIDevice, deviceVhostUserSCSIString, t)
|
||||
@@ -284,7 +295,7 @@ func TestAppendDeviceVhostUser(t *testing.T) {
|
||||
SocketPath: "/tmp/nonexistentsocket.socket",
|
||||
CharDevID: "char1",
|
||||
TypeDevID: "net1",
|
||||
MacAddress: "00:11:22:33:44:55",
|
||||
Address: "00:11:22:33:44:55",
|
||||
VhostUserType: VhostUserNet,
|
||||
}
|
||||
testAppend(vhostuserNetDevice, deviceVhostUserNetString, t)
|
||||
|
||||
Reference in New Issue
Block a user