generator: Deprecate direct mode (guestfs_set_direct, guestfs_get_direct).

This commit is contained in:
Richard W.M. Jones
2017-03-02 12:42:46 +00:00
parent a1843b9d72
commit 26948d5cb1
4 changed files with 33 additions and 29 deletions

View File

@@ -259,34 +259,6 @@ C<guestfs_set_event_callback>)." };
longdesc = "\
Return the command trace flag." };
{ defaults with
name = "set_direct"; added = (1, 0, 72);
style = RErr, [Bool "direct"], [];
fish_alias = ["direct"]; config_only = true;
blocking = false;
shortdesc = "enable or disable direct appliance mode";
longdesc = "\
If the direct appliance mode flag is enabled, then stdin and
stdout are passed directly through to the appliance once it
is launched.
One consequence of this is that log messages aren't caught
by the library and handled by C<guestfs_set_log_message_callback>,
but go straight to stdout.
You probably don't want to use this unless you know what you
are doing.
The default is disabled." };
{ defaults with
name = "get_direct"; added = (1, 0, 72);
style = RBool "direct", [], [];
blocking = false;
shortdesc = "get direct appliance mode flag";
longdesc = "\
Return the direct appliance mode flag." };
{ defaults with
name = "set_recovery_proc"; added = (1, 0, 77);
style = RErr, [Bool "recoveryproc"], [];

View File

@@ -125,6 +125,36 @@ Return the current backend.
See C<guestfs_set_backend> and L<guestfs(3)/BACKEND>." };
{ defaults with
name = "set_direct"; added = (1, 0, 72);
style = RErr, [Bool "direct"], [];
deprecated_by = Deprecated_no_replacement;
fish_alias = ["direct"]; config_only = true;
blocking = false;
shortdesc = "enable or disable direct appliance mode";
longdesc = "\
If the direct appliance mode flag is enabled, then stdin and
stdout are passed directly through to the appliance once it
is launched.
One consequence of this is that log messages aren't caught
by the library and handled by C<guestfs_set_log_message_callback>,
but go straight to stdout.
You probably don't want to use this unless you know what you
are doing.
The default is disabled." };
{ defaults with
name = "get_direct"; added = (1, 0, 72);
style = RBool "direct", [], [];
deprecated_by = Deprecated_no_replacement;
blocking = false;
shortdesc = "get direct appliance mode flag";
longdesc = "\
Return the direct appliance mode flag." };
]
let daemon_functions = [

View File

@@ -295,9 +295,12 @@ main (int argc, char *argv[])
usage (EXIT_FAILURE);
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
/* Setting "direct mode" is required for the rescue appliance. */
if (guestfs_set_direct (g, 1) == -1)
exit (EXIT_FAILURE);
#pragma GCC diagnostic pop
{
/* The libvirt backend doesn't support direct mode. As a temporary

View File

@@ -224,7 +224,6 @@ main (int argc, char *argv[])
p = guestfs_get_cachedir (g);
printf ("guestfs_get_cachedir: %s\n", p ? : "(null)");
free (p);
printf ("guestfs_get_direct: %d\n", guestfs_get_direct (g));
p = guestfs_get_hv (g);
printf ("guestfs_get_hv: %s\n", p);
free (p);