mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-22 21:49:41 +00:00
qemu: Update virtio-net-pci command line
In case of a network device, and specifically virtio-net-pci, we have to update to what is expected by qemu. In this case, the driver name should be prefixed with "driver=". Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
25a2dc8f6e
commit
8d617ff5b9
3
qemu.go
3
qemu.go
@ -390,6 +390,9 @@ func (netdev NetDevice) QemuParams(config *Config) []string {
|
|||||||
var deviceParams []string
|
var deviceParams []string
|
||||||
var qemuParams []string
|
var qemuParams []string
|
||||||
|
|
||||||
|
if netdev.Driver == VirtioNetPCI {
|
||||||
|
deviceParams = append(deviceParams, "driver=")
|
||||||
|
}
|
||||||
deviceParams = append(deviceParams, fmt.Sprintf("%s", netdev.Driver))
|
deviceParams = append(deviceParams, fmt.Sprintf("%s", netdev.Driver))
|
||||||
deviceParams = append(deviceParams, fmt.Sprintf(",netdev=%s", netdev.ID))
|
deviceParams = append(deviceParams, fmt.Sprintf(",netdev=%s", netdev.ID))
|
||||||
deviceParams = append(deviceParams, fmt.Sprintf(",mac=%s", netdev.MACAddress))
|
deviceParams = append(deviceParams, fmt.Sprintf(",mac=%s", netdev.MACAddress))
|
||||||
|
@ -143,7 +143,7 @@ func TestAppendDeviceNetwork(t *testing.T) {
|
|||||||
testAppend(netdev, deviceNetworkString, t)
|
testAppend(netdev, deviceNetworkString, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
var deviceNetworkPCIString = "-device virtio-net-pci,netdev=tap0,mac=01:02:de:ad:be:ef,bus=/pci-bus/pcie.0,addr=ff -netdev tap,id=tap0,ifname=ceth0,downscript=no,script=no,fds=3:4,vhost=on"
|
var deviceNetworkPCIString = "-device driver=virtio-net-pci,netdev=tap0,mac=01:02:de:ad:be:ef,bus=/pci-bus/pcie.0,addr=ff -netdev tap,id=tap0,ifname=ceth0,downscript=no,script=no,fds=3:4,vhost=on"
|
||||||
|
|
||||||
func TestAppendDeviceNetworkPCI(t *testing.T) {
|
func TestAppendDeviceNetworkPCI(t *testing.T) {
|
||||||
foo, _ := ioutil.TempFile(os.TempDir(), "qemu-ciao-test")
|
foo, _ := ioutil.TempFile(os.TempDir(), "qemu-ciao-test")
|
||||||
|
Loading…
Reference in New Issue
Block a user