Blame SOURCES/0010-RHEL-Disable-unsupported-remote-drive-protocols-RHBZ.patch

2729bd
From 010cd5ff441166c01125fc588398a1fb8367a852 Mon Sep 17 00:00:00 2001
a7e38b
From: "Richard W.M. Jones" <rjones@redhat.com>
a7e38b
Date: Mon, 29 Jul 2013 14:47:56 +0100
a7e38b
Subject: [PATCH] RHEL: Disable unsupported remote drive protocols
a7e38b
 (RHBZ#962113).
a7e38b
a7e38b
This disables support for unsupported remote drive protocols:
a7e38b
a7e38b
 * ftp
a7e38b
 * ftps
a7e38b
 * http
a7e38b
 * https
a7e38b
 * tftp
a7e38b
 * gluster
a7e38b
 * iscsi
a7e38b
 * sheepdog
a7e38b
 * ssh
a7e38b
a7e38b
Note 'nbd' is not disabled, and of course 'file' works.
a7e38b
a7e38b
We hope to gradually add some of these back over the lifetime of RHEL.
a7e38b
---
a7e38b
 docs/guestfs-testing.pod               |  20 -----
a7e38b
 fish/guestfish.pod                     |  66 ++--------------
a7e38b
 fish/test-add-uri.sh                   |  32 --------
a7e38b
 generator/actions_core.ml              |  50 +------------
a7e38b
 lib/drives.c                           |   8 ++
a7e38b
 lib/guestfs.pod                        | 100 -------------------------
a7e38b
 tests/disks/test-qemu-drive-libvirt.sh |  28 -------
a7e38b
 tests/disks/test-qemu-drive.sh         |  60 ---------------
a7e38b
 8 files changed, 16 insertions(+), 348 deletions(-)
a7e38b
a7e38b
diff --git a/docs/guestfs-testing.pod b/docs/guestfs-testing.pod
a7e38b
index f558964bf..8f264ed17 100644
a7e38b
--- a/docs/guestfs-testing.pod
a7e38b
+++ b/docs/guestfs-testing.pod
a7e38b
@@ -109,26 +109,6 @@ image.  To exit, type C<exit>.
a7e38b
 If you get an error, try enabling debugging (add C<-v> to the command
a7e38b
 line).  Also make sure that L<libguestfs-test-tool(1)> succeeds.
a7e38b
 
a7e38b
-=head2 Try to open a remote guest image with guestfish.
a7e38b
-
a7e38b
-You may also have to disable libvirt by setting this:
a7e38b
-
a7e38b
- export LIBGUESTFS_BACKEND=direct
a7e38b
-
a7e38b
-If you have a disk image available over HTTP/FTP, try to open it.
a7e38b
-
a7e38b
- guestfish --ro -i --format=raw -a http://www.example.com/disk.img
a7e38b
-
a7e38b
-For SSH you will need to make sure that ssh-agent is set up so you
a7e38b
-don't need a password to log in to the remote machine.  Then a command
a7e38b
-similar to this should work:
a7e38b
-
a7e38b
- guestfish --ro -i --format=raw \
a7e38b
-   -a ssh://remote.example.com/path/to/disk.img
a7e38b
-
a7e38b
-If you get an error, try enabling debugging (add C<-v> to the command
a7e38b
-line).  Also make sure that L<libguestfs-test-tool(1)> succeeds.
a7e38b
-
a7e38b
 =head2 Run virt-alignment-scan on all your guests.
a7e38b
 
a7e38b
 Run L<virt-alignment-scan(1)> on guests or disk images:
a7e38b
diff --git a/fish/guestfish.pod b/fish/guestfish.pod
2729bd
index ae2445571..46cba64ff 100644
a7e38b
--- a/fish/guestfish.pod
a7e38b
+++ b/fish/guestfish.pod
a7e38b
@@ -131,9 +131,9 @@ To list what is available do:
a7e38b
 
a7e38b
 =head2 Remote drives
a7e38b
 
a7e38b
-Access a remote disk using ssh:
a7e38b
+Access a remote disk using NBD:
a7e38b
 
a7e38b
- guestfish -a ssh://example.com/path/to/disk.img
a7e38b
+ guestfish -a nbd://example.com
a7e38b
 
a7e38b
 =head2 Remote control
a7e38b
 
2729bd
@@ -1129,12 +1129,12 @@ L<guestfs(3)/REMOTE STORAGE>>.
a7e38b
 On the command line, you can use the I<-a> option to add network
a7e38b
 block devices using a URI-style format, for example:
a7e38b
 
a7e38b
- guestfish -a ssh://root@example.com/disk.img
a7e38b
+ guestfish -a nbd://example.com
a7e38b
 
a7e38b
 URIs I<cannot> be used with the L</add> command.  The equivalent
a7e38b
 command using the API directly is:
a7e38b
 
a7e38b
- ><fs> add /disk.img protocol:ssh server:tcp:example.com username:root
a7e38b
+ ><fs> add /disk.img protocol:nbd server:tcp:example.com
a7e38b
 
a7e38b
 The possible I<-a URI> formats are described below.
a7e38b
 
2729bd
@@ -1144,40 +1144,6 @@ The possible I<-a URI> formats are described below.
a7e38b
 
a7e38b
 Add the local disk image (or device) called F<disk.img>.
a7e38b
 
a7e38b
-=head2 B<-a ftp://[user@]example.com[:port]/disk.img>
a7e38b
-
a7e38b
-=head2 B<-a ftps://[user@]example.com[:port]/disk.img>
a7e38b
-
a7e38b
-=head2 B<-a http://[user@]example.com[:port]/disk.img>
a7e38b
-
a7e38b
-=head2 B<-a https://[user@]example.com[:port]/disk.img>
a7e38b
-
a7e38b
-=head2 B<-a tftp://[user@]example.com[:port]/disk.img>
a7e38b
-
a7e38b
-Add a disk located on a remote FTP, HTTP or TFTP server.
a7e38b
-
a7e38b
-The equivalent API command would be:
a7e38b
-
a7e38b
- ><fs> add /disk.img protocol:(ftp|...) server:tcp:example.com
a7e38b
-
a7e38b
-=head2 B<-a gluster://example.com[:port]/volname/image>
a7e38b
-
a7e38b
-Add a disk image located on GlusterFS storage.
a7e38b
-
a7e38b
-The server is the one running C<glusterd>, and may be C<localhost>.
a7e38b
-
a7e38b
-The equivalent API command would be:
a7e38b
-
a7e38b
- ><fs> add volname/image protocol:gluster server:tcp:example.com
a7e38b
-
a7e38b
-=head2 B<-a iscsi://example.com[:port]/target-iqn-name[/lun]>
a7e38b
-
a7e38b
-Add a disk located on an iSCSI server.
a7e38b
-
a7e38b
-The equivalent API command would be:
a7e38b
-
a7e38b
- ><fs> add target-iqn-name/lun protocol:iscsi server:tcp:example.com
a7e38b
-
a7e38b
 =head2 B<-a nbd://example.com[:port]>
a7e38b
 
a7e38b
 =head2 B<-a nbd://example.com[:port]/exportname>
2729bd
@@ -1212,35 +1178,13 @@ The equivalent API command would be:
a7e38b
 
a7e38b
  ><fs> add pool/disk protocol:rbd server:tcp:example.com:port
a7e38b
 
a7e38b
-=head2 B<-a sheepdog://[example.com[:port]]/volume/image>
a7e38b
-
a7e38b
-Add a disk image located on a Sheepdog volume.
a7e38b
-
a7e38b
-The server name is optional.  Although libguestfs and Sheepdog
a7e38b
-supports multiple servers, only at most one server can be specified
a7e38b
-when using this URI syntax.
a7e38b
-
a7e38b
-The equivalent API command would be:
a7e38b
-
a7e38b
- ><fs> add volume protocol:sheepdog [server:tcp:example.com]
a7e38b
-
a7e38b
-=head2 B<-a ssh://[user@]example.com[:port]/disk.img>
a7e38b
-
a7e38b
-Add a disk image located on a remote server, accessed using the Secure
a7e38b
-Shell (ssh) SFTP protocol.  SFTP is supported out of the box by all
a7e38b
-major SSH servers.
a7e38b
-
a7e38b
-The equivalent API command would be:
a7e38b
-
a7e38b
- ><fs> add /disk protocol:ssh server:tcp:example.com [username:user]
a7e38b
-
a7e38b
 Note that the URIs follow the syntax of
a7e38b
 L<RFC 3986|https://tools.ietf.org/html/rfc3986>: in particular, there
a7e38b
 are restrictions on the allowed characters for the various components
a7e38b
 of the URI.  Characters such as C<:>, C<@>, and C B<must> be
a7e38b
 percent-encoded:
a7e38b
 
a7e38b
- $ guestfish -a ssh://user:pass%40word@example.com/disk.img
a7e38b
+ $ guestfish -a rbd://user:pass%40word@example.com[:port]/pool/disk
a7e38b
 
a7e38b
 In this case, the password is C<pass@word>.
a7e38b
 
a7e38b
diff --git a/fish/test-add-uri.sh b/fish/test-add-uri.sh
a7e38b
index 21d424984..ddabeb639 100755
a7e38b
--- a/fish/test-add-uri.sh
a7e38b
+++ b/fish/test-add-uri.sh
a7e38b
@@ -40,14 +40,6 @@ function fail ()
a7e38b
 $VG guestfish -x -a file://$abs_builddir/test-add-uri.img </dev/null >test-add-uri.out 2>&1
a7e38b
 grep -sq 'add_drive ".*/test-add-uri.img"' test-add-uri.out || fail
a7e38b
 
a7e38b
-# curl
a7e38b
-$VG guestfish -x -a ftp://user@example.com/disk.img </dev/null >test-add-uri.out 2>&1
a7e38b
-grep -sq 'add_drive "/disk.img" "protocol:ftp" "server:tcp:example.com" "username:user"' test-add-uri.out || fail
a7e38b
-
a7e38b
-# gluster
a7e38b
-$VG guestfish -x -a gluster://example.com/disk </dev/null >test-add-uri.out 2>&1
a7e38b
-grep -sq 'add_drive "disk" "protocol:gluster" "server:tcp:example.com"' test-add-uri.out || fail
a7e38b
-
a7e38b
 # NBD
a7e38b
 $VG guestfish -x -a nbd://example.com </dev/null >test-add-uri.out 2>&1
a7e38b
 grep -sq 'add_drive "" "protocol:nbd" "server:tcp:example.com"' test-add-uri.out || fail
a7e38b
@@ -67,29 +59,5 @@ grep -sq 'add_drive "pool/disk" "protocol:rbd" "server:tcp:example.com:6789"' te
a7e38b
 $VG guestfish -x -a rbd:///pool/disk </dev/null >test-add-uri.out 2>&1
a7e38b
 grep -sq 'add_drive "pool/disk" "protocol:rbd"' test-add-uri.out || fail
a7e38b
 
a7e38b
-# sheepdog
a7e38b
-$VG guestfish -x -a sheepdog:///volume/image </dev/null >test-add-uri.out 2>&1
a7e38b
-grep -sq 'add_drive "volume/image" "protocol:sheepdog"' test-add-uri.out || fail
a7e38b
-
a7e38b
-$VG guestfish -x -a sheepdog://example.com:3000/volume/image </dev/null >test-add-uri.out 2>&1
a7e38b
-grep -sq 'add_drive "volume/image" "protocol:sheepdog" "server:tcp:example.com:3000"' test-add-uri.out || fail
a7e38b
-
a7e38b
-# ssh
a7e38b
-$VG guestfish -x -a ssh://example.com/disk.img </dev/null >test-add-uri.out 2>&1
a7e38b
-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com"' test-add-uri.out || fail
a7e38b
-
a7e38b
-$VG guestfish -x -a ssh://user@example.com/disk.img </dev/null >test-add-uri.out 2>&1
a7e38b
-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com" "username:user"' test-add-uri.out || fail
a7e38b
-
a7e38b
-$VG guestfish -x -a ssh://user@example.com:2000/disk.img </dev/null >test-add-uri.out 2>&1
a7e38b
-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com:2000" "username:user"' test-add-uri.out || fail
a7e38b
-
a7e38b
-# iSCSI
a7e38b
-$VG guestfish -x -a iscsi://example.com/iqn.2015-12.com.libguestfs:test1/0 </dev/null >test-add-uri.out 2>&1
a7e38b
-grep -sq 'add_drive "iqn.2015-12.com.libguestfs:test1/0" "protocol:iscsi" "server:tcp:example.com"' test-add-uri.out || fail
a7e38b
-
a7e38b
-$VG guestfish -x -a iscsi://user:password@example.com/iqn.2015-12.com.libguestfs:test2/0 </dev/null >test-add-uri.out 2>&1
a7e38b
-grep -sq 'add_drive "iqn.2015-12.com.libguestfs:test2/0" "protocol:iscsi" "server:tcp:example.com" "username:user" "secret:password"' test-add-uri.out || fail
a7e38b
-
a7e38b
 rm test-add-uri.out
a7e38b
 rm test-add-uri.img
a7e38b
diff --git a/generator/actions_core.ml b/generator/actions_core.ml
2729bd
index 807150615..6cd42a290 100644
a7e38b
--- a/generator/actions_core.ml
a7e38b
+++ b/generator/actions_core.ml
2729bd
@@ -350,29 +350,6 @@ F<filename> is interpreted as a local file or device.
a7e38b
 This is the default if the optional protocol parameter
a7e38b
 is omitted.
a7e38b
 
a7e38b
-=item C<protocol = \"ftp\"|\"ftps\"|\"http\"|\"https\"|\"tftp\">
a7e38b
-
a7e38b
-Connect to a remote FTP, HTTP or TFTP server.
a7e38b
-The C<server> parameter must also be supplied - see below.
a7e38b
-
a7e38b
-See also: L<guestfs(3)/FTP, HTTP AND TFTP>
a7e38b
-
a7e38b
-=item C<protocol = \"gluster\">
a7e38b
-
a7e38b
-Connect to the GlusterFS server.
a7e38b
-The C<server> parameter must also be supplied - see below.
a7e38b
-
a7e38b
-See also: L<guestfs(3)/GLUSTER>
a7e38b
-
a7e38b
-=item C<protocol = \"iscsi\">
a7e38b
-
a7e38b
-Connect to the iSCSI server.
a7e38b
-The C<server> parameter must also be supplied - see below.
a7e38b
-The C<username> parameter may be supplied.  See below.
a7e38b
-The C<secret> parameter may be supplied.  See below.
a7e38b
-
a7e38b
-See also: L<guestfs(3)/ISCSI>.
a7e38b
-
a7e38b
 =item C<protocol = \"nbd\">
a7e38b
 
a7e38b
 Connect to the Network Block Device server.
2729bd
@@ -389,22 +366,6 @@ The C<secret> parameter may be supplied.  See below.
a7e38b
 
a7e38b
 See also: L<guestfs(3)/CEPH>.
a7e38b
 
a7e38b
-=item C<protocol = \"sheepdog\">
a7e38b
-
a7e38b
-Connect to the Sheepdog server.
a7e38b
-The C<server> parameter may also be supplied - see below.
a7e38b
-
a7e38b
-See also: L<guestfs(3)/SHEEPDOG>.
a7e38b
-
a7e38b
-=item C<protocol = \"ssh\">
a7e38b
-
a7e38b
-Connect to the Secure Shell (ssh) server.
a7e38b
-
a7e38b
-The C<server> parameter must be supplied.
a7e38b
-The C<username> parameter may be supplied.  See below.
a7e38b
-
a7e38b
-See also: L<guestfs(3)/SSH>.
a7e38b
-
a7e38b
 =back
a7e38b
 
a7e38b
 =item C<server>
2729bd
@@ -415,13 +376,8 @@ is a list of server(s).
a7e38b
  Protocol       Number of servers required
a7e38b
  --------       --------------------------
a7e38b
  file           List must be empty or param not used at all
a7e38b
- ftp|ftps|http|https|tftp  Exactly one
a7e38b
- gluster        Exactly one
a7e38b
- iscsi          Exactly one
a7e38b
  nbd            Exactly one
a7e38b
  rbd            Zero or more
a7e38b
- sheepdog       Zero or more
a7e38b
- ssh            Exactly one
a7e38b
 
a7e38b
 Each list element is a string specifying a server.  The string must be
a7e38b
 in one of the following formats:
2729bd
@@ -437,10 +393,10 @@ for the protocol is used (see F</etc/services>).
a7e38b
 
a7e38b
 =item C<username>
a7e38b
 
a7e38b
-For the C<ftp>, C<ftps>, C<http>, C<https>, C<iscsi>, C<rbd>, C<ssh>
a7e38b
-and C<tftp> protocols, this specifies the remote username.
a7e38b
+For the C<rbd>
a7e38b
+protocol, this specifies the remote username.
a7e38b
 
a7e38b
-If not given, then the local username is used for C<ssh>, and no authentication
a7e38b
+If not given, then no authentication
a7e38b
 is attempted for ceph.  But note this sometimes may give unexpected results, for
a7e38b
 example if using the libvirt backend and if the libvirt backend is configured to
a7e38b
 start the qemu appliance as a special user such as C<qemu.qemu>.  If in doubt,
a7e38b
diff --git a/lib/drives.c b/lib/drives.c
2729bd
index c5a208468..efb289254 100644
a7e38b
--- a/lib/drives.c
a7e38b
+++ b/lib/drives.c
2729bd
@@ -166,6 +166,7 @@ create_drive_non_file (guestfs_h *g,
a7e38b
   return drv;
a7e38b
 }
a7e38b
 
a7e38b
+#if 0 /* DISABLED IN RHEL 8 */
a7e38b
 static struct drive *
a7e38b
 create_drive_curl (guestfs_h *g,
a7e38b
                    const struct drive_create_data *data)
2729bd
@@ -224,6 +225,7 @@ create_drive_gluster (guestfs_h *g,
a7e38b
 
a7e38b
   return create_drive_non_file (g, data);
a7e38b
 }
a7e38b
+#endif /* DISABLED IN RHEL 8 */
a7e38b
 
a7e38b
 static int
a7e38b
 nbd_port (void)
2729bd
@@ -292,6 +294,7 @@ create_drive_rbd (guestfs_h *g,
a7e38b
   return create_drive_non_file (g, data);
a7e38b
 }
a7e38b
 
a7e38b
+#if 0 /* DISABLED IN RHEL 8 */
a7e38b
 static struct drive *
a7e38b
 create_drive_sheepdog (guestfs_h *g,
a7e38b
                        const struct drive_create_data *data)
2729bd
@@ -392,6 +395,7 @@ create_drive_iscsi (guestfs_h *g,
a7e38b
 
a7e38b
   return create_drive_non_file (g, data);
a7e38b
 }
a7e38b
+#endif /* DISABLED IN RHEL 8 */
a7e38b
 
a7e38b
 /**
a7e38b
  * Create the special F</dev/null> drive.
2729bd
@@ -842,6 +846,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
a7e38b
       drv = create_drive_file (g, &data);
a7e38b
     }
a7e38b
   }
a7e38b
+#if 0 /* DISABLED IN RHEL 8 */
a7e38b
   else if (STREQ (protocol, "ftp")) {
a7e38b
     data.protocol = drive_protocol_ftp;
a7e38b
     drv = create_drive_curl (g, &data);
2729bd
@@ -866,6 +871,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
a7e38b
     data.protocol = drive_protocol_iscsi;
a7e38b
     drv = create_drive_iscsi (g, &data);
a7e38b
   }
a7e38b
+#endif /* DISABLED IN RHEL 8 */
a7e38b
   else if (STREQ (protocol, "nbd")) {
a7e38b
     data.protocol = drive_protocol_nbd;
a7e38b
     drv = create_drive_nbd (g, &data);
2729bd
@@ -874,6 +880,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
a7e38b
     data.protocol = drive_protocol_rbd;
a7e38b
     drv = create_drive_rbd (g, &data);
a7e38b
   }
a7e38b
+#if 0 /* DISABLED IN RHEL 8 */
a7e38b
   else if (STREQ (protocol, "sheepdog")) {
a7e38b
     data.protocol = drive_protocol_sheepdog;
a7e38b
     drv = create_drive_sheepdog (g, &data);
2729bd
@@ -886,6 +893,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
a7e38b
     data.protocol = drive_protocol_tftp;
a7e38b
     drv = create_drive_curl (g, &data);
a7e38b
   }
a7e38b
+#endif /* DISABLED IN RHEL 8 */
a7e38b
   else {
a7e38b
     error (g, _("unknown protocol ‘%s’"), protocol);
a7e38b
     drv = NULL; /*FALLTHROUGH*/
a7e38b
diff --git a/lib/guestfs.pod b/lib/guestfs.pod
2729bd
index 1ad44e7c2..946ce2d36 100644
a7e38b
--- a/lib/guestfs.pod
a7e38b
+++ b/lib/guestfs.pod
2729bd
@@ -712,70 +712,6 @@ a qcow2 backing file specification, libvirt does not construct an
2729bd
 ephemeral secret object from those, for Ceph authentication.  Refer to
2729bd
 L<https://bugzilla.redhat.com/2033247>.
a7e38b
 
a7e38b
-=head3 FTP, HTTP AND TFTP
a7e38b
-
a7e38b
-Libguestfs can access remote disks over FTP, FTPS, HTTP, HTTPS
a7e38b
-or TFTP protocols.
a7e38b
-
a7e38b
-To do this, set the optional C<protocol> and C<server> parameters of
a7e38b
-L</guestfs_add_drive_opts> like this:
a7e38b
-
a7e38b
- char **servers = { "www.example.org", NULL };
a7e38b
- guestfs_add_drive_opts (g, "/disk.img",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "http",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_SERVER, servers,
a7e38b
-                         -1);
a7e38b
-
a7e38b
-The C<protocol> can be one of C<"ftp">, C<"ftps">, C<"http">,
a7e38b
-C<"https"> or C<"tftp">.
a7e38b
-
a7e38b
-C<servers> (the C<server> parameter) is a list which must have a
a7e38b
-single element.  The single element is a string defining the web,
a7e38b
-FTP or TFTP server.  The format of this string is documented in
a7e38b
-L</guestfs_add_drive_opts>.
a7e38b
-
a7e38b
-=head3 GLUSTER
a7e38b
-
a7e38b
-Libguestfs can access Gluster disks.
a7e38b
-
a7e38b
-To do this, set the optional C<protocol> and C<server> parameters of
a7e38b
-L</guestfs_add_drive_opts> like this:
a7e38b
-
a7e38b
- char **servers = { "gluster.example.org:24007", NULL };
a7e38b
- guestfs_add_drive_opts (g, "volname/image",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "gluster",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_SERVER, servers,
a7e38b
-                         -1);
a7e38b
-
a7e38b
-C<servers> (the C<server> parameter) is a list which must have a
a7e38b
-single element.  The single element is a string defining the Gluster
a7e38b
-server.  The format of this string is documented in
a7e38b
-L</guestfs_add_drive_opts>.
a7e38b
-
a7e38b
-Note that gluster usually requires the client process (ie. libguestfs)
a7e38b
-to run as B<root> and will give unfathomable errors if it is not
a7e38b
-(eg. "No data available").
a7e38b
-
a7e38b
-=head3 ISCSI
a7e38b
-
a7e38b
-Libguestfs can access iSCSI disks remotely.
a7e38b
-
a7e38b
-To do this, set the optional C<protocol> and C<server> parameters like
a7e38b
-this:
a7e38b
-
a7e38b
- char **server = { "iscsi.example.org:3000", NULL };
a7e38b
- guestfs_add_drive_opts (g, "target-iqn-name/lun",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "iscsi",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_SERVER, server,
a7e38b
-                         -1);
a7e38b
-
a7e38b
-The C<server> parameter is a list which must have a single element.
a7e38b
-The single element is a string defining the iSCSI server.  The format
a7e38b
-of this string is documented in L</guestfs_add_drive_opts>.
a7e38b
-
a7e38b
 =head3 NETWORK BLOCK DEVICE
a7e38b
 
a7e38b
 Libguestfs can access Network Block Device (NBD) disks remotely.
2729bd
@@ -838,42 +774,6 @@ L<https://bugs.launchpad.net/qemu/+bug/1155677>
a7e38b
 
a7e38b
 =back
a7e38b
 
a7e38b
-=head3 SHEEPDOG
a7e38b
-
a7e38b
-Libguestfs can access Sheepdog disks.
a7e38b
-
a7e38b
-To do this, set the optional C<protocol> and C<server> parameters of
a7e38b
-L</guestfs_add_drive_opts> like this:
a7e38b
-
a7e38b
- char **servers = { /* optional servers ... */ NULL };
a7e38b
- guestfs_add_drive_opts (g, "volume",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "sheepdog",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_SERVER, servers,
a7e38b
-                         -1);
a7e38b
-
a7e38b
-The optional list of C<servers> may be zero or more server addresses
a7e38b
-(C<"hostname:port">).  The format of the server strings is documented
a7e38b
-in L</guestfs_add_drive_opts>.
a7e38b
-
a7e38b
-=head3 SSH
a7e38b
-
a7e38b
-Libguestfs can access disks over a Secure Shell (SSH) connection.
a7e38b
-
a7e38b
-To do this, set the C<protocol> and C<server> and (optionally)
a7e38b
-C<username> parameters of L</guestfs_add_drive_opts> like this:
a7e38b
-
a7e38b
- char **server = { "remote.example.com", NULL };
a7e38b
- guestfs_add_drive_opts (g, "/path/to/disk.img",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "ssh",
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_SERVER, server,
a7e38b
-                         GUESTFS_ADD_DRIVE_OPTS_USERNAME, "remoteuser",
a7e38b
-                         -1);
a7e38b
-
a7e38b
-The format of the server string is documented in
a7e38b
-L</guestfs_add_drive_opts>.
a7e38b
-
a7e38b
 =head2 INSPECTION
a7e38b
 
a7e38b
 Libguestfs has APIs for inspecting an unknown disk image to find out
a7e38b
diff --git a/tests/disks/test-qemu-drive-libvirt.sh b/tests/disks/test-qemu-drive-libvirt.sh
a7e38b
index 595a95a5e..b49534c94 100755
a7e38b
--- a/tests/disks/test-qemu-drive-libvirt.sh
a7e38b
+++ b/tests/disks/test-qemu-drive-libvirt.sh
a7e38b
@@ -65,34 +65,6 @@ check_output
a7e38b
 grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail ceph2
a7e38b
 rm "$DEBUG_QEMU_FILE"
a7e38b
 
a7e38b
-# Gluster.
a7e38b
-
a7e38b
-$guestfish -d gluster run ||:
a7e38b
-check_output
a7e38b
-grep -sq -- '-drive file=gluster://1.2.3.4:1234/volname/image,' "$DEBUG_QEMU_FILE" || fail gluster
a7e38b
-rm "$DEBUG_QEMU_FILE"
a7e38b
-
a7e38b
-# iSCSI.
a7e38b
-
a7e38b
-$guestfish -d iscsi run ||:
a7e38b
-check_output
a7e38b
-grep -sq -- '-drive file=iscsi://1.2.3.4:1234/iqn.2003-01.org.linux-iscsi.fedora' "$DEBUG_QEMU_FILE" || fail iscsi
a7e38b
-rm "$DEBUG_QEMU_FILE"
a7e38b
-
a7e38b
-# NBD.
a7e38b
-
a7e38b
-$guestfish -d nbd run ||:
a7e38b
-check_output
a7e38b
-grep -sq -- '-drive file=nbd:1.2.3.4:1234,' "$DEBUG_QEMU_FILE" || fail nbd
a7e38b
-rm "$DEBUG_QEMU_FILE"
a7e38b
-
a7e38b
-# Sheepdog.
a7e38b
-
a7e38b
-$guestfish -d sheepdog run ||:
a7e38b
-check_output
a7e38b
-grep -sq -- '-drive file=sheepdog:volume,' "$DEBUG_QEMU_FILE" || fail sheepdog
a7e38b
-rm "$DEBUG_QEMU_FILE"
a7e38b
-
a7e38b
 # Local, stored in a pool.
a7e38b
 
a7e38b
 $guestfish -d pool1 run ||:
a7e38b
diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh
a7e38b
index 12937fb30..b3e4f9903 100755
a7e38b
--- a/tests/disks/test-qemu-drive.sh
a7e38b
+++ b/tests/disks/test-qemu-drive.sh
a7e38b
@@ -62,45 +62,6 @@ check_output
a7e38b
 grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail
a7e38b
 rm "$DEBUG_QEMU_FILE"
a7e38b
 
a7e38b
-# HTTP.
a7e38b
-
a7e38b
-guestfish <
a7e38b
-  add "/disk.img" "format:raw" "protocol:http" "server:www.example.com"
a7e38b
-  run
a7e38b
-EOF
a7e38b
-check_output
a7e38b
-grep -sq -- '-drive file=http://www.example.com/disk.img,' "$DEBUG_QEMU_FILE" || fail
a7e38b
-rm "$DEBUG_QEMU_FILE"
a7e38b
-
a7e38b
-# Gluster.
a7e38b
-
a7e38b
-guestfish <
a7e38b
-  add "volname/image" "format:raw" "protocol:gluster" "server:www.example.com:24007"
a7e38b
-  run
a7e38b
-EOF
a7e38b
-check_output
a7e38b
-grep -sq -- '-drive file=gluster://www.example.com:24007/volname/image,' "$DEBUG_QEMU_FILE" || fail
a7e38b
-rm "$DEBUG_QEMU_FILE"
a7e38b
-
a7e38b
-# iSCSI.
a7e38b
-
a7e38b
-guestfish <
a7e38b
-  add "target-iqn-name/lun" "format:raw" "protocol:iscsi" "server:www.example.com:3000"
a7e38b
-  run
a7e38b
-EOF
a7e38b
-check_output
a7e38b
-grep -sq -- '-drive file=iscsi://www.example.com:3000/target-iqn-name/lun,' "$DEBUG_QEMU_FILE" || fail
a7e38b
-rm "$DEBUG_QEMU_FILE"
a7e38b
-
a7e38b
-guestfish <
a7e38b
-  add "target-iqn-name/lun" "format:raw" "protocol:iscsi" "server:www.example.com:3000" \
a7e38b
-    "username:user" "secret:pass"
a7e38b
-  run
a7e38b
-EOF
a7e38b
-check_output
a7e38b
-grep -sq -- '-drive file=iscsi://user%pass@www.example.com:3000/target-iqn-name/lun,' "$DEBUG_QEMU_FILE" || fail
a7e38b
-rm "$DEBUG_QEMU_FILE"
a7e38b
-
a7e38b
 # NBD.
a7e38b
 
a7e38b
 guestfish <
a7e38b
@@ -118,24 +79,3 @@ EOF
a7e38b
 check_output
a7e38b
 grep -sq -- '-drive file=nbd:unix:/socket,' "$DEBUG_QEMU_FILE" || fail
a7e38b
 rm "$DEBUG_QEMU_FILE"
a7e38b
-
a7e38b
-# Sheepdog.
a7e38b
-
a7e38b
-guestfish <
a7e38b
-  add "volume" "format:raw" "protocol:sheepdog"
a7e38b
-  run
a7e38b
-EOF
a7e38b
-check_output
a7e38b
-grep -sq -- '-drive file=sheepdog:volume,' "$DEBUG_QEMU_FILE" || fail
a7e38b
-rm "$DEBUG_QEMU_FILE"
a7e38b
-
a7e38b
-# SSH.
a7e38b
-
a7e38b
-guestfish <
a7e38b
-  add "/disk.img" "format:raw" "protocol:ssh" "server:example.com" \
a7e38b
-    "username:rich"
a7e38b
-  run
a7e38b
-EOF
a7e38b
-check_output
a7e38b
-grep -sq -- '-drive file=ssh://rich@example.com/disk.img,' "$DEBUG_QEMU_FILE" || fail
a7e38b
-rm "$DEBUG_QEMU_FILE"
a7e38b
-- 
a7e38b
2.31.1
a7e38b