qemu: Allow disable-modern option from QMP

For devices that actually support the option disable-modern, this
current commit provides a proper flag to the caller. This will allow
for better support when used in nested environment as virtio-pci
devices should rely on virtio 0.9 instead of 1.0 due to a bug in
KVM.

Fixes #80

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2018-12-04 14:03:03 -08:00
parent 908b6aab14
commit f9b31c0f80
2 changed files with 38 additions and 8 deletions

View File

@@ -528,7 +528,7 @@ func TestQMPNetPCIDeviceAdd(t *testing.T) {
cfg := QMPConfig{Logger: qmpTestLogger{}}
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
checkVersion(t, connectedCh)
err := q.ExecuteNetPCIDeviceAdd(context.Background(), "br0", "virtio-0", "02:42:ac:11:00:02", "0x7", "", "", 8)
err := q.ExecuteNetPCIDeviceAdd(context.Background(), "br0", "virtio-0", "02:42:ac:11:00:02", "0x7", "", "", 8, false)
if err != nil {
t.Fatalf("Unexpected error %v", err)
}
@@ -569,7 +569,7 @@ func TestQMPDeviceAdd(t *testing.T) {
blockdevID := fmt.Sprintf("drive_%s", volumeUUID)
devID := fmt.Sprintf("device_%s", volumeUUID)
err := q.ExecuteDeviceAdd(context.Background(), blockdevID, devID,
"virtio-blk-pci", "", "", true)
"virtio-blk-pci", "", "", true, false)
if err != nil {
t.Fatalf("Unexpected error %v", err)
}
@@ -594,7 +594,7 @@ func TestQMPSCSIDeviceAdd(t *testing.T) {
blockdevID := fmt.Sprintf("drive_%s", volumeUUID)
devID := fmt.Sprintf("device_%s", volumeUUID)
err := q.ExecuteSCSIDeviceAdd(context.Background(), blockdevID, devID,
"scsi-hd", "scsi0.0", "", 1, 2, true)
"scsi-hd", "scsi0.0", "", 1, 2, true, false)
if err != nil {
t.Fatalf("Unexpected error %v", err)
}
@@ -1012,7 +1012,7 @@ func TestQMPPCIDeviceAdd(t *testing.T) {
blockdevID := fmt.Sprintf("drive_%s", volumeUUID)
devID := fmt.Sprintf("device_%s", volumeUUID)
err := q.ExecutePCIDeviceAdd(context.Background(), blockdevID, devID,
"virtio-blk-pci", "0x1", "", "", true)
"virtio-blk-pci", "0x1", "", "", true, false)
if err != nil {
t.Fatalf("Unexpected error %v", err)
}