mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
Remove sheepdog support
This was discontinued in qemu quite a long time ago.
This commit is contained in:
@@ -1202,18 +1202,6 @@ The equivalent API command would be:
|
||||
|
||||
><fs> add pool/disk protocol:rbd server:tcp:example.com:port
|
||||
|
||||
=head2 B<-a sheepdog://[example.com[:port]]/volume/image>
|
||||
|
||||
Add a disk image located on a Sheepdog volume.
|
||||
|
||||
The server name is optional. Although libguestfs and Sheepdog
|
||||
supports multiple servers, only at most one server can be specified
|
||||
when using this URI syntax.
|
||||
|
||||
The equivalent API command would be:
|
||||
|
||||
><fs> add volume protocol:sheepdog [server:tcp:example.com]
|
||||
|
||||
=head2 B<-a ssh://[user@]example.com[:port]/disk.img>
|
||||
|
||||
Add a disk image located on a remote server, accessed using the Secure
|
||||
|
||||
@@ -63,13 +63,6 @@ grep -sq 'add_drive "pool/disk" "protocol:rbd" "server:tcp:example.com:6789"' te
|
||||
$VG guestfish -x -a rbd:///pool/disk </dev/null >test-add-uri.out 2>&1
|
||||
grep -sq 'add_drive "pool/disk" "protocol:rbd"' test-add-uri.out || fail
|
||||
|
||||
# sheepdog
|
||||
$VG guestfish -x -a sheepdog:///volume/image </dev/null >test-add-uri.out 2>&1
|
||||
grep -sq 'add_drive "volume/image" "protocol:sheepdog"' test-add-uri.out || fail
|
||||
|
||||
$VG guestfish -x -a sheepdog://example.com:3000/volume/image </dev/null >test-add-uri.out 2>&1
|
||||
grep -sq 'add_drive "volume/image" "protocol:sheepdog" "server:tcp:example.com:3000"' test-add-uri.out || fail
|
||||
|
||||
# ssh
|
||||
$VG guestfish -x -a ssh://example.com/disk.img </dev/null >test-add-uri.out 2>&1
|
||||
grep -sq 'add_drive "/disk.img" "protocol:ssh" "server:tcp:example.com"' test-add-uri.out || fail
|
||||
|
||||
@@ -382,13 +382,6 @@ The C<secret> parameter may be supplied. See below.
|
||||
|
||||
See also: L<guestfs(3)/CEPH>.
|
||||
|
||||
=item C<protocol = \"sheepdog\">
|
||||
|
||||
Connect to the Sheepdog server.
|
||||
The C<server> parameter may also be supplied - see below.
|
||||
|
||||
See also: L<guestfs(3)/SHEEPDOG>.
|
||||
|
||||
=item C<protocol = \"ssh\">
|
||||
|
||||
Connect to the Secure Shell (ssh) server.
|
||||
@@ -412,7 +405,6 @@ is a list of server(s).
|
||||
iscsi Exactly one
|
||||
nbd Exactly one
|
||||
rbd Zero or more
|
||||
sheepdog Zero or more
|
||||
ssh Exactly one
|
||||
|
||||
Each list element is a string specifying a server. The string must be
|
||||
|
||||
45
lib/drives.c
45
lib/drives.c
@@ -261,46 +261,6 @@ create_drive_rbd (guestfs_h *g,
|
||||
return create_drive_non_file (g, data);
|
||||
}
|
||||
|
||||
static struct drive *
|
||||
create_drive_sheepdog (guestfs_h *g,
|
||||
const struct drive_create_data *data)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (data->username != NULL) {
|
||||
error (g, _("sheepdog: you cannot specify a username with this protocol"));
|
||||
return NULL;
|
||||
}
|
||||
if (data->secret != NULL) {
|
||||
error (g, _("sheepdog: you cannot specify a secret with this protocol"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < data->nr_servers; ++i) {
|
||||
if (data->servers[i].transport != drive_transport_none &&
|
||||
data->servers[i].transport != drive_transport_tcp) {
|
||||
error (g, _("sheepdog: only tcp transport is supported"));
|
||||
return NULL;
|
||||
}
|
||||
if (data->servers[i].port == 0) {
|
||||
error (g, _("sheepdog: port number must be specified"));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (STREQ (data->exportname, "")) {
|
||||
error (g, _("sheepdog: volume parameter should not be an empty string"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (data->exportname[0] == '/') {
|
||||
error (g, _("sheepdog: volume parameter must not begin with a '/'"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return create_drive_non_file (g, data);
|
||||
}
|
||||
|
||||
static struct drive *
|
||||
create_drive_ssh (guestfs_h *g,
|
||||
const struct drive_create_data *data)
|
||||
@@ -455,7 +415,6 @@ guestfs_int_drive_protocol_to_string (enum drive_protocol protocol)
|
||||
case drive_protocol_iscsi: return "iscsi";
|
||||
case drive_protocol_nbd: return "nbd";
|
||||
case drive_protocol_rbd: return "rbd";
|
||||
case drive_protocol_sheepdog: return "sheepdog";
|
||||
case drive_protocol_ssh: return "ssh";
|
||||
case drive_protocol_tftp: return "tftp";
|
||||
}
|
||||
@@ -838,10 +797,6 @@ guestfs_impl_add_drive_opts (guestfs_h *g, const char *filename,
|
||||
data.protocol = drive_protocol_rbd;
|
||||
drv = create_drive_rbd (g, &data);
|
||||
}
|
||||
else if (STREQ (protocol, "sheepdog")) {
|
||||
data.protocol = drive_protocol_sheepdog;
|
||||
drv = create_drive_sheepdog (g, &data);
|
||||
}
|
||||
else if (STREQ (protocol, "ssh")) {
|
||||
data.protocol = drive_protocol_ssh;
|
||||
drv = create_drive_ssh (g, &data);
|
||||
|
||||
@@ -215,7 +215,6 @@ enum drive_protocol {
|
||||
drive_protocol_iscsi,
|
||||
drive_protocol_nbd,
|
||||
drive_protocol_rbd,
|
||||
drive_protocol_sheepdog,
|
||||
drive_protocol_ssh,
|
||||
drive_protocol_tftp,
|
||||
};
|
||||
|
||||
@@ -832,21 +832,7 @@ L<https://bugs.launchpad.net/qemu/+bug/1155677>
|
||||
|
||||
=head3 SHEEPDOG
|
||||
|
||||
Libguestfs can access Sheepdog disks.
|
||||
|
||||
To do this, set the optional C<protocol> and C<server> parameters of
|
||||
L</guestfs_add_drive_opts> like this:
|
||||
|
||||
char **servers = { /* optional servers ... */ NULL };
|
||||
guestfs_add_drive_opts (g, "volume",
|
||||
GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
|
||||
GUESTFS_ADD_DRIVE_OPTS_PROTOCOL, "sheepdog",
|
||||
GUESTFS_ADD_DRIVE_OPTS_SERVER, servers,
|
||||
-1);
|
||||
|
||||
The optional list of C<servers> may be zero or more server addresses
|
||||
(C<"hostname:port">). The format of the server strings is documented
|
||||
in L</guestfs_add_drive_opts>.
|
||||
Sheepdog support was removed in libguestfs 1.54 (2024).
|
||||
|
||||
=head3 SSH
|
||||
|
||||
|
||||
@@ -1543,8 +1543,6 @@ construct_libvirt_xml_disk (guestfs_h *g,
|
||||
protocol_str = "nbd"; goto network_protocols;
|
||||
case drive_protocol_rbd:
|
||||
protocol_str = "rbd"; goto network_protocols;
|
||||
case drive_protocol_sheepdog:
|
||||
protocol_str = "sheepdog"; goto network_protocols;
|
||||
case drive_protocol_ssh:
|
||||
protocol_str = "ssh";
|
||||
/*FALLTHROUGH*/
|
||||
@@ -2002,7 +2000,6 @@ add_secret (guestfs_h *g, virConnectPtr conn,
|
||||
case drive_protocol_https:
|
||||
case drive_protocol_iscsi:
|
||||
case drive_protocol_nbd:
|
||||
case drive_protocol_sheepdog:
|
||||
case drive_protocol_ssh:
|
||||
case drive_protocol_tftp:
|
||||
secret_raw = (unsigned char *) safe_strdup (g, secret);
|
||||
@@ -2082,7 +2079,6 @@ find_secret (guestfs_h *g,
|
||||
case drive_protocol_http:
|
||||
case drive_protocol_https:
|
||||
case drive_protocol_nbd:
|
||||
case drive_protocol_sheepdog:
|
||||
case drive_protocol_ssh:
|
||||
case drive_protocol_tftp:
|
||||
/* set to a default value above */ ;
|
||||
|
||||
@@ -926,14 +926,6 @@ guestfs_int_drive_source_qemu_param (guestfs_h *g,
|
||||
secret ? secret : "");
|
||||
}
|
||||
|
||||
case drive_protocol_sheepdog:
|
||||
if (src->nr_servers == 0)
|
||||
return safe_asprintf (g, "sheepdog:%s", src->u.exportname);
|
||||
else /* XXX How to pass multiple hosts? */
|
||||
return safe_asprintf (g, "sheepdog:%s:%d:%s",
|
||||
src->servers[0].u.hostname, src->servers[0].port,
|
||||
src->u.exportname);
|
||||
|
||||
case drive_protocol_ssh:
|
||||
return make_uri (g, "ssh", src->username, src->secret,
|
||||
&src->servers[0], src->u.exportname);
|
||||
@@ -1012,7 +1004,6 @@ guestfs_int_discard_possible (guestfs_h *g, struct drive *drv,
|
||||
case drive_protocol_iscsi:
|
||||
case drive_protocol_nbd:
|
||||
case drive_protocol_rbd:
|
||||
case drive_protocol_sheepdog: /* XXX depends on server version */
|
||||
break;
|
||||
|
||||
/* Protocols which don't support discard. */
|
||||
|
||||
@@ -79,13 +79,6 @@ check_output
|
||||
grep -sq -- '-drive file=nbd:1.2.3.4:1234,' "$DEBUG_QEMU_FILE" || fail nbd
|
||||
rm "$DEBUG_QEMU_FILE"
|
||||
|
||||
# Sheepdog.
|
||||
|
||||
$guestfish -d sheepdog run ||:
|
||||
check_output
|
||||
grep -sq -- '-drive file=sheepdog:volume,' "$DEBUG_QEMU_FILE" || fail sheepdog
|
||||
rm "$DEBUG_QEMU_FILE"
|
||||
|
||||
# Local, stored in a pool.
|
||||
|
||||
$guestfish -d pool1 run ||:
|
||||
|
||||
@@ -97,23 +97,6 @@
|
||||
</devices>
|
||||
</domain>
|
||||
|
||||
<domain type='test' xmlns:test='http://libvirt.org/schemas/domain/test/1.0'>
|
||||
<test:runstate>5</test:runstate> <!-- 5 == VIR_DOMAIN_SHUTOFF -->
|
||||
<name>sheepdog</name>
|
||||
<memory>1048576</memory>
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<devices>
|
||||
<disk type='network' device='disk'>
|
||||
<driver name='qemu'/>
|
||||
<source protocol='sheepdog' name='volume'/>
|
||||
<target dev='vda' bus='virtio'/>
|
||||
</disk>
|
||||
</devices>
|
||||
</domain>
|
||||
|
||||
<domain type='test' xmlns:test='http://libvirt.org/schemas/domain/test/1.0'>
|
||||
<test:runstate>5</test:runstate> <!-- 5 == VIR_DOMAIN_SHUTOFF -->
|
||||
<name>pool1</name>
|
||||
|
||||
@@ -109,16 +109,6 @@ check_output
|
||||
grep -sq -- '-drive file=nbd:unix:/socket,' "$DEBUG_QEMU_FILE" || fail
|
||||
rm "$DEBUG_QEMU_FILE"
|
||||
|
||||
# Sheepdog.
|
||||
|
||||
guestfish <<EOF ||:
|
||||
add "volume" "format:raw" "protocol:sheepdog"
|
||||
run
|
||||
EOF
|
||||
check_output
|
||||
grep -sq -- '-drive file=sheepdog:volume,' "$DEBUG_QEMU_FILE" || fail
|
||||
rm "$DEBUG_QEMU_FILE"
|
||||
|
||||
# SSH.
|
||||
|
||||
guestfish <<EOF ||:
|
||||
|
||||
Reference in New Issue
Block a user