|
|
ffd6ed |
From f55cbd578c873ad815bd3f8915a49be430b35b72 Mon Sep 17 00:00:00 2001
|
|
|
022f11 |
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
022f11 |
Date: Mon, 29 Jul 2013 14:47:56 +0100
|
|
|
022f11 |
Subject: [PATCH] RHEL 7: Disable unsupported remote drive protocols
|
|
|
022f11 |
(RHBZ#962113).
|
|
|
022f11 |
|
|
|
022f11 |
This disables support for unsupported remote drive protocols:
|
|
|
022f11 |
|
|
|
022f11 |
* ftp
|
|
|
022f11 |
* ftps
|
|
|
022f11 |
* http
|
|
|
022f11 |
* https
|
|
|
022f11 |
* tftp
|
|
|
022f11 |
* gluster
|
|
|
022f11 |
* iscsi
|
|
|
022f11 |
* sheepdog
|
|
|
022f11 |
* ssh
|
|
|
022f11 |
|
|
|
022f11 |
Note 'nbd' is not disabled, and of course 'file' works.
|
|
|
022f11 |
|
|
|
022f11 |
We hope to gradually add some of these back over the lifetime of RHEL 7.
|
|
|
ffd6ed |
|
|
|
ffd6ed |
In RHEL 7.2: rbd (Ceph) support was enabled.
|
|
|
022f11 |
---
|
|
|
ffd6ed |
examples/guestfs-testing.pod | 21 -------
|
|
|
ffd6ed |
fish/guestfish.pod | 64 ++-------------------
|
|
|
ffd6ed |
fish/test-add-uri.sh | 25 ---------
|
|
|
ffd6ed |
generator/actions.ml | 48 +---------------
|
|
|
0d20ef |
src/drives.c | 8 +++
|
|
|
ffd6ed |
src/guestfs.pod | 100 ---------------------------------
|
|
|
ffd6ed |
tests/disks/test-qemu-drive-libvirt.sh | 28 ---------
|
|
|
ffd6ed |
tests/disks/test-qemu-drive.sh | 51 -----------------
|
|
|
ffd6ed |
8 files changed, 15 insertions(+), 330 deletions(-)
|
|
|
022f11 |
|
|
|
ffd6ed |
diff --git a/examples/guestfs-testing.pod b/examples/guestfs-testing.pod
|
|
|
ffd6ed |
index 2186ed3..ae23b59 100644
|
|
|
ffd6ed |
--- a/examples/guestfs-testing.pod
|
|
|
ffd6ed |
+++ b/examples/guestfs-testing.pod
|
|
|
ffd6ed |
@@ -117,27 +117,6 @@ image. To exit, type C<exit>.
|
|
|
ffd6ed |
If you get an error, try enabling debugging (add C<-v> to the command
|
|
|
ffd6ed |
line). Also make sure that L<libguestfs-test-tool(1)> succeeds.
|
|
|
ffd6ed |
|
|
|
ffd6ed |
-=head2 Try to open a remote guest image with guestfish.
|
|
|
ffd6ed |
-
|
|
|
ffd6ed |
-B<Note> this test requires S<libguestfs E<ge> 1.22> and S<qemu E<ge> 1.5>.
|
|
|
ffd6ed |
-You may also have to disable libvirt by setting this:
|
|
|
ffd6ed |
-
|
|
|
ffd6ed |
- export LIBGUESTFS_BACKEND=direct
|
|
|
ffd6ed |
-
|
|
|
ffd6ed |
-If you have a disk image available over HTTP/FTP, try to open it.
|
|
|
ffd6ed |
-
|
|
|
ffd6ed |
- guestfish --ro -i --format=raw -a http://www.example.com/disk.img
|
|
|
ffd6ed |
-
|
|
|
ffd6ed |
-For SSH you will need to make sure that ssh-agent is set up so you
|
|
|
ffd6ed |
-don't need a password to log in to the remote machine. Then a command
|
|
|
ffd6ed |
-similar to this should work:
|
|
|
ffd6ed |
-
|
|
|
ffd6ed |
- guestfish --ro -i --format=raw \
|
|
|
ffd6ed |
- -a ssh://remote.example.com/path/to/disk.img
|
|
|
ffd6ed |
-
|
|
|
ffd6ed |
-If you get an error, try enabling debugging (add C<-v> to the command
|
|
|
ffd6ed |
-line). Also make sure that L<libguestfs-test-tool(1)> succeeds.
|
|
|
ffd6ed |
-
|
|
|
ffd6ed |
=head2 Run virt-alignment-scan on all your guests.
|
|
|
ffd6ed |
|
|
|
ffd6ed |
Run L<virt-alignment-scan(1)> on guests or disk images:
|
|
|
022f11 |
diff --git a/fish/guestfish.pod b/fish/guestfish.pod
|
|
|
ffd6ed |
index 12bf243..e7423a6 100644
|
|
|
022f11 |
--- a/fish/guestfish.pod
|
|
|
022f11 |
+++ b/fish/guestfish.pod
|
|
|
ffd6ed |
@@ -138,9 +138,9 @@ To list what is available do:
|
|
|
ffd6ed |
|
|
|
ffd6ed |
=head2 Remote drives
|
|
|
ffd6ed |
|
|
|
ffd6ed |
-Access a remote disk using ssh:
|
|
|
ffd6ed |
+Access a remote disk using NBD:
|
|
|
ffd6ed |
|
|
|
ffd6ed |
- guestfish -a ssh://example.com/path/to/disk.img
|
|
|
ffd6ed |
+ guestfish -a nbd://example.com
|
|
|
ffd6ed |
|
|
|
ffd6ed |
=head2 Remote control
|
|
|
ffd6ed |
|
|
|
ffd6ed |
@@ -1125,12 +1125,12 @@ L<guestfs(3)/REMOTE STORAGE>>.
|
|
|
ffd6ed |
On the command line, you can use the I<-a> option to add network
|
|
|
ffd6ed |
block devices using a URI-style format, for example:
|
|
|
ffd6ed |
|
|
|
ffd6ed |
- guestfish -a ssh://root@example.com/disk.img
|
|
|
ffd6ed |
+ guestfish -a nbd://example.com
|
|
|
ffd6ed |
|
|
|
ffd6ed |
URIs I<cannot> be used with the L</add> command. The equivalent
|
|
|
ffd6ed |
command using the API directly is:
|
|
|
ffd6ed |
|
|
|
ffd6ed |
- ><fs> add /disk.img protocol:ssh server:tcp:example.com username:root
|
|
|
ffd6ed |
+ ><fs> add /disk.img protocol:nbd server:tcp:example.com
|
|
|
ffd6ed |
|
|
|
ffd6ed |
The possible I<-a URI> formats are described below.
|
|
|
ffd6ed |
|
|
|
0d20ef |
@@ -1140,40 +1140,6 @@ The possible I<-a URI> formats are described below.
|
|
|
022f11 |
|
|
|
022f11 |
Add the local disk image (or device) called C<disk.img>.
|
|
|
022f11 |
|
|
|
022f11 |
-=head2 B<-a ftp://[user@]example.com[:port]/disk.img>
|
|
|
022f11 |
-
|
|
|
022f11 |
-=head2 B<-a ftps://[user@]example.com[:port]/disk.img>
|
|
|
022f11 |
-
|
|
|
022f11 |
-=head2 B<-a http://[user@]example.com[:port]/disk.img>
|
|
|
022f11 |
-
|
|
|
022f11 |
-=head2 B<-a https://[user@]example.com[:port]/disk.img>
|
|
|
022f11 |
-
|
|
|
022f11 |
-=head2 B<-a tftp://[user@]example.com[:port]/disk.img>
|
|
|
022f11 |
-
|
|
|
022f11 |
-Add a disk located on a remote FTP, HTTP or TFTP server.
|
|
|
022f11 |
-
|
|
|
022f11 |
-The equivalent API command would be:
|
|
|
022f11 |
-
|
|
|
022f11 |
- ><fs> add /disk.img protocol:(ftp|...) server:tcp:example.com
|
|
|
022f11 |
-
|
|
|
0d20ef |
-=head2 B<-a gluster://example.com[:port]/volname/image>
|
|
|
022f11 |
-
|
|
|
022f11 |
-Add a disk image located on GlusterFS storage.
|
|
|
022f11 |
-
|
|
|
022f11 |
-The server is the one running C<glusterd>, and may be C<localhost>.
|
|
|
022f11 |
-
|
|
|
022f11 |
-The equivalent API command would be:
|
|
|
022f11 |
-
|
|
|
0d20ef |
- ><fs> add volname/image protocol:gluster server:tcp:example.com
|
|
|
022f11 |
-
|
|
|
022f11 |
-=head2 B<-a iscsi://example.com[:port]/target-iqn-name[/lun]>
|
|
|
022f11 |
-
|
|
|
022f11 |
-Add a disk located on an iSCSI server.
|
|
|
022f11 |
-
|
|
|
022f11 |
-The equivalent API command would be:
|
|
|
022f11 |
-
|
|
|
0d20ef |
- ><fs> add target-iqn-name/lun protocol:iscsi server:tcp:example.com
|
|
|
022f11 |
-
|
|
|
022f11 |
=head2 B<-a nbd://example.com[:port]>
|
|
|
022f11 |
|
|
|
022f11 |
=head2 B<-a nbd://example.com[:port]/exportname>
|
|
|
ffd6ed |
@@ -1208,28 +1174,6 @@ The equivalent API command would be:
|
|
|
022f11 |
|
|
|
ffd6ed |
><fs> add pool/disk protocol:rbd server:tcp:example.com:port
|
|
|
022f11 |
|
|
|
022f11 |
-=head2 B<-a sheepdog://[example.com[:port]]/volume/image>
|
|
|
022f11 |
-
|
|
|
022f11 |
-Add a disk image located on a Sheepdog volume.
|
|
|
022f11 |
-
|
|
|
022f11 |
-The server name is optional. Although libguestfs and Sheepdog
|
|
|
022f11 |
-supports multiple servers, only at most one server can be specified
|
|
|
022f11 |
-when using this URI syntax.
|
|
|
022f11 |
-
|
|
|
022f11 |
-The equivalent API command would be:
|
|
|
022f11 |
-
|
|
|
0d20ef |
- ><fs> add volume protocol:sheepdog [server:tcp:example.com]
|
|
|
022f11 |
-
|
|
|
022f11 |
-=head2 B<-a ssh://[user@]example.com[:port]/disk.img>
|
|
|
022f11 |
-
|
|
|
022f11 |
-Add a disk image located on a remote server, accessed using the Secure
|
|
|
022f11 |
-Shell (ssh) SFTP protocol. SFTP is supported out of the box by all
|
|
|
022f11 |
-major SSH servers.
|
|
|
022f11 |
-
|
|
|
022f11 |
-The equivalent API command would be:
|
|
|
022f11 |
-
|
|
|
022f11 |
- ><fs> add /disk protocol:ssh server:tcp:example.com [username:user]
|
|
|
022f11 |
-
|
|
|
022f11 |
=head1 PROGRESS BARS
|
|
|
022f11 |
|
|
|
022f11 |
Some (not all) long-running commands send progress notification
|
|
|
022f11 |
diff --git a/fish/test-add-uri.sh b/fish/test-add-uri.sh
|
|
|
ffd6ed |
index 2f83754..48c12b8 100755
|
|
|
022f11 |
--- a/fish/test-add-uri.sh
|
|
|
022f11 |
+++ b/fish/test-add-uri.sh
|
|
|
022f11 |
@@ -37,14 +37,6 @@ function fail ()
|
|
|
0d20ef |
$VG guestfish -x -a file://$(pwd)/test-add-uri.img </dev/null >test-add-uri.out 2>&1
|
|
|
022f11 |
grep -sq 'add_drive ".*/test-add-uri.img"' test-add-uri.out || fail
|
|
|
022f11 |
|
|
|
022f11 |
-# curl
|
|
|
0d20ef |
-$VG guestfish -x -a ftp://user@example.com/disk.img </dev/null >test-add-uri.out 2>&1
|
|
|
022f11 |
-grep -sq 'add_drive "/disk.img" "protocol:ftp" "server:tcp:example.com" "username:user"' test-add-uri.out || fail
|
|
|
022f11 |
-
|
|
|
022f11 |
-# gluster
|
|
|
0d20ef |
-$VG guestfish -x -a gluster://example.com/disk </dev/null >test-add-uri.out 2>&1
|
|
|
0d20ef |
-grep -sq 'add_drive "disk" "protocol:gluster" "server:tcp:example.com"' test-add-uri.out || fail
|
|
|
022f11 |
-
|
|
|
022f11 |
# NBD
|
|
|
0d20ef |
$VG guestfish -x -a nbd://example.com </dev/null >test-add-uri.out 2>&1
|
|
|
022f11 |
grep -sq 'add_drive "" "protocol:nbd" "server:tcp:example.com"' test-add-uri.out || fail
|
|
|
ffd6ed |
@@ -64,22 +56,5 @@ grep -sq 'add_drive "pool/disk" "protocol:rbd" "server:tcp:example.com:6789"' te
|
|
|
ffd6ed |
$VG guestfish -x -a rbd:///pool/disk </dev/null >test-add-uri.out 2>&1
|
|
|
ffd6ed |
grep -sq 'add_drive "pool/disk" "protocol:rbd"' test-add-uri.out || fail
|
|
|
022f11 |
|
|
|
022f11 |
-# sheepdog
|
|
|
0d20ef |
-$VG guestfish -x -a sheepdog:///volume/image </dev/null >test-add-uri.out 2>&1
|
|
|
0d20ef |
-grep -sq 'add_drive "volume/image" "protocol:sheepdog"' test-add-uri.out || fail
|
|
|
022f11 |
-
|
|
|
0d20ef |
-$VG guestfish -x -a sheepdog://example.com:3000/volume/image </dev/null >test-add-uri.out 2>&1
|
|
|
0d20ef |
-grep -sq 'add_drive "volume/image" "protocol:sheepdog" "server:tcp:example.com:3000"' test-add-uri.out || fail
|
|
|
022f11 |
-
|
|
|
022f11 |
-# ssh
|
|
|
0d20ef |
-$VG guestfish -x -a ssh://example.com/disk.img </dev/null >test-add-uri.out 2>&1
|
|
|
022f11 |
-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com"' test-add-uri.out || fail
|
|
|
022f11 |
-
|
|
|
0d20ef |
-$VG guestfish -x -a ssh://user@example.com/disk.img </dev/null >test-add-uri.out 2>&1
|
|
|
022f11 |
-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com" "username:user"' test-add-uri.out || fail
|
|
|
022f11 |
-
|
|
|
0d20ef |
-$VG guestfish -x -a ssh://user@example.com:2000/disk.img </dev/null >test-add-uri.out 2>&1
|
|
|
022f11 |
-grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com:2000" "username:user"' test-add-uri.out || fail
|
|
|
022f11 |
-
|
|
|
022f11 |
rm test-add-uri.out
|
|
|
022f11 |
rm test-add-uri.img
|
|
|
022f11 |
diff --git a/generator/actions.ml b/generator/actions.ml
|
|
|
ffd6ed |
index 2f2ab66..ea715d0 100644
|
|
|
022f11 |
--- a/generator/actions.ml
|
|
|
022f11 |
+++ b/generator/actions.ml
|
|
|
0d20ef |
@@ -1397,27 +1397,6 @@ C<filename> is interpreted as a local file or device.
|
|
|
022f11 |
This is the default if the optional protocol parameter
|
|
|
022f11 |
is omitted.
|
|
|
022f11 |
|
|
|
022f11 |
-=item C<protocol = \"ftp\"|\"ftps\"|\"http\"|\"https\"|\"tftp\">
|
|
|
022f11 |
-
|
|
|
022f11 |
-Connect to a remote FTP, HTTP or TFTP server.
|
|
|
022f11 |
-The C<server> parameter must also be supplied - see below.
|
|
|
022f11 |
-
|
|
|
022f11 |
-See also: L<guestfs(3)/FTP, HTTP AND TFTP>
|
|
|
022f11 |
-
|
|
|
022f11 |
-=item C<protocol = \"gluster\">
|
|
|
022f11 |
-
|
|
|
022f11 |
-Connect to the GlusterFS server.
|
|
|
022f11 |
-The C<server> parameter must also be supplied - see below.
|
|
|
022f11 |
-
|
|
|
022f11 |
-See also: L<guestfs(3)/GLUSTER>
|
|
|
022f11 |
-
|
|
|
022f11 |
-=item C<protocol = \"iscsi\">
|
|
|
022f11 |
-
|
|
|
022f11 |
-Connect to the iSCSI server.
|
|
|
022f11 |
-The C<server> parameter must also be supplied - see below.
|
|
|
022f11 |
-
|
|
|
022f11 |
-See also: L<guestfs(3)/ISCSI>.
|
|
|
022f11 |
-
|
|
|
022f11 |
=item C<protocol = \"nbd\">
|
|
|
022f11 |
|
|
|
022f11 |
Connect to the Network Block Device server.
|
|
|
ffd6ed |
@@ -1434,22 +1413,6 @@ The C<secret> parameter may be supplied. See below.
|
|
|
022f11 |
|
|
|
ffd6ed |
See also: L<guestfs(3)/CEPH>.
|
|
|
022f11 |
|
|
|
022f11 |
-=item C<protocol = \"sheepdog\">
|
|
|
022f11 |
-
|
|
|
022f11 |
-Connect to the Sheepdog server.
|
|
|
022f11 |
-The C<server> parameter may also be supplied - see below.
|
|
|
022f11 |
-
|
|
|
022f11 |
-See also: L<guestfs(3)/SHEEPDOG>.
|
|
|
022f11 |
-
|
|
|
022f11 |
-=item C<protocol = \"ssh\">
|
|
|
022f11 |
-
|
|
|
022f11 |
-Connect to the Secure Shell (ssh) server.
|
|
|
022f11 |
-
|
|
|
022f11 |
-The C<server> parameter must be supplied.
|
|
|
022f11 |
-The C<username> parameter may be supplied. See below.
|
|
|
022f11 |
-
|
|
|
022f11 |
-See also: L<guestfs(3)/SSH>.
|
|
|
022f11 |
-
|
|
|
022f11 |
=back
|
|
|
022f11 |
|
|
|
022f11 |
=item C<server>
|
|
|
ffd6ed |
@@ -1460,13 +1423,8 @@ is a list of server(s).
|
|
|
022f11 |
Protocol Number of servers required
|
|
|
022f11 |
-------- --------------------------
|
|
|
022f11 |
file List must be empty or param not used at all
|
|
|
022f11 |
- ftp|ftps|http|https|tftp Exactly one
|
|
|
022f11 |
- gluster Exactly one
|
|
|
022f11 |
- iscsi Exactly one
|
|
|
022f11 |
nbd Exactly one
|
|
|
ffd6ed |
rbd Zero or more
|
|
|
022f11 |
- sheepdog Zero or more
|
|
|
022f11 |
- ssh Exactly one
|
|
|
022f11 |
|
|
|
022f11 |
Each list element is a string specifying a server. The string must be
|
|
|
022f11 |
in one of the following formats:
|
|
|
ffd6ed |
@@ -1482,10 +1440,10 @@ for the protocol is used (see C</etc/services>).
|
|
|
ffd6ed |
|
|
|
ffd6ed |
=item C<username>
|
|
|
022f11 |
|
|
|
022f11 |
-For the C<ftp>, C<ftps>, C<http>, C<https>, C<iscsi>, C<rbd>, C<ssh>
|
|
|
022f11 |
-and C<tftp> protocols, this specifies the remote username.
|
|
|
ffd6ed |
+For the C<rbd>
|
|
|
ffd6ed |
+protocol, this specifies the remote username.
|
|
|
022f11 |
|
|
|
ffd6ed |
-If not given, then the local username is used for C<ssh>, and no authentication
|
|
|
ffd6ed |
+If not given, then no authentication
|
|
|
ffd6ed |
is attempted for ceph. But note this sometimes may give unexpected results, for
|
|
|
ffd6ed |
example if using the libvirt backend and if the libvirt backend is configured to
|
|
|
ffd6ed |
start the qemu appliance as a special user such as C<qemu.qemu>. If in doubt,
|
|
|
022f11 |
diff --git a/src/drives.c b/src/drives.c
|
|
|
ffd6ed |
index 307f267..34cf07a 100644
|
|
|
022f11 |
--- a/src/drives.c
|
|
|
022f11 |
+++ b/src/drives.c
|
|
|
0d20ef |
@@ -199,6 +199,7 @@ create_drive_non_file (guestfs_h *g,
|
|
|
022f11 |
return drv;
|
|
|
022f11 |
}
|
|
|
022f11 |
|
|
|
022f11 |
+#if 0 /* DISABLED IN RHEL 7 */
|
|
|
022f11 |
static struct drive *
|
|
|
022f11 |
create_drive_curl (guestfs_h *g,
|
|
|
0d20ef |
const struct drive_create_data *data)
|
|
|
0d20ef |
@@ -257,6 +258,7 @@ create_drive_gluster (guestfs_h *g,
|
|
|
0d20ef |
|
|
|
0d20ef |
return create_drive_non_file (g, data);
|
|
|
022f11 |
}
|
|
|
022f11 |
+#endif /* DISABLED IN RHEL 7 */
|
|
|
022f11 |
|
|
|
022f11 |
static int
|
|
|
022f11 |
nbd_port (void)
|
|
|
ffd6ed |
@@ -325,6 +327,7 @@ create_drive_rbd (guestfs_h *g,
|
|
|
0d20ef |
return create_drive_non_file (g, data);
|
|
|
022f11 |
}
|
|
|
022f11 |
|
|
|
022f11 |
+#if 0 /* DISABLED IN RHEL 7 */
|
|
|
022f11 |
static struct drive *
|
|
|
ffd6ed |
create_drive_sheepdog (guestfs_h *g,
|
|
|
ffd6ed |
const struct drive_create_data *data)
|
|
|
0d20ef |
@@ -435,6 +438,7 @@ create_drive_iscsi (guestfs_h *g,
|
|
|
0d20ef |
|
|
|
0d20ef |
return create_drive_non_file (g, data);
|
|
|
022f11 |
}
|
|
|
022f11 |
+#endif /* DISABLED IN RHEL 7 */
|
|
|
022f11 |
|
|
|
022f11 |
/* Traditionally you have been able to use /dev/null as a filename, as
|
|
|
022f11 |
* many times as you like. Ancient KVM (RHEL 5) cannot handle adding
|
|
|
0d20ef |
@@ -882,6 +886,7 @@ guestfs__add_drive_opts (guestfs_h *g, const char *filename,
|
|
|
0d20ef |
drv = create_drive_file (g, &data);
|
|
|
022f11 |
}
|
|
|
022f11 |
}
|
|
|
022f11 |
+#if 0 /* DISABLED IN RHEL 7 */
|
|
|
022f11 |
else if (STREQ (protocol, "ftp")) {
|
|
|
0d20ef |
data.protocol = drive_protocol_ftp;
|
|
|
0d20ef |
drv = create_drive_curl (g, &data);
|
|
|
ffd6ed |
@@ -906,6 +911,7 @@ guestfs__add_drive_opts (guestfs_h *g, const char *filename,
|
|
|
0d20ef |
data.protocol = drive_protocol_iscsi;
|
|
|
0d20ef |
drv = create_drive_iscsi (g, &data);
|
|
|
022f11 |
}
|
|
|
022f11 |
+#endif /* DISABLED IN RHEL 7 */
|
|
|
022f11 |
else if (STREQ (protocol, "nbd")) {
|
|
|
0d20ef |
data.protocol = drive_protocol_nbd;
|
|
|
0d20ef |
drv = create_drive_nbd (g, &data);
|
|
|
ffd6ed |
@@ -914,6 +920,7 @@ guestfs__add_drive_opts (guestfs_h *g, const char *filename,
|
|
|
0d20ef |
data.protocol = drive_protocol_rbd;
|
|
|
0d20ef |
drv = create_drive_rbd (g, &data);
|
|
|
ffd6ed |
}
|
|
|
ffd6ed |
+#if 0 /* DISABLED IN RHEL 7 */
|
|
|
ffd6ed |
else if (STREQ (protocol, "sheepdog")) {
|
|
|
ffd6ed |
data.protocol = drive_protocol_sheepdog;
|
|
|
ffd6ed |
drv = create_drive_sheepdog (g, &data);
|
|
|
0d20ef |
@@ -926,6 +933,7 @@ guestfs__add_drive_opts (guestfs_h *g, const char *filename,
|
|
|
0d20ef |
data.protocol = drive_protocol_tftp;
|
|
|
0d20ef |
drv = create_drive_curl (g, &data);
|
|
|
022f11 |
}
|
|
|
022f11 |
+#endif /* DISABLED IN RHEL 7 */
|
|
|
022f11 |
else {
|
|
|
022f11 |
error (g, _("unknown protocol '%s'"), protocol);
|
|
|
022f11 |
drv = NULL; /*FALLTHROUGH*/
|
|
|
022f11 |
diff --git a/src/guestfs.pod b/src/guestfs.pod
|
|
|
ffd6ed |
index c9ac1fa..3c1ad46 100644
|
|
|
022f11 |
--- a/src/guestfs.pod
|
|
|
022f11 |
+++ b/src/guestfs.pod
|
|
|
ffd6ed |
@@ -695,70 +695,6 @@ servers. The server string is documented in
|
|
|
ffd6ed |
L</guestfs_add_drive_opts>. The C<username> and C<secret> parameters are
|
|
|
ffd6ed |
also optional, and if not given, then no authentication will be used.
|
|
|
022f11 |
|
|
|
022f11 |
-=head3 FTP, HTTP AND TFTP
|
|
|
022f11 |
-
|
|
|
022f11 |
-Libguestfs can access remote disks over FTP, FTPS, HTTP, HTTPS
|
|
|
022f11 |
-or TFTP protocols.
|
|
|
022f11 |
-
|
|
|
022f11 |
-To do this, set the optional C<protocol> and C<server> parameters of
|
|
|
022f11 |
-L</guestfs_add_drive_opts> like this:
|
|
|
022f11 |
-
|
|
|
022f11 |
- char **servers = { "www.example.org", NULL };
|
|
|
022f11 |
- guestfs_add_drive_opts (g, "/disk.img",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "http",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers,
|
|
|
022f11 |
- -1);
|
|
|
022f11 |
-
|
|
|
022f11 |
-The C<protocol> can be one of C<"ftp">, C<"ftps">, C<"http">,
|
|
|
022f11 |
-C<"https"> or C<"tftp">.
|
|
|
022f11 |
-
|
|
|
022f11 |
-C<servers> (the C<server> parameter) is a list which must have a
|
|
|
022f11 |
-single element. The single element is a string defining the web,
|
|
|
022f11 |
-FTP or TFTP server. The format of this string is documented in
|
|
|
022f11 |
-L</guestfs_add_drive_opts>.
|
|
|
022f11 |
-
|
|
|
022f11 |
-=head3 GLUSTER
|
|
|
022f11 |
-
|
|
|
022f11 |
-Libguestfs can access Gluster disks.
|
|
|
022f11 |
-
|
|
|
022f11 |
-To do this, set the optional C<protocol> and C<server> parameters of
|
|
|
022f11 |
-L</guestfs_add_drive_opts> like this:
|
|
|
022f11 |
-
|
|
|
022f11 |
- char **servers = { "gluster.example.org:24007", NULL };
|
|
|
0d20ef |
- guestfs_add_drive_opts (g, "volname/image",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "gluster",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers,
|
|
|
022f11 |
- -1);
|
|
|
022f11 |
-
|
|
|
022f11 |
-C<servers> (the C<server> parameter) is a list which must have a
|
|
|
022f11 |
-single element. The single element is a string defining the Gluster
|
|
|
022f11 |
-server. The format of this string is documented in
|
|
|
022f11 |
-L</guestfs_add_drive_opts>.
|
|
|
022f11 |
-
|
|
|
022f11 |
-Note that gluster usually requires the client process (ie. libguestfs)
|
|
|
022f11 |
-to run as B<root> and will give unfathomable errors if it is not
|
|
|
022f11 |
-(eg. "No data available").
|
|
|
022f11 |
-
|
|
|
022f11 |
-=head3 ISCSI
|
|
|
022f11 |
-
|
|
|
022f11 |
-Libguestfs can access iSCSI disks remotely.
|
|
|
022f11 |
-
|
|
|
022f11 |
-To do this, set the optional C<protocol> and C<server> parameters like
|
|
|
022f11 |
-this:
|
|
|
022f11 |
-
|
|
|
022f11 |
- char **server = { "iscsi.example.org:3000", NULL };
|
|
|
0d20ef |
- guestfs_add_drive_opts (g, "target-iqn-name/lun",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "iscsi",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_SERVER, server,
|
|
|
022f11 |
- -1);
|
|
|
022f11 |
-
|
|
|
022f11 |
-The C<server> parameter is a list which must have a single element.
|
|
|
022f11 |
-The single element is a string defining the iSCSI server. The format
|
|
|
022f11 |
-of this string is documented in L</guestfs_add_drive_opts>.
|
|
|
022f11 |
-
|
|
|
022f11 |
=head3 NETWORK BLOCK DEVICE
|
|
|
022f11 |
|
|
|
022f11 |
Libguestfs can access Network Block Device (NBD) disks remotely.
|
|
|
ffd6ed |
@@ -821,42 +757,6 @@ L<https://bugs.launchpad.net/qemu/+bug/1155677>
|
|
|
022f11 |
|
|
|
022f11 |
=back
|
|
|
022f11 |
|
|
|
022f11 |
-=head3 SHEEPDOG
|
|
|
022f11 |
-
|
|
|
022f11 |
-Libguestfs can access Sheepdog disks.
|
|
|
022f11 |
-
|
|
|
022f11 |
-To do this, set the optional C<protocol> and C<server> parameters of
|
|
|
022f11 |
-L</guestfs_add_drive_opts> like this:
|
|
|
022f11 |
-
|
|
|
022f11 |
- char **servers = { /* optional servers ... */ NULL };
|
|
|
0d20ef |
- guestfs_add_drive_opts (g, "volume",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "sheepdog",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_SERVER, servers,
|
|
|
022f11 |
- -1);
|
|
|
022f11 |
-
|
|
|
022f11 |
-The optional list of C<servers> may be zero or more server addresses
|
|
|
022f11 |
-(C<"hostname:port">). The format of the server strings is documented
|
|
|
022f11 |
-in L</guestfs_add_drive_opts>.
|
|
|
022f11 |
-
|
|
|
022f11 |
-=head3 SSH
|
|
|
022f11 |
-
|
|
|
022f11 |
-Libguestfs can access disks over a Secure Shell (SSH) connection.
|
|
|
022f11 |
-
|
|
|
022f11 |
-To do this, set the C<protocol> and C<server> and (optionally)
|
|
|
022f11 |
-C<username> parameters of L</guestfs_add_drive_opts> like this:
|
|
|
022f11 |
-
|
|
|
022f11 |
- char **server = { "remote.example.com", NULL };
|
|
|
022f11 |
- guestfs_add_drive_opts (g, "/path/to/disk.img",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "ssh",
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_SERVER, server,
|
|
|
022f11 |
- GUESTFS_ADD_DRIVE_OPTS_USERNAME, "remoteuser",
|
|
|
022f11 |
- -1);
|
|
|
022f11 |
-
|
|
|
022f11 |
-The format of the server string is documented in
|
|
|
022f11 |
-L</guestfs_add_drive_opts>.
|
|
|
022f11 |
-
|
|
|
022f11 |
=head2 INSPECTION
|
|
|
022f11 |
|
|
|
022f11 |
Libguestfs has APIs for inspecting an unknown disk image to find out
|
|
|
0d20ef |
diff --git a/tests/disks/test-qemu-drive-libvirt.sh b/tests/disks/test-qemu-drive-libvirt.sh
|
|
|
ffd6ed |
index 9930865..1367079 100755
|
|
|
0d20ef |
--- a/tests/disks/test-qemu-drive-libvirt.sh
|
|
|
0d20ef |
+++ b/tests/disks/test-qemu-drive-libvirt.sh
|
|
|
ffd6ed |
@@ -76,34 +76,6 @@ check_output
|
|
|
ffd6ed |
grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail
|
|
|
ffd6ed |
rm "$DEBUG_QEMU_FILE"
|
|
|
0d20ef |
|
|
|
0d20ef |
-# Gluster.
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-$guestfish -d gluster run ||:
|
|
|
0d20ef |
-check_output
|
|
|
0d20ef |
-grep -sq -- '-drive file=gluster://1.2.3.4:1234/volname/image,' "$DEBUG_QEMU_FILE" || fail
|
|
|
0d20ef |
-rm "$DEBUG_QEMU_FILE"
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-# iSCSI.
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-$guestfish -d iscsi run ||:
|
|
|
0d20ef |
-check_output
|
|
|
0d20ef |
-grep -sq -- '-drive file=iscsi://1.2.3.4:1234/iqn.2003-01.org.linux-iscsi.fedora,' "$DEBUG_QEMU_FILE" || fail
|
|
|
0d20ef |
-rm "$DEBUG_QEMU_FILE"
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-# NBD.
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-$guestfish -d nbd run ||:
|
|
|
0d20ef |
-check_output
|
|
|
0d20ef |
-grep -sq -- '-drive file=nbd:1.2.3.4:1234,' "$DEBUG_QEMU_FILE" || fail
|
|
|
0d20ef |
-rm "$DEBUG_QEMU_FILE"
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-# Sheepdog.
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-$guestfish -d sheepdog run ||:
|
|
|
0d20ef |
-check_output
|
|
|
0d20ef |
-grep -sq -- '-drive file=sheepdog:volume,' "$DEBUG_QEMU_FILE" || fail
|
|
|
0d20ef |
-rm "$DEBUG_QEMU_FILE"
|
|
|
0d20ef |
-
|
|
|
0d20ef |
# To do:
|
|
|
0d20ef |
|
|
|
0d20ef |
# HTTP - curl not yet supported by libvirt
|
|
|
0d20ef |
diff --git a/tests/disks/test-qemu-drive.sh b/tests/disks/test-qemu-drive.sh
|
|
|
ffd6ed |
index b530e7d..c0239ff 100755
|
|
|
0d20ef |
--- a/tests/disks/test-qemu-drive.sh
|
|
|
0d20ef |
+++ b/tests/disks/test-qemu-drive.sh
|
|
|
ffd6ed |
@@ -61,36 +61,6 @@ check_output
|
|
|
ffd6ed |
grep -sq -- '-drive file=rbd:abc-def/ghi-jkl:auth_supported=none,' "$DEBUG_QEMU_FILE" || fail
|
|
|
ffd6ed |
rm "$DEBUG_QEMU_FILE"
|
|
|
0d20ef |
|
|
|
0d20ef |
-# HTTP.
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-guestfish <
|
|
|
0d20ef |
- add "/disk.img" "format:raw" "protocol:http" "server:www.example.com"
|
|
|
0d20ef |
- run
|
|
|
0d20ef |
-EOF
|
|
|
0d20ef |
-check_output
|
|
|
0d20ef |
-grep -sq -- '-drive file=http://www.example.com/disk.img,' "$DEBUG_QEMU_FILE" || fail
|
|
|
0d20ef |
-rm "$DEBUG_QEMU_FILE"
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-# Gluster.
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-guestfish <
|
|
|
0d20ef |
- add "volname/image" "format:raw" "protocol:gluster" "server:www.example.com:24007"
|
|
|
0d20ef |
- run
|
|
|
0d20ef |
-EOF
|
|
|
0d20ef |
-check_output
|
|
|
0d20ef |
-grep -sq -- '-drive file=gluster://www.example.com:24007/volname/image,' "$DEBUG_QEMU_FILE" || fail
|
|
|
0d20ef |
-rm "$DEBUG_QEMU_FILE"
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-# iSCSI.
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-guestfish <
|
|
|
0d20ef |
- add "target-iqn-name/lun" "format:raw" "protocol:iscsi" "server:www.example.com:3000"
|
|
|
0d20ef |
- run
|
|
|
0d20ef |
-EOF
|
|
|
0d20ef |
-check_output
|
|
|
0d20ef |
-grep -sq -- '-drive file=iscsi://www.example.com:3000/target-iqn-name/lun,' "$DEBUG_QEMU_FILE" || fail
|
|
|
0d20ef |
-rm "$DEBUG_QEMU_FILE"
|
|
|
0d20ef |
-
|
|
|
0d20ef |
# NBD.
|
|
|
0d20ef |
|
|
|
0d20ef |
guestfish <
|
|
|
ffd6ed |
@@ -108,24 +78,3 @@ EOF
|
|
|
0d20ef |
check_output
|
|
|
0d20ef |
grep -sq -- '-drive file=nbd:unix:/socket,' "$DEBUG_QEMU_FILE" || fail
|
|
|
0d20ef |
rm "$DEBUG_QEMU_FILE"
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-# Sheepdog.
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-guestfish <
|
|
|
0d20ef |
- add "volume" "format:raw" "protocol:sheepdog"
|
|
|
0d20ef |
- run
|
|
|
0d20ef |
-EOF
|
|
|
0d20ef |
-check_output
|
|
|
0d20ef |
-grep -sq -- '-drive file=sheepdog:volume,' "$DEBUG_QEMU_FILE" || fail
|
|
|
0d20ef |
-rm "$DEBUG_QEMU_FILE"
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-# SSH.
|
|
|
0d20ef |
-
|
|
|
0d20ef |
-guestfish <
|
|
|
0d20ef |
- add "/disk.img" "format:raw" "protocol:ssh" "server:example.com" \
|
|
|
0d20ef |
- "username:rich"
|
|
|
0d20ef |
- run
|
|
|
0d20ef |
-EOF
|
|
|
0d20ef |
-check_output
|
|
|
0d20ef |
-grep -sq -- '-drive file=ssh://rich@example.com/disk.img,' "$DEBUG_QEMU_FILE" || fail
|
|
|
0d20ef |
-rm "$DEBUG_QEMU_FILE"
|
|
|
022f11 |
--
|
|
|
022f11 |
1.8.3.1
|
|
|
022f11 |
|