[PATCH RFC 0/5] storage: Drop the sheepdog storage driver backend

The sheepdog project is abandoned, with last commit in 2018. QEMU already removed the storage backend in qemu-6.1 This series removes the libvirt storage driver backend. This series is RFC as of: 1/5: I'm not 100% sure whether 'Obsoletes:' is the correct way to deprecate a subpackage in Fedora, but it certainly does the correct thing. 4/5: I personally don't mind that the build option will be kept to prevent breakage of builds, but I can see the value in dropping it and anyone building libvirt having to knowingly acknowledge that they don't need sheepdog any more. (This patch intentionally omits the S-o-b line as the commit message will need to be rewritten if it's going to be pushed) This series does _not_ remove the ability to use qemu-6.0 and older with sheepdog as the qemu driver bits are left untouched. Peter Krempa (5): spec: Drop libvirt-daemon-driver-storage-sheepdog package tests: Remove storage pool/vol tests for sheepdog Remove support for building the sheepdog storage driver backend build: Drop the 'storage_sheepdog' build option completely storage: Remove the sheepdog storage driver backend source code docs/formatstorage.rst | 6 +- docs/kbase/rpm-deployment.rst | 6 +- docs/storage.rst | 3 +- libvirt.spec.in | 38 +- meson.build | 11 - meson_options.txt | 1 - po/POTFILES | 1 - src/storage/meson.build | 25 -- src/storage/storage_backend.c | 6 - src/storage/storage_backend_sheepdog.c | 376 ------------------ src/storage/storage_backend_sheepdog.h | 25 -- src/storage/storage_backend_sheepdog_priv.h | 30 -- tests/meson.build | 6 - tests/storagebackendsheepdogtest.c | 205 ---------- tests/storagepoolxml2argvtest.c | 1 - tests/storagepoolxml2xmlin/pool-sheepdog.xml | 8 - tests/storagepoolxml2xmlout/pool-sheepdog.xml | 11 - tests/storagepoolxml2xmltest.c | 1 - tests/storagevolxml2xmlin/vol-sheepdog.xml | 10 - tests/storagevolxml2xmlout/vol-sheepdog.xml | 8 - tests/storagevolxml2xmltest.c | 1 - tools/virsh.c | 3 - 22 files changed, 12 insertions(+), 770 deletions(-) delete mode 100644 src/storage/storage_backend_sheepdog.c delete mode 100644 src/storage/storage_backend_sheepdog.h delete mode 100644 src/storage/storage_backend_sheepdog_priv.h delete mode 100644 tests/storagebackendsheepdogtest.c delete mode 100644 tests/storagepoolxml2xmlin/pool-sheepdog.xml delete mode 100644 tests/storagepoolxml2xmlout/pool-sheepdog.xml delete mode 100644 tests/storagevolxml2xmlin/vol-sheepdog.xml delete mode 100644 tests/storagevolxml2xmlout/vol-sheepdog.xml -- 2.37.1

Upstream will be dropping the sheepdog storage backend, so we need to stop building the package and obsolete it. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/kbase/rpm-deployment.rst | 6 +++++- libvirt.spec.in | 38 ++--------------------------------- 2 files changed, 7 insertions(+), 37 deletions(-) diff --git a/docs/kbase/rpm-deployment.rst b/docs/kbase/rpm-deployment.rst index 7b3bbfefe8..6415a9bc53 100644 --- a/docs/kbase/rpm-deployment.rst +++ b/docs/kbase/rpm-deployment.rst @@ -1,3 +1,5 @@ +.. role:: removed + ======================= RPM Deployment Guidance ======================= @@ -176,7 +178,9 @@ RPM packages * libvirt-daemon-driver-storage-sheepdog The dynamically loadable driver providing an implementation of the SheepDog - network storage pool type, for the storage pool management APIs. + network storage pool type, for the storage pool management APIs. This + sub-package was :removed:`removed in libvirt-8.7` as the sheepdog backend + driver was dropped from upstream. * libvirt-daemon-driver-storage-zfs diff --git a/libvirt.spec.in b/libvirt.spec.in index fe386bfef2..4066d5509b 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -61,11 +61,6 @@ # Then the secondary host drivers, which run inside libvirtd %define with_storage_rbd 0%{!?_without_storage_rbd:1} -%if 0%{?fedora} - %define with_storage_sheepdog 0%{!?_without_storage_sheepdog:1} -%else - %define with_storage_sheepdog 0 -%endif %define with_storage_gluster 0%{!?_without_storage_gluster:1} %if 0%{?rhel} @@ -339,9 +334,6 @@ BuildRequires: librbd-devel BuildRequires: glusterfs-api-devel >= 3.4.1 BuildRequires: glusterfs-devel >= 3.4.1 %endif -%if %{with_storage_sheepdog} -BuildRequires: sheepdog -%endif %if %{with_numactl} # For QEMU/LXC numa info BuildRequires: numactl-devel @@ -584,6 +576,7 @@ Requires: /usr/bin/qemu-img %if !%{with_storage_rbd} Obsoletes: libvirt-daemon-driver-storage-rbd < %{version}-%{release} %endif +Obsoletes: libvirt-daemon-driver-storage-sheepdog %description daemon-driver-storage-core The storage driver plugin for the libvirtd daemon, providing @@ -687,19 +680,6 @@ volumes using the ceph protocol. %endif -%if %{with_storage_sheepdog} -%package daemon-driver-storage-sheepdog -Summary: Storage driver plugin for sheepdog -Requires: libvirt-daemon-driver-storage-core = %{version}-%{release} -Requires: libvirt-libs = %{version}-%{release} -Requires: sheepdog - -%description daemon-driver-storage-sheepdog -The storage driver backend adding implementation of the storage APIs for -sheepdog volumes using. -%endif - - %if %{with_storage_zfs} %package daemon-driver-storage-zfs Summary: Storage driver plugin for ZFS @@ -732,9 +712,6 @@ Requires: libvirt-daemon-driver-storage-gluster = %{version}-%{release} %if %{with_storage_rbd} Requires: libvirt-daemon-driver-storage-rbd = %{version}-%{release} %endif -%if %{with_storage_sheepdog} -Requires: libvirt-daemon-driver-storage-sheepdog = %{version}-%{release} -%endif %if %{with_storage_zfs} Requires: libvirt-daemon-driver-storage-zfs = %{version}-%{release} %endif @@ -1074,12 +1051,6 @@ exit 1 %define arg_storage_rbd -Dstorage_rbd=disabled %endif -%if %{with_storage_sheepdog} - %define arg_storage_sheepdog -Dstorage_sheepdog=enabled -%else - %define arg_storage_sheepdog -Dstorage_sheepdog=disabled -%endif - %if %{with_storage_gluster} %define arg_storage_gluster -Dstorage_gluster=enabled -Dglusterfs=enabled %else @@ -1199,7 +1170,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) -Dstorage_disk=enabled \ -Dstorage_mpath=enabled \ %{?arg_storage_rbd} \ - %{?arg_storage_sheepdog} \ + -Dstorage_sheepdog=disabled \ %{?arg_storage_gluster} \ %{?arg_storage_zfs} \ -Dstorage_vstorage=disabled \ @@ -2027,11 +1998,6 @@ exit 0 %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_rbd.so %endif -%if %{with_storage_sheepdog} -%files daemon-driver-storage-sheepdog -%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_sheepdog.so -%endif - %if %{with_storage_zfs} %files daemon-driver-storage-zfs %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_zfs.so -- 2.37.1

The support for the sheepdog storage backend will be dropped in the upcoming patches. Remove all the relevant tests. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/meson.build | 6 - tests/storagebackendsheepdogtest.c | 205 ------------------ tests/storagepoolxml2argvtest.c | 1 - tests/storagepoolxml2xmlin/pool-sheepdog.xml | 8 - tests/storagepoolxml2xmlout/pool-sheepdog.xml | 11 - tests/storagepoolxml2xmltest.c | 1 - tests/storagevolxml2xmlin/vol-sheepdog.xml | 10 - tests/storagevolxml2xmlout/vol-sheepdog.xml | 8 - tests/storagevolxml2xmltest.c | 1 - 9 files changed, 251 deletions(-) delete mode 100644 tests/storagebackendsheepdogtest.c delete mode 100644 tests/storagepoolxml2xmlin/pool-sheepdog.xml delete mode 100644 tests/storagepoolxml2xmlout/pool-sheepdog.xml delete mode 100644 tests/storagevolxml2xmlin/vol-sheepdog.xml delete mode 100644 tests/storagevolxml2xmlout/vol-sheepdog.xml diff --git a/tests/meson.build b/tests/meson.build index d6b1bb2bf0..2556b71444 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -509,12 +509,6 @@ if conf.has('WITH_STORAGE_FS') ] endif -if conf.has('WITH_STORAGE_SHEEPDOG') - tests += [ - { 'name': 'storagebackendsheepdogtest', 'link_with': [ storage_driver_impl_lib, storage_backend_sheepdog_priv_lib ] }, - ] -endif - if conf.has('WITH_VBOX') tests += [ { 'name': 'vboxsnapshotxmltest', 'link_with': [ vbox_driver_impl ] }, diff --git a/tests/storagebackendsheepdogtest.c b/tests/storagebackendsheepdogtest.c deleted file mode 100644 index 8f27e40d46..0000000000 --- a/tests/storagebackendsheepdogtest.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * storagebackendsheepdogtest.c: storage backend for Sheepdog handling - * - * Copyright (C) 2014 Red Hat, Inc. - * Copyright (C) 2012 Sebastian Wiedenroth - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * <http://www.gnu.org/licenses/>. - */ - -#include <config.h> - -#include <unistd.h> - -#include <fcntl.h> - -#include "internal.h" -#include "testutils.h" -#define LIBVIRT_STORAGE_BACKEND_SHEEPDOG_PRIV_H_ALLOW -#include "storage/storage_backend_sheepdog_priv.h" - -#define VIR_FROM_THIS VIR_FROM_NONE - -typedef struct { - const char *output; - int expected_return; - uint64_t expected_capacity; - uint64_t expected_allocation; -} collie_test; - -struct testNodeInfoParserData { - collie_test data; - const char *poolxml; -}; - -struct testVDIListParserData { - collie_test data; - const char *poolxml; - const char *volxml; -}; - - -static int -test_node_info_parser(const void *opaque) -{ - const struct testNodeInfoParserData *data = opaque; - collie_test test = data->data; - g_autofree char *output = NULL; - g_autoptr(virStoragePoolDef) pool = NULL; - - if (!(pool = virStoragePoolDefParseFile(data->poolxml))) - return -1; - - output = g_strdup(test.output); - - if (virStorageBackendSheepdogParseNodeInfo(pool, output) != - test.expected_return) - return -1; - - if (test.expected_return) - return 0; - - if (pool->capacity == test.expected_capacity && - pool->allocation == test.expected_allocation) - return 0; - - return -1; -} - -static int -test_vdi_list_parser(const void *opaque) -{ - const struct testVDIListParserData *data = opaque; - collie_test test = data->data; - g_autofree char *output = NULL; - g_autoptr(virStoragePoolDef) pool = NULL; - g_autoptr(virStorageVolDef) vol = NULL; - - if (!(pool = virStoragePoolDefParseFile(data->poolxml))) - return -1; - - if (!(vol = virStorageVolDefParseFile(pool, data->volxml, 0))) - return -1; - - output = g_strdup(test.output); - - if (virStorageBackendSheepdogParseVdiList(vol, output) != - test.expected_return) - return -1; - - if (test.expected_return) - return 0; - - if (vol->target.capacity == test.expected_capacity && - vol->target.allocation == test.expected_allocation) - return 0; - - return -1; -} - - -static int -mymain(void) -{ - int ret = 0; - g_autofree char *poolxml = NULL; - g_autofree char *volxml = NULL; - - collie_test node_info_tests[] = { - {"", -1, 0, 0}, - {"Total 15245667872 117571104 0% 20972341\n", 0, 15245667872, 117571104}, - {"To", -1, 0, 0}, - {"asdf\nasdf", -1, 0, 0}, - {"Total ", -1, 0, 0}, - {"Total 1", -1, 0, 0}, - {"Total 1\n", -1, 0, 0}, - {"Total 1 ", -1, 0, 0}, - {"Total 1 2", -1, 0, 0}, - {"Total 1 2 ", -1, 0, 0}, - {"Total 1 2\n", 0, 1, 2}, - {"Total 1 2 \n", 0, 1, 2}, - {"Total a 2 \n", -1, 0, 0}, - {"Total 1 b \n", -1, 0, 0}, - {"Total a b \n", -1, 0, 0}, - {"stuff\nTotal 1 2 \n", 0, 1, 2}, - {"0 1 2 3\nTotal 1 2 \n", 0, 1, 2}, - {NULL, 0, 0, 0} - }; - - collie_test vdi_list_tests[] = { - {"", -1, 0, 0}, - {"= test 3 10 20 0 1336557216 7c2b27\n", 0, 10, 20}, - {"= test\\ with\\ spaces 3 10 20 0 1336557216 7c2b27\n", 0, 10, 20}, - {"= backslashattheend\\\\ 3 10 20 0 1336557216 7c2b27\n", 0, 10, 20}, - {"s test 1 10 20 0 1336556634 7c2b25\n= test 3 50 60 0 1336557216 7c2b27\n", 0, 50, 60}, - {"=", -1, 0, 0}, - {"= test", -1, 0, 0}, - {"= test ", -1, 0, 0}, - {"= test 1", -1, 0, 0}, - {"= test 1 ", -1, 0, 0}, - {"= test 1 2", -1, 0, 0}, - {"= test 1 2 ", -1, 0, 0}, - {"= test 1 2 3", -1, 0, 0}, - {NULL, 0, 0, 0} - }; - - collie_test *test = node_info_tests; - - poolxml = g_strdup_printf("%s/storagepoolxml2xmlin/pool-sheepdog.xml", - abs_srcdir); - - volxml = g_strdup_printf("%s/storagevolxml2xmlin/vol-sheepdog.xml", - abs_srcdir); - -#define DO_TEST_NODE(collie) \ - do { \ - struct testNodeInfoParserData data = { \ - .data = collie, \ - .poolxml = poolxml, \ - }; \ - if (virTestRun("node_info_parser", test_node_info_parser, \ - &data) < 0) \ - ret = -1; \ - } while (0) - - while (test->output != NULL) { - DO_TEST_NODE(*test); - ++test; - } - - -#define DO_TEST_VDI(collie) \ - do { \ - struct testVDIListParserData data = { \ - .data = collie, \ - .poolxml = poolxml, \ - .volxml = volxml, \ - }; \ - if (virTestRun("vdi_list_parser", test_vdi_list_parser, \ - &data) < 0) \ - ret = -1; \ - } while (0) - - test = vdi_list_tests; - - while (test->output != NULL) { - DO_TEST_VDI(*test); - ++test; - } - - return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; -} - -VIR_TEST_MAIN(mymain) diff --git a/tests/storagepoolxml2argvtest.c b/tests/storagepoolxml2argvtest.c index 487481b7ee..04ff45f98d 100644 --- a/tests/storagepoolxml2argvtest.c +++ b/tests/storagepoolxml2argvtest.c @@ -175,7 +175,6 @@ mymain(void) DO_TEST_FAIL("pool-mpath"); DO_TEST_FAIL("pool-iscsi-multiiqn"); DO_TEST_FAIL("pool-iscsi-vendor-product"); - DO_TEST_FAIL("pool-sheepdog"); DO_TEST_FAIL("pool-gluster"); DO_TEST_FAIL("pool-gluster-sub"); DO_TEST_FAIL("pool-scsi-type-scsi-host-stable"); diff --git a/tests/storagepoolxml2xmlin/pool-sheepdog.xml b/tests/storagepoolxml2xmlin/pool-sheepdog.xml deleted file mode 100644 index 49b6baf014..0000000000 --- a/tests/storagepoolxml2xmlin/pool-sheepdog.xml +++ /dev/null @@ -1,8 +0,0 @@ -<pool type='sheepdog'> - <source> - <name>sheepdog</name> - <host name='localhost' port='7000'/> - </source> - <uuid>65fcba04-5b13-bd93-cff3-52ce48e11ad7</uuid> - <name>sheepdog</name> -</pool> diff --git a/tests/storagepoolxml2xmlout/pool-sheepdog.xml b/tests/storagepoolxml2xmlout/pool-sheepdog.xml deleted file mode 100644 index 000c068677..0000000000 --- a/tests/storagepoolxml2xmlout/pool-sheepdog.xml +++ /dev/null @@ -1,11 +0,0 @@ -<pool type='sheepdog'> - <name>sheepdog</name> - <uuid>65fcba04-5b13-bd93-cff3-52ce48e11ad7</uuid> - <capacity unit='bytes'>0</capacity> - <allocation unit='bytes'>0</allocation> - <available unit='bytes'>0</available> - <source> - <host name='localhost' port='7000'/> - <name>sheepdog</name> - </source> -</pool> diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c index 2bad858033..76d6f54b33 100644 --- a/tests/storagepoolxml2xmltest.c +++ b/tests/storagepoolxml2xmltest.c @@ -86,7 +86,6 @@ mymain(void) DO_TEST("pool-mpath"); DO_TEST("pool-iscsi-multiiqn"); DO_TEST("pool-iscsi-vendor-product"); - DO_TEST("pool-sheepdog"); DO_TEST("pool-gluster"); DO_TEST("pool-gluster-sub"); DO_TEST("pool-scsi-type-scsi-host-stable"); diff --git a/tests/storagevolxml2xmlin/vol-sheepdog.xml b/tests/storagevolxml2xmlin/vol-sheepdog.xml deleted file mode 100644 index d6e920bb81..0000000000 --- a/tests/storagevolxml2xmlin/vol-sheepdog.xml +++ /dev/null @@ -1,10 +0,0 @@ -<volume type='network'> - <name>test2</name> - <source> - </source> - <capacity unit='bytes'>1024</capacity> - <allocation unit='bytes'>0</allocation> - <target> - <path>sheepdog:test2</path> - </target> -</volume> diff --git a/tests/storagevolxml2xmlout/vol-sheepdog.xml b/tests/storagevolxml2xmlout/vol-sheepdog.xml deleted file mode 100644 index 47fb8eb418..0000000000 --- a/tests/storagevolxml2xmlout/vol-sheepdog.xml +++ /dev/null @@ -1,8 +0,0 @@ -<volume type='network'> - <name>test2</name> - <capacity unit='bytes'>1024</capacity> - <allocation unit='bytes'>0</allocation> - <target> - <path>sheepdog:test2</path> - </target> -</volume> diff --git a/tests/storagevolxml2xmltest.c b/tests/storagevolxml2xmltest.c index 5d06821cd0..161cb7c6bc 100644 --- a/tests/storagevolxml2xmltest.c +++ b/tests/storagevolxml2xmltest.c @@ -92,7 +92,6 @@ mymain(void) DO_TEST("pool-disk", "vol-partition"); DO_TEST("pool-logical", "vol-logical"); DO_TEST("pool-logical", "vol-logical-backing"); - DO_TEST("pool-sheepdog", "vol-sheepdog"); DO_TEST("pool-gluster", "vol-gluster-dir"); DO_TEST("pool-gluster", "vol-gluster-dir-neg-uid"); DO_TEST_FULL("pool-dir", "vol-qcow2-nocapacity", -- 2.37.1

On 8/22/22 9:48 AM, Peter Krempa wrote:
The support for the sheepdog storage backend will be dropped in the upcoming patches. Remove all the relevant tests.
I happened to notice these the other day. Did you intend to keep them in? $ git grep -l sheepdog -- tests/qemuxml2argvdata/*.xml tests/qemuxml2argvdata/boot-dev+order.xml tests/qemuxml2argvdata/boot-order.xml tests/qemuxml2argvdata/disk-network-sheepdog.xml
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/meson.build | 6 - tests/storagebackendsheepdogtest.c | 205 ------------------ tests/storagepoolxml2argvtest.c | 1 - tests/storagepoolxml2xmlin/pool-sheepdog.xml | 8 - tests/storagepoolxml2xmlout/pool-sheepdog.xml | 11 - tests/storagepoolxml2xmltest.c | 1 - tests/storagevolxml2xmlin/vol-sheepdog.xml | 10 - tests/storagevolxml2xmlout/vol-sheepdog.xml | 8 - tests/storagevolxml2xmltest.c | 1 - 9 files changed, 251 deletions(-) delete mode 100644 tests/storagebackendsheepdogtest.c delete mode 100644 tests/storagepoolxml2xmlin/pool-sheepdog.xml delete mode 100644 tests/storagepoolxml2xmlout/pool-sheepdog.xml delete mode 100644 tests/storagevolxml2xmlin/vol-sheepdog.xml delete mode 100644 tests/storagevolxml2xmlout/vol-sheepdog.xml
diff --git a/tests/meson.build b/tests/meson.build index d6b1bb2bf0..2556b71444 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -509,12 +509,6 @@ if conf.has('WITH_STORAGE_FS') ] endif
-if conf.has('WITH_STORAGE_SHEEPDOG') - tests += [ - { 'name': 'storagebackendsheepdogtest', 'link_with': [ storage_driver_impl_lib, storage_backend_sheepdog_priv_lib ] }, - ] -endif - if conf.has('WITH_VBOX') tests += [ { 'name': 'vboxsnapshotxmltest', 'link_with': [ vbox_driver_impl ] }, diff --git a/tests/storagebackendsheepdogtest.c b/tests/storagebackendsheepdogtest.c deleted file mode 100644 index 8f27e40d46..0000000000 --- a/tests/storagebackendsheepdogtest.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * storagebackendsheepdogtest.c: storage backend for Sheepdog handling - * - * Copyright (C) 2014 Red Hat, Inc. - * Copyright (C) 2012 Sebastian Wiedenroth - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * <http://www.gnu.org/licenses/>. - */ - -#include <config.h> - -#include <unistd.h> - -#include <fcntl.h> - -#include "internal.h" -#include "testutils.h" -#define LIBVIRT_STORAGE_BACKEND_SHEEPDOG_PRIV_H_ALLOW -#include "storage/storage_backend_sheepdog_priv.h" - -#define VIR_FROM_THIS VIR_FROM_NONE - -typedef struct { - const char *output; - int expected_return; - uint64_t expected_capacity; - uint64_t expected_allocation; -} collie_test; - -struct testNodeInfoParserData { - collie_test data; - const char *poolxml; -}; - -struct testVDIListParserData { - collie_test data; - const char *poolxml; - const char *volxml; -}; - - -static int -test_node_info_parser(const void *opaque) -{ - const struct testNodeInfoParserData *data = opaque; - collie_test test = data->data; - g_autofree char *output = NULL; - g_autoptr(virStoragePoolDef) pool = NULL; - - if (!(pool = virStoragePoolDefParseFile(data->poolxml))) - return -1; - - output = g_strdup(test.output); - - if (virStorageBackendSheepdogParseNodeInfo(pool, output) != - test.expected_return) - return -1; - - if (test.expected_return) - return 0; - - if (pool->capacity == test.expected_capacity && - pool->allocation == test.expected_allocation) - return 0; - - return -1; -} - -static int -test_vdi_list_parser(const void *opaque) -{ - const struct testVDIListParserData *data = opaque; - collie_test test = data->data; - g_autofree char *output = NULL; - g_autoptr(virStoragePoolDef) pool = NULL; - g_autoptr(virStorageVolDef) vol = NULL; - - if (!(pool = virStoragePoolDefParseFile(data->poolxml))) - return -1; - - if (!(vol = virStorageVolDefParseFile(pool, data->volxml, 0))) - return -1; - - output = g_strdup(test.output); - - if (virStorageBackendSheepdogParseVdiList(vol, output) != - test.expected_return) - return -1; - - if (test.expected_return) - return 0; - - if (vol->target.capacity == test.expected_capacity && - vol->target.allocation == test.expected_allocation) - return 0; - - return -1; -} - - -static int -mymain(void) -{ - int ret = 0; - g_autofree char *poolxml = NULL; - g_autofree char *volxml = NULL; - - collie_test node_info_tests[] = { - {"", -1, 0, 0}, - {"Total 15245667872 117571104 0% 20972341\n", 0, 15245667872, 117571104}, - {"To", -1, 0, 0}, - {"asdf\nasdf", -1, 0, 0}, - {"Total ", -1, 0, 0}, - {"Total 1", -1, 0, 0}, - {"Total 1\n", -1, 0, 0}, - {"Total 1 ", -1, 0, 0}, - {"Total 1 2", -1, 0, 0}, - {"Total 1 2 ", -1, 0, 0}, - {"Total 1 2\n", 0, 1, 2}, - {"Total 1 2 \n", 0, 1, 2}, - {"Total a 2 \n", -1, 0, 0}, - {"Total 1 b \n", -1, 0, 0}, - {"Total a b \n", -1, 0, 0}, - {"stuff\nTotal 1 2 \n", 0, 1, 2}, - {"0 1 2 3\nTotal 1 2 \n", 0, 1, 2}, - {NULL, 0, 0, 0} - }; - - collie_test vdi_list_tests[] = { - {"", -1, 0, 0}, - {"= test 3 10 20 0 1336557216 7c2b27\n", 0, 10, 20}, - {"= test\\ with\\ spaces 3 10 20 0 1336557216 7c2b27\n", 0, 10, 20}, - {"= backslashattheend\\\\ 3 10 20 0 1336557216 7c2b27\n", 0, 10, 20}, - {"s test 1 10 20 0 1336556634 7c2b25\n= test 3 50 60 0 1336557216 7c2b27\n", 0, 50, 60}, - {"=", -1, 0, 0}, - {"= test", -1, 0, 0}, - {"= test ", -1, 0, 0}, - {"= test 1", -1, 0, 0}, - {"= test 1 ", -1, 0, 0}, - {"= test 1 2", -1, 0, 0}, - {"= test 1 2 ", -1, 0, 0}, - {"= test 1 2 3", -1, 0, 0}, - {NULL, 0, 0, 0} - }; - - collie_test *test = node_info_tests; - - poolxml = g_strdup_printf("%s/storagepoolxml2xmlin/pool-sheepdog.xml", - abs_srcdir); - - volxml = g_strdup_printf("%s/storagevolxml2xmlin/vol-sheepdog.xml", - abs_srcdir); - -#define DO_TEST_NODE(collie) \ - do { \ - struct testNodeInfoParserData data = { \ - .data = collie, \ - .poolxml = poolxml, \ - }; \ - if (virTestRun("node_info_parser", test_node_info_parser, \ - &data) < 0) \ - ret = -1; \ - } while (0) - - while (test->output != NULL) { - DO_TEST_NODE(*test); - ++test; - } - - -#define DO_TEST_VDI(collie) \ - do { \ - struct testVDIListParserData data = { \ - .data = collie, \ - .poolxml = poolxml, \ - .volxml = volxml, \ - }; \ - if (virTestRun("vdi_list_parser", test_vdi_list_parser, \ - &data) < 0) \ - ret = -1; \ - } while (0) - - test = vdi_list_tests; - - while (test->output != NULL) { - DO_TEST_VDI(*test); - ++test; - } - - return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; -} - -VIR_TEST_MAIN(mymain) diff --git a/tests/storagepoolxml2argvtest.c b/tests/storagepoolxml2argvtest.c index 487481b7ee..04ff45f98d 100644 --- a/tests/storagepoolxml2argvtest.c +++ b/tests/storagepoolxml2argvtest.c @@ -175,7 +175,6 @@ mymain(void) DO_TEST_FAIL("pool-mpath"); DO_TEST_FAIL("pool-iscsi-multiiqn"); DO_TEST_FAIL("pool-iscsi-vendor-product"); - DO_TEST_FAIL("pool-sheepdog"); DO_TEST_FAIL("pool-gluster"); DO_TEST_FAIL("pool-gluster-sub"); DO_TEST_FAIL("pool-scsi-type-scsi-host-stable"); diff --git a/tests/storagepoolxml2xmlin/pool-sheepdog.xml b/tests/storagepoolxml2xmlin/pool-sheepdog.xml deleted file mode 100644 index 49b6baf014..0000000000 --- a/tests/storagepoolxml2xmlin/pool-sheepdog.xml +++ /dev/null @@ -1,8 +0,0 @@ -<pool type='sheepdog'> - <source> - <name>sheepdog</name> - <host name='localhost' port='7000'/> - </source> - <uuid>65fcba04-5b13-bd93-cff3-52ce48e11ad7</uuid> - <name>sheepdog</name> -</pool> diff --git a/tests/storagepoolxml2xmlout/pool-sheepdog.xml b/tests/storagepoolxml2xmlout/pool-sheepdog.xml deleted file mode 100644 index 000c068677..0000000000 --- a/tests/storagepoolxml2xmlout/pool-sheepdog.xml +++ /dev/null @@ -1,11 +0,0 @@ -<pool type='sheepdog'> - <name>sheepdog</name> - <uuid>65fcba04-5b13-bd93-cff3-52ce48e11ad7</uuid> - <capacity unit='bytes'>0</capacity> - <allocation unit='bytes'>0</allocation> - <available unit='bytes'>0</available> - <source> - <host name='localhost' port='7000'/> - <name>sheepdog</name> - </source> -</pool> diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c index 2bad858033..76d6f54b33 100644 --- a/tests/storagepoolxml2xmltest.c +++ b/tests/storagepoolxml2xmltest.c @@ -86,7 +86,6 @@ mymain(void) DO_TEST("pool-mpath"); DO_TEST("pool-iscsi-multiiqn"); DO_TEST("pool-iscsi-vendor-product"); - DO_TEST("pool-sheepdog"); DO_TEST("pool-gluster"); DO_TEST("pool-gluster-sub"); DO_TEST("pool-scsi-type-scsi-host-stable"); diff --git a/tests/storagevolxml2xmlin/vol-sheepdog.xml b/tests/storagevolxml2xmlin/vol-sheepdog.xml deleted file mode 100644 index d6e920bb81..0000000000 --- a/tests/storagevolxml2xmlin/vol-sheepdog.xml +++ /dev/null @@ -1,10 +0,0 @@ -<volume type='network'> - <name>test2</name> - <source> - </source> - <capacity unit='bytes'>1024</capacity> - <allocation unit='bytes'>0</allocation> - <target> - <path>sheepdog:test2</path> - </target> -</volume> diff --git a/tests/storagevolxml2xmlout/vol-sheepdog.xml b/tests/storagevolxml2xmlout/vol-sheepdog.xml deleted file mode 100644 index 47fb8eb418..0000000000 --- a/tests/storagevolxml2xmlout/vol-sheepdog.xml +++ /dev/null @@ -1,8 +0,0 @@ -<volume type='network'> - <name>test2</name> - <capacity unit='bytes'>1024</capacity> - <allocation unit='bytes'>0</allocation> - <target> - <path>sheepdog:test2</path> - </target> -</volume> diff --git a/tests/storagevolxml2xmltest.c b/tests/storagevolxml2xmltest.c index 5d06821cd0..161cb7c6bc 100644 --- a/tests/storagevolxml2xmltest.c +++ b/tests/storagevolxml2xmltest.c @@ -92,7 +92,6 @@ mymain(void) DO_TEST("pool-disk", "vol-partition"); DO_TEST("pool-logical", "vol-logical"); DO_TEST("pool-logical", "vol-logical-backing"); - DO_TEST("pool-sheepdog", "vol-sheepdog"); DO_TEST("pool-gluster", "vol-gluster-dir"); DO_TEST("pool-gluster", "vol-gluster-dir-neg-uid"); DO_TEST_FULL("pool-dir", "vol-qcow2-nocapacity",

On Mon, Aug 22, 2022 at 10:52:03 -0500, Jonathon Jongsma wrote:
On 8/22/22 9:48 AM, Peter Krempa wrote:
The support for the sheepdog storage backend will be dropped in the upcoming patches. Remove all the relevant tests.
I happened to notice these the other day. Did you intend to keep them in?
$ git grep -l sheepdog -- tests/qemuxml2argvdata/*.xml tests/qemuxml2argvdata/boot-dev+order.xml tests/qemuxml2argvdata/boot-order.xml tests/qemuxml2argvdata/disk-network-sheepdog.xml
These tests are for the qemu driver's instantiation of sheepdog backed disks, which is orthogonal to libvirt's storage driver backend this series is removing. Specifically the sheepdog backend for disks was removed from qemu starting with qemu-6.1. Minimum qemu supported by libvirt is qemu-4.2, so there are releases which we support and thus it wouldn't be okay to remove that support and by extension the tests for it. Now for the individual test cases:
tests/qemuxml2argvdata/boot-dev+order.xml tests/qemuxml2argvdata/boot-order.xml
I'll strip the sheepdog disk from these two and use DO_TEST_CAPS_LATEST for them. Those tests are for configuring the boot order so a sheepdog disk there is not really relevant to the main use case.
tests/qemuxml2argvdata/disk-network-sheepdog.xml
This is already using DO_TEST_CAPS_VER and is locked to qemu-6.0 due to the above reason. This test can be removed once we bump minimum qemu to 6.1+.

The sheepdog project is unmaintained, with last commit in 2018 and numerous unanswered issues reported. Remove the libvirt storage driver support for it to follow the removal of the client support in qemu. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatstorage.rst | 6 ++++-- docs/storage.rst | 3 ++- meson.build | 9 +-------- meson_options.txt | 2 +- src/storage/meson.build | 25 ------------------------- src/storage/storage_backend.c | 6 ------ tools/virsh.c | 3 --- 7 files changed, 8 insertions(+), 46 deletions(-) diff --git a/docs/formatstorage.rst b/docs/formatstorage.rst index a8149e450c..97671efacf 100644 --- a/docs/formatstorage.rst +++ b/docs/formatstorage.rst @@ -1,4 +1,5 @@ .. role:: since +.. role:: removed ================================== Storage pool and volume XML format @@ -17,8 +18,9 @@ volume size, or placement. The top level tag for a storage pool document is 'pool'. It has a single attribute ``type``, which is one of ``dir``, ``fs``, ``netfs``, ``disk``, ``iscsi``, ``logical``, ``scsi`` (all :since:`since 0.4.1` ), ``mpath`` ( -:since:`since 0.7.1` ), ``rbd`` ( :since:`since 0.9.13` ), ``sheepdog`` ( -:since:`since 0.10.0` ), ``gluster`` ( :since:`since 1.2.0` ), ``zfs`` ( +:since:`since 0.7.1` ), ``rbd`` ( :since:`since 0.9.13` ), +``sheepdog`` (:since:`since 0.10.0`, :removed:`removed in 8.7.0` ), +``gluster`` ( :since:`since 1.2.0` ), ``zfs`` ( :since:`since 1.2.8` ), ``vstorage`` ( :since:`since 3.1.0` ), or ``iscsi-direct`` ( :since:`since 4.7.0` ). This corresponds to the storage backend drivers listed further along in this document. diff --git a/docs/storage.rst b/docs/storage.rst index 9d5b193e31..af4db256c0 100644 --- a/docs/storage.rst +++ b/docs/storage.rst @@ -1,4 +1,5 @@ .. role:: since +.. role:: removed ================== Storage Management @@ -575,7 +576,7 @@ Sheepdog pool This provides a pool based on a Sheepdog Cluster. Sheepdog is a distributed storage system for QEMU/KVM. It provides highly available block level storage volumes that can be attached to QEMU/KVM virtual machines. The cluster must -already be formatted. :since:`Since 0.9.13` +already be formatted. :since:`Introduced in 0.9.13` :removed:`removed in 8.7.0.` Example Sheepdog pool input ~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/meson.build b/meson.build index 0b3187ad88..abfae91ee9 100644 --- a/meson.build +++ b/meson.build @@ -1917,13 +1917,7 @@ if conf.has('WITH_LIBVIRTD') endif if not get_option('storage_sheepdog').disabled() - sheepdogcli_prog = find_program('dog', required: get_option('storage_sheepdog'), dirs: libvirt_sbin_path) - - if sheepdogcli_prog.found() - use_storage = true - conf.set('WITH_STORAGE_SHEEPDOG', 1) - conf.set_quoted('SHEEPDOGCLI', sheepdogcli_prog.path()) - endif + error('The sheepdog storage backend is no longer supported') endif if not get_option('storage_vstorage').disabled() @@ -2251,7 +2245,6 @@ storagedriver_summary = { 'mpath': conf.has('WITH_STORAGE_MPATH'), 'Disk': conf.has('WITH_STORAGE_DISK'), 'RBD': conf.has('WITH_STORAGE_RBD'), - 'Sheepdog': conf.has('WITH_STORAGE_SHEEPDOG'), 'Gluster': conf.has('WITH_STORAGE_GLUSTER'), 'ZFS': conf.has('WITH_STORAGE_ZFS'), 'Virtuozzo storage': conf.has('WITH_STORAGE_VSTORAGE'), diff --git a/meson_options.txt b/meson_options.txt index 5b43cdbd6b..00b6df8254 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -88,7 +88,7 @@ option('storage_lvm', type: 'feature', value: 'auto', description: 'LVM backend option('storage_mpath', type: 'feature', value: 'auto', description: 'mpath backend for the storage driver') option('storage_rbd', type: 'feature', value: 'auto', description: 'RADOS Block Device backend for the storage driver') option('storage_scsi', type: 'feature', value: 'auto', description: 'SCSI backend for the storage driver') -option('storage_sheepdog', type: 'feature', value: 'auto', description: 'Sheepdog backend for the storage driver') +option('storage_sheepdog', type: 'feature', value: 'disabled', description: 'option flag preserved for compatibility') option('storage_vstorage', type: 'feature', value: 'auto', description: 'Virtuozzo storage backend for the storage driver') option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend for the storage driver') diff --git a/src/storage/meson.build b/src/storage/meson.build index 26e7ff1a1a..a8b173db96 100644 --- a/src/storage/meson.build +++ b/src/storage/meson.build @@ -51,10 +51,6 @@ storage_backend_scsi_sources = [ 'storage_backend_scsi.c', ] -storage_backend_sheepdog_sources = [ - 'storage_backend_sheepdog.c', -] - storage_backend_vstorage_sources = [ 'storage_backend_vstorage.c', ] @@ -239,27 +235,6 @@ if conf.has('WITH_STORAGE_SCSI') } endif -if conf.has('WITH_STORAGE_SHEEPDOG') - storage_backend_sheepdog_priv_lib = static_library( - 'virt_storage_backend_sheepdog_priv', - storage_backend_sheepdog_sources, - dependencies: [ - src_dep, - ], - include_directories: [ - conf_inc_dir, - ], - ) - - virt_modules += { - 'name': 'virt_storage_backend_sheepdog', - 'link_whole': [ - storage_backend_sheepdog_priv_lib, - ], - 'install_dir': storage_backend_install_dir, - } -endif - if conf.has('WITH_STORAGE_VSTORAGE') virt_modules += { 'name': 'virt_storage_backend_vstorage', diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 3e7a5ae67d..d6e02a47a8 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -55,9 +55,6 @@ #if WITH_STORAGE_RBD # include "storage_backend_rbd.h" #endif -#if WITH_STORAGE_SHEEPDOG -# include "storage_backend_sheepdog.h" -#endif #if WITH_STORAGE_GLUSTER # include "storage_backend_gluster.h" #endif @@ -129,9 +126,6 @@ virStorageBackendDriversRegister(bool allbackends G_GNUC_UNUSED) #if WITH_STORAGE_RBD VIR_STORAGE_BACKEND_REGISTER(virStorageBackendRBDRegister, "rbd"); #endif -#if WITH_STORAGE_SHEEPDOG - VIR_STORAGE_BACKEND_REGISTER(virStorageBackendSheepdogRegister, "sheepdog"); -#endif #if WITH_STORAGE_GLUSTER VIR_STORAGE_BACKEND_REGISTER(virStorageBackendGlusterRegister, "gluster"); #endif diff --git a/tools/virsh.c b/tools/virsh.c index 4a4ceef4ec..b37d2ce12f 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -579,9 +579,6 @@ virshShowVersion(vshControl *ctl G_GNUC_UNUSED) #ifdef WITH_STORAGE_RBD vshPrint(ctl, " RBD"); #endif -#ifdef WITH_STORAGE_SHEEPDOG - vshPrint(ctl, " Sheepdog"); -#endif #ifdef WITH_STORAGE_GLUSTER vshPrint(ctl, " Gluster"); #endif -- 2.37.1

Currently the build option is accepted and unless explicitly enabled the build works just fine. In case it's desired we can completely remove the build option and then the packagers will need to stop passing them. --- libvirt.spec.in | 2 -- meson.build | 4 ---- meson_options.txt | 1 - 3 files changed, 7 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 4066d5509b..b199c624b8 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1170,7 +1170,6 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) -Dstorage_disk=enabled \ -Dstorage_mpath=enabled \ %{?arg_storage_rbd} \ - -Dstorage_sheepdog=disabled \ %{?arg_storage_gluster} \ %{?arg_storage_zfs} \ -Dstorage_vstorage=disabled \ @@ -1282,7 +1281,6 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) -Dstorage_mpath=disabled \ -Dstorage_rbd=disabled \ -Dstorage_scsi=disabled \ - -Dstorage_sheepdog=disabled \ -Dstorage_vstorage=disabled \ -Dstorage_zfs=disabled \ -Dsysctl_config=disabled \ diff --git a/meson.build b/meson.build index abfae91ee9..8d0debaaf4 100644 --- a/meson.build +++ b/meson.build @@ -1916,10 +1916,6 @@ if conf.has('WITH_LIBVIRTD') conf.set('WITH_STORAGE_SCSI', 1) endif - if not get_option('storage_sheepdog').disabled() - error('The sheepdog storage backend is no longer supported') - endif - if not get_option('storage_vstorage').disabled() vstorage_enable = true if host_machine.system() != 'linux' diff --git a/meson_options.txt b/meson_options.txt index 00b6df8254..861c5577d2 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -88,7 +88,6 @@ option('storage_lvm', type: 'feature', value: 'auto', description: 'LVM backend option('storage_mpath', type: 'feature', value: 'auto', description: 'mpath backend for the storage driver') option('storage_rbd', type: 'feature', value: 'auto', description: 'RADOS Block Device backend for the storage driver') option('storage_scsi', type: 'feature', value: 'auto', description: 'SCSI backend for the storage driver') -option('storage_sheepdog', type: 'feature', value: 'disabled', description: 'option flag preserved for compatibility') option('storage_vstorage', type: 'feature', value: 'auto', description: 'Virtuozzo storage backend for the storage driver') option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend for the storage driver') -- 2.37.1

On Mon, Aug 22, 2022 at 04:48:15PM +0200, Peter Krempa wrote:
Currently the build option is accepted and unless explicitly enabled the build works just fine.
In case it's desired we can completely remove the build option and then the packagers will need to stop passing them.
Yes, please delete this entirely. We have no requirement to preserve backcompat of build time flags, they are free to change/delete at any time, and this will highlight the death of the feature to OS distros.
--- libvirt.spec.in | 2 -- meson.build | 4 ---- meson_options.txt | 1 - 3 files changed, 7 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 4066d5509b..b199c624b8 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1170,7 +1170,6 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) -Dstorage_disk=enabled \ -Dstorage_mpath=enabled \ %{?arg_storage_rbd} \ - -Dstorage_sheepdog=disabled \ %{?arg_storage_gluster} \ %{?arg_storage_zfs} \ -Dstorage_vstorage=disabled \ @@ -1282,7 +1281,6 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec) -Dstorage_mpath=disabled \ -Dstorage_rbd=disabled \ -Dstorage_scsi=disabled \ - -Dstorage_sheepdog=disabled \ -Dstorage_vstorage=disabled \ -Dstorage_zfs=disabled \ -Dsysctl_config=disabled \ diff --git a/meson.build b/meson.build index abfae91ee9..8d0debaaf4 100644 --- a/meson.build +++ b/meson.build @@ -1916,10 +1916,6 @@ if conf.has('WITH_LIBVIRTD') conf.set('WITH_STORAGE_SCSI', 1) endif
- if not get_option('storage_sheepdog').disabled() - error('The sheepdog storage backend is no longer supported') - endif - if not get_option('storage_vstorage').disabled() vstorage_enable = true if host_machine.system() != 'linux' diff --git a/meson_options.txt b/meson_options.txt index 00b6df8254..861c5577d2 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -88,7 +88,6 @@ option('storage_lvm', type: 'feature', value: 'auto', description: 'LVM backend option('storage_mpath', type: 'feature', value: 'auto', description: 'mpath backend for the storage driver') option('storage_rbd', type: 'feature', value: 'auto', description: 'RADOS Block Device backend for the storage driver') option('storage_scsi', type: 'feature', value: 'auto', description: 'SCSI backend for the storage driver') -option('storage_sheepdog', type: 'feature', value: 'disabled', description: 'option flag preserved for compatibility') option('storage_vstorage', type: 'feature', value: 'auto', description: 'Virtuozzo storage backend for the storage driver') option('storage_zfs', type: 'feature', value: 'auto', description: 'ZFS backend for the storage driver')
-- 2.37.1
With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Remove the unused source code for the sheepdog storage backend. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- po/POTFILES | 1 - src/storage/storage_backend_sheepdog.c | 376 -------------------- src/storage/storage_backend_sheepdog.h | 25 -- src/storage/storage_backend_sheepdog_priv.h | 30 -- 4 files changed, 432 deletions(-) delete mode 100644 src/storage/storage_backend_sheepdog.c delete mode 100644 src/storage/storage_backend_sheepdog.h delete mode 100644 src/storage/storage_backend_sheepdog_priv.h diff --git a/po/POTFILES b/po/POTFILES index 9621efb0d3..c3a370f8cc 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -229,7 +229,6 @@ src/storage/storage_backend_logical.c src/storage/storage_backend_mpath.c src/storage/storage_backend_rbd.c src/storage/storage_backend_scsi.c -src/storage/storage_backend_sheepdog.c src/storage/storage_backend_vstorage.c src/storage/storage_backend_zfs.c src/storage/storage_driver.c diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c deleted file mode 100644 index 6490dfae52..0000000000 --- a/src/storage/storage_backend_sheepdog.c +++ /dev/null @@ -1,376 +0,0 @@ -/* - * storage_backend_sheepdog.c: storage backend for Sheepdog handling - * - * Copyright (C) 2013-2014 Red Hat, Inc. - * Copyright (C) 2012 Wido den Hollander - * Copyright (C) 2012 Frank Spijkerman - * Copyright (C) 2012 Sebastian Wiedenroth - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * <http://www.gnu.org/licenses/>. - */ - -#include <config.h> - -#include "virerror.h" -#include "storage_backend_sheepdog.h" -#define LIBVIRT_STORAGE_BACKEND_SHEEPDOG_PRIV_H_ALLOW -#include "storage_backend_sheepdog_priv.h" -#include "storage_conf.h" -#include "vircommand.h" -#include "viralloc.h" -#include "virstring.h" -#include "storage_util.h" - -#define VIR_FROM_THIS VIR_FROM_STORAGE - -static int virStorageBackendSheepdogRefreshVol(virStoragePoolObj *pool, - virStorageVolDef *vol); - -void virStorageBackendSheepdogAddHostArg(virCommand *cmd, - virStoragePoolObj *pool); - -int -virStorageBackendSheepdogParseNodeInfo(virStoragePoolDef *pool, - char *output) -{ - /* fields: - * node id/total, size, used, use%, [total vdi size] - * - * example output: - * 0 15245667872 117571104 0% - * Total 15245667872 117571104 0% 20972341 - */ - - const char *p, *next; - - pool->allocation = pool->capacity = pool->available = 0; - - p = output; - do { - char *end; - - if ((next = strchr(p, '\n'))) - ++next; - else - break; - - if (!STRPREFIX(p, "Total ")) - continue; - - p = p + 6; - - if (virStrToLong_ull(p, &end, 10, &pool->capacity) < 0) - break; - - if ((p = end + 1) > next) - break; - - if (virStrToLong_ull(p, &end, 10, &pool->allocation) < 0) - break; - - pool->available = pool->capacity - pool->allocation; - return 0; - - } while ((p = next)); - - return -1; -} - -void -virStorageBackendSheepdogAddHostArg(virCommand *cmd, - virStoragePoolObj *pool) -{ - virStoragePoolDef *def = virStoragePoolObjGetDef(pool); - const char *address = "localhost"; - int port = 7000; - if (def->source.nhost > 0) { - if (def->source.hosts[0].name != NULL) - address = def->source.hosts[0].name; - if (def->source.hosts[0].port) - port = def->source.hosts[0].port; - } - virCommandAddArg(cmd, "-a"); - virCommandAddArgFormat(cmd, "%s", address); - virCommandAddArg(cmd, "-p"); - virCommandAddArgFormat(cmd, "%d", port); -} - -static int -virStorageBackendSheepdogAddVolume(virStoragePoolObj *pool, const char *diskInfo) -{ - g_autoptr(virStorageVolDef) vol = NULL; - - if (diskInfo == NULL) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Missing disk info when adding volume")); - return -1; - } - - vol = g_new0(virStorageVolDef, 1); - - vol->name = g_strdup(diskInfo); - - vol->type = VIR_STORAGE_VOL_NETWORK; - - if (virStorageBackendSheepdogRefreshVol(pool, vol) < 0) - return -1; - - if (virStoragePoolObjAddVol(pool, vol) < 0) - return -1; - vol = NULL; - - return 0; -} - -static int -virStorageBackendSheepdogRefreshAllVol(virStoragePoolObj *pool) -{ - size_t i; - g_autofree char *output = NULL; - g_auto(GStrv) lines = NULL; - g_autoptr(virCommand) cmd = NULL; - - cmd = virCommandNewArgList(SHEEPDOGCLI, "vdi", "list", "-r", NULL); - virStorageBackendSheepdogAddHostArg(cmd, pool); - virCommandSetOutputBuffer(cmd, &output); - if (virCommandRun(cmd, NULL) < 0) - return -1; - - lines = g_strsplit(output, "\n", 0); - if (lines == NULL) - return -1; - - for (i = 0; lines[i]; i++) { - g_auto(GStrv) cells = NULL; - - cells = g_strsplit(lines[i], " ", 0); - - if (cells != NULL && cells[0] && cells[1]) { - if (virStorageBackendSheepdogAddVolume(pool, cells[1]) < 0) - return -1; - } - } - - return 0; -} - - -static int -virStorageBackendSheepdogRefreshPool(virStoragePoolObj *pool) -{ - g_autofree char *output = NULL; - g_autoptr(virCommand) cmd = NULL; - - cmd = virCommandNewArgList(SHEEPDOGCLI, "node", "info", "-r", NULL); - virStorageBackendSheepdogAddHostArg(cmd, pool); - virCommandSetOutputBuffer(cmd, &output); - if (virCommandRun(cmd, NULL) < 0) - return -1; - - if (virStorageBackendSheepdogParseNodeInfo(virStoragePoolObjGetDef(pool), - output) < 0) - return -1; - - return virStorageBackendSheepdogRefreshAllVol(pool); -} - - -static int -virStorageBackendSheepdogDeleteVol(virStoragePoolObj *pool, - virStorageVolDef *vol, - unsigned int flags) -{ - g_autoptr(virCommand) cmd = NULL; - - virCheckFlags(0, -1); - - cmd = virCommandNewArgList(SHEEPDOGCLI, "vdi", "delete", vol->name, NULL); - virStorageBackendSheepdogAddHostArg(cmd, pool); - return virCommandRun(cmd, NULL); -} - - -static int -virStorageBackendSheepdogCreateVol(virStoragePoolObj *pool, - virStorageVolDef *vol) -{ - virStoragePoolDef *def = virStoragePoolObjGetDef(pool); - - if (vol->target.encryption != NULL) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("storage pool does not support encrypted " - "volumes")); - return -1; - } - - vol->type = VIR_STORAGE_VOL_NETWORK; - - VIR_FREE(vol->key); - vol->key = g_strdup_printf("%s/%s", def->source.name, vol->name); - - VIR_FREE(vol->target.path); - vol->target.path = g_strdup(vol->name); - - return 0; -} - - -static int -virStorageBackendSheepdogBuildVol(virStoragePoolObj *pool, - virStorageVolDef *vol, - unsigned int flags) -{ - g_autoptr(virCommand) cmd = NULL; - - virCheckFlags(0, -1); - - if (!vol->target.capacity) { - virReportError(VIR_ERR_NO_SUPPORT, "%s", - _("volume capacity required for this pool")); - return -1; - } - - cmd = virCommandNewArgList(SHEEPDOGCLI, "vdi", "create", vol->name, NULL); - virCommandAddArgFormat(cmd, "%llu", vol->target.capacity); - virStorageBackendSheepdogAddHostArg(cmd, pool); - return virCommandRun(cmd, NULL); -} - - -int -virStorageBackendSheepdogParseVdiList(virStorageVolDef *vol, - char *output) -{ - /* fields: - * current/clone/snapshot, name, id, size, used, shared, creation time, vdi id, [tag] - * - * example output: - * s test 1 10 0 0 1336556634 7c2b25 - * s test 2 10 0 0 1336557203 7c2b26 - * = test 3 10 0 0 1336557216 7c2b27 - */ - - int id; - const char *p, *next; - - vol->target.allocation = vol->target.capacity = 0; - - p = output; - do { - char *end; - - if ((next = strchr(p, '\n'))) - ++next; - - /* ignore snapshots */ - if (*p != '=') - continue; - - /* skip space */ - if (p + 2 < next) - p += 2; - else - return -1; - - /* skip name */ - while (*p != '\0' && *p != ' ') { - if (*p == '\\') - ++p; - ++p; - } - - if (virStrToLong_i(p, &end, 10, &id) < 0) - return -1; - - p = end + 1; - - if (virStrToLong_ull(p, &end, 10, &vol->target.capacity) < 0) - return -1; - - p = end + 1; - - if (virStrToLong_ull(p, &end, 10, &vol->target.allocation) < 0) - return -1; - - return 0; - } while ((p = next)); - - return -1; -} - -static int -virStorageBackendSheepdogRefreshVol(virStoragePoolObj *pool, - virStorageVolDef *vol) -{ - char *output = NULL; - virStoragePoolDef *def = virStoragePoolObjGetDef(pool); - g_autoptr(virCommand) cmd = NULL; - - cmd = virCommandNewArgList(SHEEPDOGCLI, "vdi", "list", vol->name, "-r", NULL); - virStorageBackendSheepdogAddHostArg(cmd, pool); - virCommandSetOutputBuffer(cmd, &output); - if (virCommandRun(cmd, NULL) < 0) - return -1; - - if (virStorageBackendSheepdogParseVdiList(vol, output) < 0) - return -1; - - vol->type = VIR_STORAGE_VOL_NETWORK; - - VIR_FREE(vol->key); - vol->key = g_strdup_printf("%s/%s", def->source.name, vol->name); - - VIR_FREE(vol->target.path); - vol->target.path = g_strdup(vol->name); - - return 0; -} - - -static int -virStorageBackendSheepdogResizeVol(virStoragePoolObj *pool, - virStorageVolDef *vol, - unsigned long long capacity, - unsigned int flags) -{ - g_autoptr(virCommand) cmd = NULL; - - virCheckFlags(0, -1); - - cmd = virCommandNewArgList(SHEEPDOGCLI, "vdi", "resize", vol->name, NULL); - virCommandAddArgFormat(cmd, "%llu", capacity); - virStorageBackendSheepdogAddHostArg(cmd, pool); - return virCommandRun(cmd, NULL); -} - - - -virStorageBackend virStorageBackendSheepdog = { - .type = VIR_STORAGE_POOL_SHEEPDOG, - - .refreshPool = virStorageBackendSheepdogRefreshPool, - .createVol = virStorageBackendSheepdogCreateVol, - .buildVol = virStorageBackendSheepdogBuildVol, - .refreshVol = virStorageBackendSheepdogRefreshVol, - .deleteVol = virStorageBackendSheepdogDeleteVol, - .resizeVol = virStorageBackendSheepdogResizeVol, -}; - - -int -virStorageBackendSheepdogRegister(void) -{ - return virStorageBackendRegister(&virStorageBackendSheepdog); -} diff --git a/src/storage/storage_backend_sheepdog.h b/src/storage/storage_backend_sheepdog.h deleted file mode 100644 index e1fde6373b..0000000000 --- a/src/storage/storage_backend_sheepdog.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * storage_backend_sheepdog.h: storage backend for Sheepdog handling - * - * Copyright (C) 2012 Wido den Hollander - * Copyright (C) 2012 Frank Spijkerman - * Copyright (C) 2012 Sebastian Wiedenroth - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * <http://www.gnu.org/licenses/>. - */ - -#pragma once - -int virStorageBackendSheepdogRegister(void); diff --git a/src/storage/storage_backend_sheepdog_priv.h b/src/storage/storage_backend_sheepdog_priv.h deleted file mode 100644 index a8cadb5542..0000000000 --- a/src/storage/storage_backend_sheepdog_priv.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * storage_backend_sheepdog_priv.h: header for functions necessary in tests - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * <http://www.gnu.org/licenses/>. - */ - -#ifndef LIBVIRT_STORAGE_BACKEND_SHEEPDOG_PRIV_H_ALLOW -# error "storage_backend_sheepdog_priv.h may only be included by storage_backend_sheepdog.c or test suites" -#endif /* LIBVIRT_STORAGE_BACKEND_SHEEPDOG_PRIV_H_ALLOW */ - -#pragma once - -#include "conf/storage_conf.h" - -int virStorageBackendSheepdogParseNodeInfo(virStoragePoolDef *pool, - char *output); -int virStorageBackendSheepdogParseVdiList(virStorageVolDef *vol, - char *output); -- 2.37.1

On 8/22/22 16:48, Peter Krempa wrote:
The sheepdog project is abandoned, with last commit in 2018. QEMU already removed the storage backend in qemu-6.1
This series removes the libvirt storage driver backend.
To me it looks fine as it is. Reviewed-by: Claudio Fontana <cfontana@suse.de>
This series is RFC as of: 1/5: I'm not 100% sure whether 'Obsoletes:' is the correct way to deprecate a subpackage in Fedora, but it certainly does the correct thing.
4/5: I personally don't mind that the build option will be kept to prevent breakage of builds, but I can see the value in dropping it and anyone building libvirt having to knowingly acknowledge that they don't need sheepdog any more. (This patch intentionally omits the S-o-b line as the commit message will need to be rewritten if it's going to be pushed)
This series does _not_ remove the ability to use qemu-6.0 and older with sheepdog as the qemu driver bits are left untouched.
Peter Krempa (5): spec: Drop libvirt-daemon-driver-storage-sheepdog package tests: Remove storage pool/vol tests for sheepdog Remove support for building the sheepdog storage driver backend build: Drop the 'storage_sheepdog' build option completely storage: Remove the sheepdog storage driver backend source code
docs/formatstorage.rst | 6 +- docs/kbase/rpm-deployment.rst | 6 +- docs/storage.rst | 3 +- libvirt.spec.in | 38 +- meson.build | 11 - meson_options.txt | 1 - po/POTFILES | 1 - src/storage/meson.build | 25 -- src/storage/storage_backend.c | 6 - src/storage/storage_backend_sheepdog.c | 376 ------------------ src/storage/storage_backend_sheepdog.h | 25 -- src/storage/storage_backend_sheepdog_priv.h | 30 -- tests/meson.build | 6 - tests/storagebackendsheepdogtest.c | 205 ---------- tests/storagepoolxml2argvtest.c | 1 - tests/storagepoolxml2xmlin/pool-sheepdog.xml | 8 - tests/storagepoolxml2xmlout/pool-sheepdog.xml | 11 - tests/storagepoolxml2xmltest.c | 1 - tests/storagevolxml2xmlin/vol-sheepdog.xml | 10 - tests/storagevolxml2xmlout/vol-sheepdog.xml | 8 - tests/storagevolxml2xmltest.c | 1 - tools/virsh.c | 3 - 22 files changed, 12 insertions(+), 770 deletions(-) delete mode 100644 src/storage/storage_backend_sheepdog.c delete mode 100644 src/storage/storage_backend_sheepdog.h delete mode 100644 src/storage/storage_backend_sheepdog_priv.h delete mode 100644 tests/storagebackendsheepdogtest.c delete mode 100644 tests/storagepoolxml2xmlin/pool-sheepdog.xml delete mode 100644 tests/storagepoolxml2xmlout/pool-sheepdog.xml delete mode 100644 tests/storagevolxml2xmlin/vol-sheepdog.xml delete mode 100644 tests/storagevolxml2xmlout/vol-sheepdog.xml

On a Monday in 2022, Peter Krempa wrote:
The sheepdog project is abandoned, with last commit in 2018. QEMU already removed the storage backend in qemu-6.1
This series removes the libvirt storage driver backend.
This series is RFC as of: 1/5: I'm not 100% sure whether 'Obsoletes:' is the correct way to deprecate a subpackage in Fedora, but it certainly does the correct thing.
4/5: I personally don't mind that the build option will be kept to prevent breakage of builds, but I can see the value in dropping it and anyone building libvirt having to knowingly acknowledge that they don't need sheepdog any more. (This patch intentionally omits the S-o-b line as the commit message will need to be rewritten if it's going to be pushed)
This series does _not_ remove the ability to use qemu-6.0 and older with sheepdog as the qemu driver bits are left untouched.
Peter Krempa (5): spec: Drop libvirt-daemon-driver-storage-sheepdog package tests: Remove storage pool/vol tests for sheepdog Remove support for building the sheepdog storage driver backend build: Drop the 'storage_sheepdog' build option completely storage: Remove the sheepdog storage driver backend source code
docs/formatstorage.rst | 6 +- docs/kbase/rpm-deployment.rst | 6 +- docs/storage.rst | 3 +- libvirt.spec.in | 38 +- meson.build | 11 - meson_options.txt | 1 - po/POTFILES | 1 - src/storage/meson.build | 25 -- src/storage/storage_backend.c | 6 - src/storage/storage_backend_sheepdog.c | 376 ------------------ src/storage/storage_backend_sheepdog.h | 25 -- src/storage/storage_backend_sheepdog_priv.h | 30 -- tests/meson.build | 6 - tests/storagebackendsheepdogtest.c | 205 ---------- tests/storagepoolxml2argvtest.c | 1 - tests/storagepoolxml2xmlin/pool-sheepdog.xml | 8 - tests/storagepoolxml2xmlout/pool-sheepdog.xml | 11 - tests/storagepoolxml2xmltest.c | 1 - tests/storagevolxml2xmlin/vol-sheepdog.xml | 10 - tests/storagevolxml2xmlout/vol-sheepdog.xml | 8 - tests/storagevolxml2xmltest.c | 1 - tools/virsh.c | 3 - 22 files changed, 12 insertions(+), 770 deletions(-) delete mode 100644 src/storage/storage_backend_sheepdog.c delete mode 100644 src/storage/storage_backend_sheepdog.h delete mode 100644 src/storage/storage_backend_sheepdog_priv.h delete mode 100644 tests/storagebackendsheepdogtest.c delete mode 100644 tests/storagepoolxml2xmlin/pool-sheepdog.xml delete mode 100644 tests/storagepoolxml2xmlout/pool-sheepdog.xml delete mode 100644 tests/storagevolxml2xmlin/vol-sheepdog.xml delete mode 100644 tests/storagevolxml2xmlout/vol-sheepdog.xml
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (5)
-
Claudio Fontana
-
Daniel P. Berrangé
-
Jonathon Jongsma
-
Ján Tomko
-
Peter Krempa