[PATCH] qemu: add support for LSI SAS1068 (aka MPT Fusion) SCSI controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This does nothing more than adding the new device and capability.
The device is present since QEMU 2.6.0.

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c                       |  2 +
 src/qemu/qemu_capabilities.h                       |  1 +
 src/qemu/qemu_command.c                            | 13 ++++++-
 .../qemuxml2argv-disk-scsi-mptsas1068.args         | 27 +++++++++++++
 .../qemuxml2argv-disk-scsi-mptsas1068.xml          | 36 ++++++++++++++++++
 tests/qemuxml2argvtest.c                           |  4 ++
 .../qemuxml2xmlout-disk-scsi-mptsas1068.xml        | 44 ++++++++++++++++++++++
 tests/qemuxml2xmltest.c                            |  4 ++
 8 files changed, 130 insertions(+), 1 deletion(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.xml
 create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-mptsas1068.xml

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 3099e34..2b953ea 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -314,6 +314,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
 
               "vserport-change-event", /* 210 */
               "virtio-balloon-pci.deflate-on-oom",
+              "mptsas1068",
     );
 
 
@@ -1567,6 +1568,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
     { "virtio-tablet-pci", QEMU_CAPS_VIRTIO_TABLET },
     { "virtio-input-host-device", QEMU_CAPS_VIRTIO_INPUT_HOST },
     { "virtio-input-host-pci", QEMU_CAPS_VIRTIO_INPUT_HOST },
+    { "mptsas1068", QEMU_CAPS_SCSI_MPTSAS1068 },
 };
 
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index e5353de..b73c529 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -343,6 +343,7 @@ typedef enum {
     QEMU_CAPS_VSERPORT_CHANGE, /* VSERPORT_CHANGE event */
     QEMU_CAPS_VIRTIO_BALLOON_AUTODEFLATE, /* virtio-balloon-{device,pci,ccw}.
                                            * deflate-on-oom */
+    QEMU_CAPS_SCSI_MPTSAS1068, /* -device mptsas1068 */
 
     QEMU_CAPS_LAST /* this must always be the last item */
 } virQEMUCapsFlags;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index d7f19f3..4d4d65e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -872,11 +872,19 @@ qemuSetSCSIControllerModel(virDomainDefPtr def,
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI:
             /*TODO: need checking work here if necessary */
             break;
+        case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068:
+            if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_MPTSAS1068)) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("This QEMU doesn't support "
+                                 "the LSI SAS1068 (MPT Fusion) controller"));
+                return -1;
+            }
+            break;
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1078:
             if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SCSI_MEGASAS)) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                _("This QEMU doesn't support "
-                                 "the LSI SAS1078 controller"));
+                                 "the LSI SAS1078 (MegaRAID) controller"));
                 return -1;
             }
             break;
@@ -4753,6 +4761,9 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI:
             virBufferAddLit(&buf, "spapr-vscsi");
             break;
+        case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068:
+            virBufferAddLit(&buf, "mptsas1068");
+            break;
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1078:
             virBufferAddLit(&buf, "megasas");
             break;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args
new file mode 100644
index 0000000..bdfc1af
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.args
@@ -0,0 +1,27 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu \
+-name QEMUGuest1 \
+-S \
+-M pc \
+-m 214 \
+-smp 1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-nodefconfig \
+-nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
+-boot c \
+-device mptsas1068,id=scsi0,bus=pci.0,addr=0x3 \
+-usb \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-drive file=/tmp/scsidisk.img,format=raw,if=none,id=drive-scsi0-0-4-0 \
+-device scsi-disk,bus=scsi0.0,channel=0,scsi-id=4,lun=0,drive=drive-scsi0-0-4-0,\
+id=scsi0-0-4-0,wwn=0x5000c50015ea71ac \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.xml
new file mode 100644
index 0000000..b817b69
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-mptsas1068.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='file' device='disk'>
+      <source file='/tmp/scsidisk.img'/>
+      <target dev='sda' bus='scsi'/>
+      <address type='drive' controller='0' bus='0' target='4' unit='0'/>
+      <wwn>5000c50015ea71ac</wwn>
+    </disk>
+    <controller type='ide' index='0'/>
+    <controller type='scsi' index='0' model='lsisas1068'/>
+    <controller type='usb' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='virtio'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 3c7693b..b5d92c4 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -865,6 +865,10 @@ mymain(void)
     DO_TEST("disk-scsi-megasas",
             QEMU_CAPS_NODEFCONFIG,
             QEMU_CAPS_SCSI_MEGASAS);
+    DO_TEST("disk-scsi-mptsas1068",
+            QEMU_CAPS_NODEFCONFIG,
+            QEMU_CAPS_SCSI_MPTSAS1068,
+            QEMU_CAPS_SCSI_DISK_WWN);
     DO_TEST("disk-sata-device",
             QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_ICH9_AHCI);
     DO_TEST("disk-aio",
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-mptsas1068.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-mptsas1068.xml
new file mode 100644
index 0000000..a88b63a
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-mptsas1068.xml
@@ -0,0 +1,44 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='i686' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu</emulator>
+    <disk type='block' device='disk'>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='file' device='disk'>
+      <source file='/tmp/scsidisk.img'/>
+      <target dev='sda' bus='scsi'/>
+      <wwn>5000c50015ea71ac</wwn>
+      <address type='drive' controller='0' bus='0' target='4' unit='0'/>
+    </disk>
+    <controller type='ide' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+    </controller>
+    <controller type='scsi' index='0' model='lsisas1068'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </controller>
+    <controller type='usb' index='0'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+    </controller>
+    <controller type='pci' index='0' model='pci-root'/>
+    <input type='mouse' bus='ps2'/>
+    <input type='keyboard' bus='ps2'/>
+    <memballoon model='virtio'>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+    </memballoon>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index d9550cc..d7d10f6 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -415,6 +415,10 @@ mymain(void)
     DO_TEST_FULL("disk-scsi-megasas", WHEN_ACTIVE,
                  QEMU_CAPS_NODEFCONFIG,
                  QEMU_CAPS_SCSI_MEGASAS);
+    DO_TEST_FULL("disk-scsi-mptsas1068", WHEN_ACTIVE,
+                 QEMU_CAPS_NODEFCONFIG,
+                 QEMU_CAPS_SCSI_MPTSAS1068,
+                 QEMU_CAPS_SCSI_DISK_WWN);
     DO_TEST("disk-mirror-old");
     DO_TEST_FULL("disk-mirror", WHEN_ACTIVE, NONE);
     DO_TEST_FULL("disk-mirror", WHEN_INACTIVE, NONE);
-- 
2.5.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]