From c0804495117d79cce10812326727ba3055d16c84 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 27 Jun 2024 16:11:20 +0100 Subject: [PATCH] Remove gluster support Development on gluster has stopped upstream, see: https://marc.info/?l=fedora-devel-list&m=171934833215726&w=2 --- fish/guestfish.pod | 10 ------ fish/test-add-uri.sh | 4 --- generator/actions_core.ml | 8 ----- lib/drives.c | 36 ---------------------- lib/guestfs-internal.h | 4 --- lib/guestfs.pod | 21 +------------ lib/launch-libvirt.c | 4 --- lib/qemu.c | 15 --------- tests/Makefile.am | 3 -- tests/disks/test-qemu-drive-libvirt.sh | 7 ----- tests/disks/test-qemu-drive-libvirt.xml.in | 19 ------------ tests/disks/test-qemu-drive.sh | 10 ------ tests/regressions/rhbz1370424.sh | 34 -------------------- tests/regressions/rhbz1370424.xml | 28 ----------------- 14 files changed, 1 insertion(+), 202 deletions(-) delete mode 100755 tests/regressions/rhbz1370424.sh delete mode 100644 tests/regressions/rhbz1370424.xml diff --git a/fish/guestfish.pod b/fish/guestfish.pod index 492aa7163..9d4265f9a 100644 --- a/fish/guestfish.pod +++ b/fish/guestfish.pod @@ -1160,16 +1160,6 @@ The equivalent API command would be: > add /disk.img protocol:(ftp|...) server:tcp:example.com -=head2 B<-a gluster://example.com[:port]/volname/image> - -Add a disk image located on GlusterFS storage. - -The server is the one running C, and may be C. - -The equivalent API command would be: - - > add volname/image protocol:gluster server:tcp:example.com - =head2 B<-a iscsi://example.com[:port]/target-iqn-name[/lun]> Add a disk located on an iSCSI server. diff --git a/fish/test-add-uri.sh b/fish/test-add-uri.sh index 21d424984..1446e21f3 100755 --- a/fish/test-add-uri.sh +++ b/fish/test-add-uri.sh @@ -44,10 +44,6 @@ grep -sq 'add_drive ".*/test-add-uri.img"' test-add-uri.out || fail $VG guestfish -x -a ftp://user@example.com/disk.img test-add-uri.out 2>&1 grep -sq 'add_drive "/disk.img" "protocol:ftp" "server:tcp:example.com" "username:user"' test-add-uri.out || fail -# gluster -$VG guestfish -x -a gluster://example.com/disk test-add-uri.out 2>&1 -grep -sq 'add_drive "disk" "protocol:gluster" "server:tcp:example.com"' test-add-uri.out || fail - # NBD $VG guestfish -x -a nbd://example.com test-add-uri.out 2>&1 grep -sq 'add_drive "" "protocol:nbd" "server:tcp:example.com"' test-add-uri.out || fail diff --git a/generator/actions_core.ml b/generator/actions_core.ml index 21be4c123..877303dad 100644 --- a/generator/actions_core.ml +++ b/generator/actions_core.ml @@ -357,13 +357,6 @@ The C parameter must also be supplied - see below. See also: L -=item C - -Connect to the GlusterFS server. -The C parameter must also be supplied - see below. - -See also: L - =item C Connect to the iSCSI server. @@ -416,7 +409,6 @@ is a list of server(s). -------- -------------------------- file List must be empty or param not used at all ftp|ftps|http|https|tftp Exactly one - gluster Exactly one iscsi Exactly one nbd Exactly one rbd Zero or more diff --git a/lib/drives.c b/lib/drives.c index c5a208468..a3a2712b5 100644 --- a/lib/drives.c +++ b/lib/drives.c @@ -194,37 +194,6 @@ create_drive_curl (guestfs_h *g, return create_drive_non_file (g, data); } -static struct drive * -create_drive_gluster (guestfs_h *g, - const struct drive_create_data *data) -{ - if (data->username != NULL) { - error (g, _("gluster: you cannot specify a username with this protocol")); - return NULL; - } - if (data->secret != NULL) { - error (g, _("gluster: you cannot specify a secret with this protocol")); - return NULL; - } - - if (data->nr_servers != 1) { - error (g, _("gluster: you must specify exactly one server")); - return NULL; - } - - if (STREQ (data->exportname, "")) { - error (g, _("gluster: volume name parameter should not be an empty string")); - return NULL; - } - - if (data->exportname[0] == '/') { - error (g, _("gluster: volume/image must not begin with a '/'")); - return NULL; - } - - return create_drive_non_file (g, data); -} - static int nbd_port (void) { @@ -481,7 +450,6 @@ guestfs_int_drive_protocol_to_string (enum drive_protocol protocol) case drive_protocol_file: return "file"; case drive_protocol_ftp: return "ftp"; case drive_protocol_ftps: return "ftps"; - case drive_protocol_gluster: return "gluster"; case drive_protocol_http: return "http"; case drive_protocol_https: return "https"; case drive_protocol_iscsi: return "iscsi"; @@ -850,10 +818,6 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename, data.protocol = drive_protocol_ftps; drv = create_drive_curl (g, &data); } - else if (STREQ (protocol, "gluster")) { - data.protocol = drive_protocol_gluster; - drv = create_drive_gluster (g, &data); - } else if (STREQ (protocol, "http")) { data.protocol = drive_protocol_http; drv = create_drive_curl (g, &data); diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h index 9f4f800e6..7233af0f3 100644 --- a/lib/guestfs-internal.h +++ b/lib/guestfs-internal.h @@ -210,7 +210,6 @@ enum drive_protocol { drive_protocol_file, drive_protocol_ftp, drive_protocol_ftps, - drive_protocol_gluster, drive_protocol_http, drive_protocol_https, drive_protocol_iscsi, @@ -225,9 +224,6 @@ enum drive_transport { drive_transport_none = 0, /* no transport specified */ drive_transport_tcp, /* +tcp */ drive_transport_unix, /* +unix */ - /* XXX In theory gluster+rdma could be supported here, but - * I have no idea what gluster+rdma URLs would look like. - */ }; struct drive_server { diff --git a/lib/guestfs.pod b/lib/guestfs.pod index e46dd81f9..a28fd5a1a 100644 --- a/lib/guestfs.pod +++ b/lib/guestfs.pod @@ -748,26 +748,7 @@ L. =head3 GLUSTER -Libguestfs can access Gluster disks. - -To do this, set the optional C and C parameters of -L like this: - - char **servers = { "gluster.example.org:24007", NULL }; - guestfs_add_drive_opts (g, "volname/image", - GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", - GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "gluster", - GUESTFS_ADD_DRIVE_OPTS_SERVER, servers, - -1); - -C (the C parameter) is a list which must have a -single element. The single element is a string defining the Gluster -server. The format of this string is documented in -L. - -Note that gluster usually requires the client process (ie. libguestfs) -to run as B and will give unfathomable errors if it is not -(eg. "No data available"). +Glusterfs support was removed in libguestfs 1.54 (2024). =head3 ISCSI diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c index 04ac53672..c90ceb7f2 100644 --- a/lib/launch-libvirt.c +++ b/lib/launch-libvirt.c @@ -1537,8 +1537,6 @@ construct_libvirt_xml_disk (guestfs_h *g, * or: * */ - case drive_protocol_gluster: - protocol_str = "gluster"; goto network_protocols; case drive_protocol_iscsi: protocol_str = "iscsi"; goto network_protocols; case drive_protocol_nbd: @@ -2000,7 +1998,6 @@ add_secret (guestfs_h *g, virConnectPtr conn, case drive_protocol_file: case drive_protocol_ftp: case drive_protocol_ftps: - case drive_protocol_gluster: case drive_protocol_http: case drive_protocol_https: case drive_protocol_iscsi: @@ -2082,7 +2079,6 @@ find_secret (guestfs_h *g, case drive_protocol_file: case drive_protocol_ftp: case drive_protocol_ftps: - case drive_protocol_gluster: case drive_protocol_http: case drive_protocol_https: case drive_protocol_nbd: diff --git a/lib/qemu.c b/lib/qemu.c index 2d03a34fa..5800915b4 100644 --- a/lib/qemu.c +++ b/lib/qemu.c @@ -827,20 +827,6 @@ guestfs_int_drive_source_qemu_param (guestfs_h *g, return make_uri (g, "ftps", src->username, src->secret, &src->servers[0], src->u.exportname); - case drive_protocol_gluster: - switch (src->servers[0].transport) { - case drive_transport_none: - return make_uri (g, "gluster", NULL, NULL, - &src->servers[0], src->u.exportname); - case drive_transport_tcp: - return make_uri (g, "gluster+tcp", NULL, NULL, - &src->servers[0], src->u.exportname); - case drive_transport_unix: - return make_uri (g, "gluster+unix", NULL, NULL, - &src->servers[0], NULL); - } - break; - case drive_protocol_http: return make_uri (g, "http", src->username, src->secret, &src->servers[0], src->u.exportname); @@ -1023,7 +1009,6 @@ guestfs_int_discard_possible (guestfs_h *g, struct drive *drv, switch (drv->src.protocol) { /* Protocols which support discard. */ case drive_protocol_file: - case drive_protocol_gluster: case drive_protocol_iscsi: case drive_protocol_nbd: case drive_protocol_rbd: diff --git a/tests/Makefile.am b/tests/Makefile.am index b87d4ce21..52155f641 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -642,7 +642,6 @@ TESTS += \ regressions/rhbz1011907-1165785.sh \ regressions/rhbz1174551.sh \ regressions/rhbz1175196.sh \ - regressions/rhbz1370424.sh \ regressions/rhbz1477623.sh \ regressions/rhbz1930996.sh \ regressions/test-big-heap \ @@ -675,8 +674,6 @@ EXTRA_DIST += \ regressions/rhbz1091803.sh \ regressions/rhbz1174551.sh \ regressions/rhbz1175196.sh \ - regressions/rhbz1370424.sh \ - regressions/rhbz1370424.xml \ regressions/rhbz1477623.sh \ regressions/rhbz1930996.sh \ regressions/test-noexec-stack.pl diff --git a/tests/disks/test-qemu-drive-libvirt.sh b/tests/disks/test-qemu-drive-libvirt.sh index d86a1ecd0..a34644e1d 100755 --- a/tests/disks/test-qemu-drive-libvirt.sh +++ b/tests/disks/test-qemu-drive-libvirt.sh @@ -65,13 +65,6 @@ check_output grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail ceph2 rm "$DEBUG_QEMU_FILE" -# Gluster. - -$guestfish -d gluster run ||: -check_output -grep -sq -- '-drive file=gluster://1.2.3.4:1234/volname/image,' "$DEBUG_QEMU_FILE" || fail gluster -rm "$DEBUG_QEMU_FILE" - # iSCSI. $guestfish -d iscsi run ||: diff --git a/tests/disks/test-qemu-drive-libvirt.xml.in b/tests/disks/test-qemu-drive-libvirt.xml.in index e79946046..ded9fade1 100644 --- a/tests/disks/test-qemu-drive-libvirt.xml.in +++ b/tests/disks/test-qemu-drive-libvirt.xml.in @@ -59,25 +59,6 @@ - - 5 - gluster - 1048576 - - hvm - - - - - - - - - - - - - 5 iscsi diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh index 12937fb30..777ed3b26 100755 --- a/tests/disks/test-qemu-drive.sh +++ b/tests/disks/test-qemu-drive.sh @@ -72,16 +72,6 @@ check_output grep -sq -- '-drive file=http://www.example.com/disk.img,' "$DEBUG_QEMU_FILE" || fail rm "$DEBUG_QEMU_FILE" -# Gluster. - -guestfish < - - rhbz1370424 - 1048576 - 2 - - hvm - - - - - - - - - - - - - - - - -
- - - -