]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Drop support for 'sheepdog' disks
authorPeter Krempa <pkrempa@redhat.com>
Fri, 7 Mar 2025 16:37:26 +0000 (17:37 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 10 Mar 2025 12:09:27 +0000 (13:09 +0100)
In upcoming patches we'll update minimum supported qemu version to
qemu-6.2 which no longer supports 'sheepdog'. This was the only
hypervisor driver that supported it.

Reject any config containing sheepdog disks when validating the XML,
remove the positive test cases in qemu and replace them by a negative
test case. This will still excercise the XML schema, but will prepare
for removal of the internal code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_validate.c
tests/qemusecuritytest.c
tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-6.0.0.args [deleted file]
tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-6.0.0.xml [deleted file]
tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-latest.err [new file with mode: 0644]
tests/qemuxmlconftest.c

index ad3d17f0fd13cd3a325c2dd4a83fcdda7e355357..5e2bbb1d9fd2d2a9f8bf1349eeaa4a059018aa60 100644 (file)
@@ -476,6 +476,13 @@ virDomainDiskDefValidateSourceChainOne(const virStorageSource *src)
 {
     virStorageType actualType = virStorageSourceGetActualType(src);
 
+    if (virStorageSourceGetActualType(src) == VIR_STORAGE_TYPE_NETWORK &&
+        src->protocol == VIR_STORAGE_NET_PROTOCOL_SHEEPDOG) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("'sheepdog' protocol is no longer supported by any hypervisor driver"));
+        return -1;
+    }
+
     if (src->type == VIR_STORAGE_TYPE_NETWORK && src->auth) {
         virStorageAuthDef *authdef = src->auth;
         int actUsage;
index 27eb101f8ceb93202f39c1d16f972f090859fe88..88c8617d69378e70a1859ce448eee4131662d0cd 100644 (file)
@@ -219,7 +219,6 @@ mymain(void)
     DO_TEST_DOMAIN("disk-network-iscsi");
     DO_TEST_DOMAIN("disk-network-nbd");
     DO_TEST_DOMAIN("disk-network-rbd");
-    DO_TEST_DOMAIN("disk-network-sheepdog");
     DO_TEST_DOMAIN("disk-network-source-auth");
     DO_TEST_DOMAIN("disk-network-tlsx509-nbd");
     DO_TEST_DOMAIN("disk-readonly-disk");
diff --git a/tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-6.0.0.args b/tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-6.0.0.args
deleted file mode 100644 (file)
index 664c47a..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
-/usr/bin/qemu-system-x86_64 \
--name guest=QEMUGuest1,debug-threads=on \
--S \
--object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
--machine pc-i440fx-6.0,usb=off,dump-guest-core=off,memory-backend=pc.ram \
--accel tcg \
--cpu qemu64 \
--m size=219136k \
--object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
--overcommit mem-lock=off \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--boot strict=on \
--device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
--blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMU,Guest,,1","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw","file":"libvirt-2-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-2-format,id=ide0-0-0,bootindex=1 \
--blockdev '{"driver":"sheepdog","server":{"type":"inet","host":"example.org","port":"6000"},"vdi":"image,with,commas","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
--device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0 \
--audiodev '{"id":"audio1","driver":"none"}' \
--sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
--msg timestamp=on
diff --git a/tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-6.0.0.xml b/tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-6.0.0.xml
deleted file mode 100644 (file)
index 3421293..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='x86_64' machine='pc-i440fx-6.0'>hvm</type>
-    <boot dev='hd'/>
-  </os>
-  <cpu mode='custom' match='exact' check='none'>
-    <model fallback='forbid'>qemu64</model>
-  </cpu>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>destroy</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <disk type='block' device='disk'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMU,Guest,,1'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <disk type='network' device='disk'>
-      <driver name='qemu' type='raw'/>
-      <source protocol='sheepdog' name='image,with,commas'>
-        <host name='example.org' port='6000'/>
-      </source>
-      <target dev='vda' bus='virtio'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
-    </disk>
-    <controller type='usb' index='0' model='piix3-uhci'>
-      <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'/>
-    <memballoon model='none'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-latest.err b/tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-latest.err
new file mode 100644 (file)
index 0000000..401ff58
--- /dev/null
@@ -0,0 +1 @@
+unsupported configuration: 'sheepdog' protocol is no longer supported by any hypervisor driver
index e7f7e35f46842e5c478509f37c62971709ebf9c1..c6f89d46e63c7bbe8c1be162e14d8c91312f26db 100644 (file)
@@ -1591,8 +1591,7 @@ mymain(void)
     DO_TEST_CAPS_LATEST("disk-network-rbd-encryption-luks-any");
     DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-encryption-wrong");
     DO_TEST_CAPS_LATEST("disk-network-rbd-no-colon");
-    /* qemu-6.0 is the last qemu version supporting sheepdog */
-    DO_TEST_CAPS_VER("disk-network-sheepdog", "6.0.0");
+    DO_TEST_CAPS_LATEST_PARSE_ERROR("disk-network-sheepdog");
     DO_TEST_CAPS_LATEST("disk-network-source-auth");
     DO_TEST_CAPS_LATEST("disk-network-source-curl");
     DO_TEST_CAPS_LATEST("disk-network-nfs");