From 9dcd0326952b2d0ad6f95f51bd9e0f5487603e30 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 2 Mar 2017 12:42:46 +0000
Subject: [PATCH] generator: Deprecate direct mode (guestfs_set_direct,
guestfs_get_direct).
(cherry picked from commit 26948d5cb17391a32856b18b8a5d6ae58a179507)
---
generator/actions_properties.ml | 28 ----------------------------
generator/actions_properties_deprecated.ml | 30 ++++++++++++++++++++++++++++++
rescue/rescue.c | 3 +++
test-tool/test-tool.c | 1 -
4 files changed, 33 insertions(+), 29 deletions(-)
diff --git a/generator/actions_properties.ml b/generator/actions_properties.ml
index 8f6455b81..87144b14f 100644
--- a/generator/actions_properties.ml
+++ b/generator/actions_properties.ml
@@ -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"], [];
diff --git a/generator/actions_properties_deprecated.ml b/generator/actions_properties_deprecated.ml
index def17b926..53277822e 100644
--- a/generator/actions_properties_deprecated.ml
+++ b/generator/actions_properties_deprecated.ml
@@ -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 = [
diff --git a/rescue/rescue.c b/rescue/rescue.c
index 45967b2ad..b692e5a07 100644
--- a/rescue/rescue.c
+++ b/rescue/rescue.c
@@ -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
diff --git a/test-tool/test-tool.c b/test-tool/test-tool.c
index 20e2a32fa..2ae266d7d 100644
--- a/test-tool/test-tool.c
+++ b/test-tool/test-tool.c
@@ -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);
--
2.14.3