From f976d1b06c6d098fa95ce67d7a873d9768cdf78d Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 7 Mar 2025 17:37:26 +0100 Subject: [PATCH] conf: Drop support for 'sheepdog' disks 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 Reviewed-by: Pavel Hrdina Reviewed-by: Michal Privoznik --- src/conf/domain_validate.c | 7 +++ tests/qemusecuritytest.c | 1 - .../disk-network-sheepdog.x86_64-6.0.0.args | 39 ---------------- .../disk-network-sheepdog.x86_64-6.0.0.xml | 46 ------------------- .../disk-network-sheepdog.x86_64-latest.err | 1 + tests/qemuxmlconftest.c | 3 +- 6 files changed, 9 insertions(+), 88 deletions(-) delete mode 100644 tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-6.0.0.args delete mode 100644 tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-6.0.0.xml create mode 100644 tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-latest.err diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index ad3d17f0fd..5e2bbb1d9f 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -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; diff --git a/tests/qemusecuritytest.c b/tests/qemusecuritytest.c index 27eb101f8c..88c8617d69 100644 --- a/tests/qemusecuritytest.c +++ b/tests/qemusecuritytest.c @@ -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 index 664c47acf7..0000000000 --- a/tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-6.0.0.args +++ /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 index 3421293663..0000000000 --- a/tests/qemuxmlconfdata/disk-network-sheepdog.x86_64-6.0.0.xml +++ /dev/null @@ -1,46 +0,0 @@ - - QEMUGuest1 - c7a5fdbd-edaf-9455-926a-d65c16db1809 - 219136 - 219136 - 1 - - hvm - - - - qemu64 - - - destroy - restart - destroy - - /usr/bin/qemu-system-x86_64 - - - - -
- - - - - - - -
- - -
- - -
- - - - -