]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: reject unfiltered sgio on validation
authorJán Tomko <jtomko@redhat.com>
Thu, 13 Jan 2022 13:04:49 +0000 (14:04 +0100)
committerJán Tomko <jtomko@redhat.com>
Wed, 19 Jan 2022 12:57:59 +0000 (13:57 +0100)
No kernels supported by upstream libvirt have the feature.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/conf/domain_validate.c
tests/qemuxml2argvdata/disk-scsi-lun-passthrough-sgio.xml [deleted file]
tests/qemuxml2argvdata/hostdev-scsi-rawio.xml [deleted file]
tests/qemuxml2argvdata/hostdev-scsi-sgio.xml [deleted file]
tests/qemuxml2xmloutdata/disk-scsi-lun-passthrough-sgio.xml [deleted file]
tests/qemuxml2xmloutdata/hostdev-scsi-rawio.xml [deleted file]
tests/qemuxml2xmloutdata/hostdev-scsi-sgio.xml [deleted file]
tests/qemuxml2xmltest.c

index a4271f12479ff28d7b41bde81ef3a284e983ab4d..e9baf1d41a85d394aad2fe63d935dce333eab774 100644 (file)
@@ -621,6 +621,12 @@ virDomainDiskDefValidate(const virDomainDef *def,
     if (virDomainDiskDefValidateSource(disk->src) < 0)
         return -1;
 
+    if (disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("unfiltered sgio is no longer supported"));
+        return -1;
+    }
+
     /* Validate LUN configuration */
     if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
         if (virDomainDiskDefSourceLUNValidate(disk->src) < 0)
@@ -1917,6 +1923,11 @@ virDomainHostdevDefValidate(const virDomainHostdevDef *hostdev)
                                  "address type"));
                 return -1;
             }
+            if (hostdev->source.subsys.u.scsi.sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("unfiltered sgio is no longer supported"));
+                return -1;
+            }
             break;
         case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
             if (hostdev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
diff --git a/tests/qemuxml2argvdata/disk-scsi-lun-passthrough-sgio.xml b/tests/qemuxml2argvdata/disk-scsi-lun-passthrough-sgio.xml
deleted file mode 100644 (file)
index 3e56164..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<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-system-i386</emulator>
-    <disk type='block' device='lun' rawio='no' sgio='unfiltered'>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='hda' bus='scsi'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <disk type='block' device='lun' sgio='filtered'>
-      <source dev='/dev/HostVG/QEMUGuest2'/>
-      <target dev='hdb' bus='scsi'/>
-      <address type='drive' controller='0' bus='0' target='1' unit='1'/>
-    </disk>
-    <controller type='scsi' index='0' model='virtio-scsi'/>
-    <controller type='scsi' index='1' model='lsilogic'/>
-    <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/qemuxml2argvdata/hostdev-scsi-rawio.xml b/tests/qemuxml2argvdata/hostdev-scsi-rawio.xml
deleted file mode 100644 (file)
index eb60e55..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<domain type='qemu'>
-  <name>QEMUGuest2</name>
-  <uuid>c7a5fdbd-edaf-9466-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219100</memory>
-  <currentMemory unit='KiB'>219100</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-system-i386</emulator>
-    <disk type='block' device='disk'>
-      <source dev='/dev/HostVG/QEMUGuest2'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <controller type='scsi' index='0' model='virtio-scsi'/>
-    <controller type='usb' index='0'/>
-    <controller type='ide' index='0'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes' sgio='unfiltered' rawio='yes'>
-      <source>
-        <adapter name='scsi_host0'/>
-        <address bus='0' target='0' unit='0'/>
-      </source>
-      <address type='drive' controller='0' bus='0' target='4' unit='8'/>
-    </hostdev>
-    <memballoon model='virtio'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2argvdata/hostdev-scsi-sgio.xml b/tests/qemuxml2argvdata/hostdev-scsi-sgio.xml
deleted file mode 100644 (file)
index bfc5346..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<domain type='qemu'>
-  <name>QEMUGuest2</name>
-  <uuid>c7a5fdbd-edaf-9466-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219100</memory>
-  <currentMemory unit='KiB'>219100</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-system-i386</emulator>
-    <disk type='block' device='disk'>
-      <source dev='/dev/HostVG/QEMUGuest2'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <controller type='scsi' index='0' model='virtio-scsi'/>
-    <controller type='usb' index='0'/>
-    <controller type='ide' index='0'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes' sgio='unfiltered'>
-      <source>
-        <adapter name='scsi_host0'/>
-        <address bus='0' target='0' unit='0'/>
-      </source>
-      <address type='drive' controller='0' bus='0' target='4' unit='8'/>
-    </hostdev>
-    <memballoon model='virtio'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2xmloutdata/disk-scsi-lun-passthrough-sgio.xml b/tests/qemuxml2xmloutdata/disk-scsi-lun-passthrough-sgio.xml
deleted file mode 100644 (file)
index 2b62595..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<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-system-i386</emulator>
-    <disk type='block' device='lun' rawio='no' sgio='unfiltered'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='hda' bus='scsi'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <disk type='block' device='lun' sgio='filtered'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMUGuest2'/>
-      <target dev='hdb' bus='scsi'/>
-      <address type='drive' controller='0' bus='0' target='1' unit='1'/>
-    </disk>
-    <controller type='scsi' index='0' model='virtio-scsi'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
-    </controller>
-    <controller type='scsi' index='1' model='lsilogic'>
-      <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'/>
-    <audio id='1' type='none'/>
-    <memballoon model='virtio'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
-    </memballoon>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2xmloutdata/hostdev-scsi-rawio.xml b/tests/qemuxml2xmloutdata/hostdev-scsi-rawio.xml
deleted file mode 100644 (file)
index b9f3fc1..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<domain type='qemu'>
-  <name>QEMUGuest2</name>
-  <uuid>c7a5fdbd-edaf-9466-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219100</memory>
-  <currentMemory unit='KiB'>219100</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-system-i386</emulator>
-    <disk type='block' device='disk'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMUGuest2'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <controller type='scsi' index='0' model='virtio-scsi'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
-    </controller>
-    <controller type='usb' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
-    </controller>
-    <controller type='ide' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
-    </controller>
-    <controller type='pci' index='0' model='pci-root'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <audio id='1' type='none'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes' sgio='unfiltered' rawio='yes'>
-      <source>
-        <adapter name='scsi_host0'/>
-        <address bus='0' target='0' unit='0'/>
-      </source>
-      <address type='drive' controller='0' bus='0' target='4' unit='8'/>
-    </hostdev>
-    <memballoon model='virtio'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
-    </memballoon>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2xmloutdata/hostdev-scsi-sgio.xml b/tests/qemuxml2xmloutdata/hostdev-scsi-sgio.xml
deleted file mode 100644 (file)
index 748d5ac..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<domain type='qemu'>
-  <name>QEMUGuest2</name>
-  <uuid>c7a5fdbd-edaf-9466-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219100</memory>
-  <currentMemory unit='KiB'>219100</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-system-i386</emulator>
-    <disk type='block' device='disk'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMUGuest2'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <controller type='scsi' index='0' model='virtio-scsi'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
-    </controller>
-    <controller type='usb' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
-    </controller>
-    <controller type='ide' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
-    </controller>
-    <controller type='pci' index='0' model='pci-root'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <audio id='1' type='none'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes' sgio='unfiltered'>
-      <source>
-        <adapter name='scsi_host0'/>
-        <address bus='0' target='0' unit='0'/>
-      </source>
-      <address type='drive' controller='0' bus='0' target='4' unit='8'/>
-    </hostdev>
-    <memballoon model='virtio'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
-    </memballoon>
-  </devices>
-</domain>
index fb438269b94f132a9aa414358b75920af60ca7b6..68d74fa4f1d76a219bb7f37722ce8860e44aef3d 100644 (file)
@@ -617,11 +617,6 @@ mymain(void)
                  ARG_END);
     DO_TEST_NOCAPS("numad-static-vcpu-no-numatune");
 
-    DO_TEST("disk-scsi-lun-passthrough-sgio",
-            QEMU_CAPS_SCSI_LSI,
-            QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_SCSI_DISK_WWN,
-            QEMU_CAPS_SCSI_BLOCK);
     DO_TEST("disk-scsi-disk-vpd",
             QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_DISK_WWN);
     DO_TEST_NOCAPS("disk-source-pool");
@@ -1002,12 +997,6 @@ mymain(void)
     DO_TEST("hostdev-scsi-shareable",
             QEMU_CAPS_VIRTIO_SCSI,
             QEMU_CAPS_SCSI_LSI);
-    DO_TEST("hostdev-scsi-sgio",
-            QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_SCSI_LSI);
-    DO_TEST("hostdev-scsi-rawio",
-            QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_SCSI_LSI);
 
     DO_TEST("hostdev-scsi-autogen-address",
             QEMU_CAPS_VIRTIO_SCSI,