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