Remove tftp drive support

This was only theoretically supported, via curl.  It's unlikely that
it really worked as it was never tested.

If needed it's better to use nbdkit-curl-plugin instead (this applies
to http and ftp as well).
This commit is contained in:
Richard W.M. Jones
2024-06-27 16:27:06 +01:00
parent b1db7847ee
commit 8b3e8a9056
7 changed files with 13 additions and 29 deletions

View File

@@ -1152,9 +1152,7 @@ Add the local disk image (or device) called F<disk.img>.
=head2 B<-a https://[user@]example.com[:port]/disk.img>
=head2 B<-a tftp://[user@]example.com[:port]/disk.img>
Add a disk located on a remote FTP, HTTP or TFTP server.
Add a disk located on a remote FTP or HTTP server.
The equivalent API command would be:

View File

@@ -350,12 +350,12 @@ F<filename> is interpreted as a local file or device.
This is the default if the optional protocol parameter
is omitted.
=item C<protocol = \"ftp\"|\"ftps\"|\"http\"|\"https\"|\"tftp\">
=item C<protocol = \"ftp\"|\"ftps\"|\"http\"|\"https\">
Connect to a remote FTP, HTTP or TFTP server.
Connect to a remote FTP or HTTP server.
The C<server> parameter must also be supplied - see below.
See also: L<guestfs(3)/FTP, HTTP AND TFTP>
See also: L<guestfs(3)/FTP AND HTTP>
=item C<protocol = \"iscsi\">
@@ -401,7 +401,7 @@ is a list of server(s).
Protocol Number of servers required
-------- --------------------------
file List must be empty or param not used at all
ftp|ftps|http|https|tftp Exactly one
ftp|ftps|http|https Exactly one
iscsi Exactly one
nbd Exactly one
rbd Zero or more
@@ -421,8 +421,8 @@ for the protocol is used (see F</etc/services>).
=item C<username>
For the C<ftp>, C<ftps>, C<http>, C<https>, C<iscsi>, C<rbd>, C<ssh>
and C<tftp> protocols, this specifies the remote username.
For the C<ftp>, C<ftps>, C<http>, C<https>, C<iscsi>, C<rbd> and C<ssh>
protocols, this specifies the remote username.
If not given, then the local username is used for C<ssh>, and no authentication
is attempted for ceph. But note this sometimes may give unexpected results, for

View File

@@ -416,7 +416,6 @@ guestfs_int_drive_protocol_to_string (enum drive_protocol protocol)
case drive_protocol_nbd: return "nbd";
case drive_protocol_rbd: return "rbd";
case drive_protocol_ssh: return "ssh";
case drive_protocol_tftp: return "tftp";
}
abort ();
}
@@ -801,10 +800,6 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
data.protocol = drive_protocol_ssh;
drv = create_drive_ssh (g, &data);
}
else if (STREQ (protocol, "tftp")) {
data.protocol = drive_protocol_tftp;
drv = create_drive_curl (g, &data);
}
else {
error (g, _("unknown protocol %s"), protocol);
drv = NULL; /*FALLTHROUGH*/

View File

@@ -216,7 +216,6 @@ enum drive_protocol {
drive_protocol_nbd,
drive_protocol_rbd,
drive_protocol_ssh,
drive_protocol_tftp,
};
enum drive_transport {

View File

@@ -723,10 +723,10 @@ a qcow2 backing file specification, libvirt does not construct an
ephemeral secret object from those, for Ceph authentication. Refer to
L<https://bugzilla.redhat.com/2033247>.
=head3 FTP, HTTP AND TFTP
=head3 FTP AND HTTP
Libguestfs can access remote disks over FTP, FTPS, HTTP, HTTPS
or TFTP protocols.
Libguestfs can access remote disks over FTP, FTPS, HTTP or HTTPS
protocols.
To do this, set the optional C<protocol> and C<server> parameters of
L</guestfs_add_drive_opts> like this:
@@ -739,11 +739,11 @@ L</guestfs_add_drive_opts> like this:
-1);
The C<protocol> can be one of C<"ftp">, C<"ftps">, C<"http">,
C<"https"> or C<"tftp">.
or C<"https">.
C<servers> (the C<server> parameter) is a list which must have a
single element. The single element is a string defining the web,
FTP or TFTP server. The format of this string is documented in
single element. The single element is a string defining the web
or FTP server. The format of this string is documented in
L</guestfs_add_drive_opts>.
=head3 GLUSTER

View File

@@ -1583,7 +1583,6 @@ construct_libvirt_xml_disk (guestfs_h *g,
case drive_protocol_ftps:
case drive_protocol_http:
case drive_protocol_https:
case drive_protocol_tftp:
error (g, _("libvirt does not support the qemu curl driver protocols (ftp, http, etc.); try setting LIBGUESTFS_BACKEND=direct"));
return -1;
}
@@ -2001,7 +2000,6 @@ add_secret (guestfs_h *g, virConnectPtr conn,
case drive_protocol_iscsi:
case drive_protocol_nbd:
case drive_protocol_ssh:
case drive_protocol_tftp:
secret_raw = (unsigned char *) safe_strdup (g, secret);
secret_raw_len = strlen (secret);
}
@@ -2080,7 +2078,6 @@ find_secret (guestfs_h *g,
case drive_protocol_https:
case drive_protocol_nbd:
case drive_protocol_ssh:
case drive_protocol_tftp:
/* set to a default value above */ ;
}

View File

@@ -929,10 +929,6 @@ guestfs_int_drive_source_qemu_param (guestfs_h *g,
case drive_protocol_ssh:
return make_uri (g, "ssh", src->username, src->secret,
&src->servers[0], src->u.exportname);
case drive_protocol_tftp:
return make_uri (g, "tftp", src->username, src->secret,
&src->servers[0], src->u.exportname);
}
abort ();
@@ -1012,7 +1008,6 @@ guestfs_int_discard_possible (guestfs_h *g, struct drive *drv,
case drive_protocol_http:
case drive_protocol_https:
case drive_protocol_ssh:
case drive_protocol_tftp:
NOT_SUPPORTED (g, -1,
_("discard cannot be enabled on this drive: "
"protocol %s does not support discard"),