Blame SOURCES/0053-generator-Deprecate-direct-mode-guestfs_set_direct-g.patch

151578
From 9dcd0326952b2d0ad6f95f51bd9e0f5487603e30 Mon Sep 17 00:00:00 2001
151578
From: "Richard W.M. Jones" <rjones@redhat.com>
151578
Date: Thu, 2 Mar 2017 12:42:46 +0000
151578
Subject: [PATCH] generator: Deprecate direct mode (guestfs_set_direct,
151578
 guestfs_get_direct).
151578
151578
(cherry picked from commit 26948d5cb17391a32856b18b8a5d6ae58a179507)
151578
---
151578
 generator/actions_properties.ml            | 28 ----------------------------
151578
 generator/actions_properties_deprecated.ml | 30 ++++++++++++++++++++++++++++++
151578
 rescue/rescue.c                            |  3 +++
151578
 test-tool/test-tool.c                      |  1 -
151578
 4 files changed, 33 insertions(+), 29 deletions(-)
151578
151578
diff --git a/generator/actions_properties.ml b/generator/actions_properties.ml
151578
index 8f6455b81..87144b14f 100644
151578
--- a/generator/actions_properties.ml
151578
+++ b/generator/actions_properties.ml
151578
@@ -259,34 +259,6 @@ C<guestfs_set_event_callback>)." };
151578
     longdesc = "\
151578
 Return the command trace flag." };
151578
 
151578
-  { defaults with
151578
-    name = "set_direct"; added = (1, 0, 72);
151578
-    style = RErr, [Bool "direct"], [];
151578
-    fish_alias = ["direct"]; config_only = true;
151578
-    blocking = false;
151578
-    shortdesc = "enable or disable direct appliance mode";
151578
-    longdesc = "\
151578
-If the direct appliance mode flag is enabled, then stdin and
151578
-stdout are passed directly through to the appliance once it
151578
-is launched.
151578
-
151578
-One consequence of this is that log messages aren't caught
151578
-by the library and handled by C<guestfs_set_log_message_callback>,
151578
-but go straight to stdout.
151578
-
151578
-You probably don't want to use this unless you know what you
151578
-are doing.
151578
-
151578
-The default is disabled." };
151578
-
151578
-  { defaults with
151578
-    name = "get_direct"; added = (1, 0, 72);
151578
-    style = RBool "direct", [], [];
151578
-    blocking = false;
151578
-    shortdesc = "get direct appliance mode flag";
151578
-    longdesc = "\
151578
-Return the direct appliance mode flag." };
151578
-
151578
   { defaults with
151578
     name = "set_recovery_proc"; added = (1, 0, 77);
151578
     style = RErr, [Bool "recoveryproc"], [];
151578
diff --git a/generator/actions_properties_deprecated.ml b/generator/actions_properties_deprecated.ml
151578
index def17b926..53277822e 100644
151578
--- a/generator/actions_properties_deprecated.ml
151578
+++ b/generator/actions_properties_deprecated.ml
151578
@@ -125,6 +125,36 @@ Return the current backend.
151578
 
151578
 See C<guestfs_set_backend> and L<guestfs(3)/BACKEND>." };
151578
 
151578
+  { defaults with
151578
+    name = "set_direct"; added = (1, 0, 72);
151578
+    style = RErr, [Bool "direct"], [];
151578
+    deprecated_by = Deprecated_no_replacement;
151578
+    fish_alias = ["direct"]; config_only = true;
151578
+    blocking = false;
151578
+    shortdesc = "enable or disable direct appliance mode";
151578
+    longdesc = "\
151578
+If the direct appliance mode flag is enabled, then stdin and
151578
+stdout are passed directly through to the appliance once it
151578
+is launched.
151578
+
151578
+One consequence of this is that log messages aren't caught
151578
+by the library and handled by C<guestfs_set_log_message_callback>,
151578
+but go straight to stdout.
151578
+
151578
+You probably don't want to use this unless you know what you
151578
+are doing.
151578
+
151578
+The default is disabled." };
151578
+
151578
+  { defaults with
151578
+    name = "get_direct"; added = (1, 0, 72);
151578
+    style = RBool "direct", [], [];
151578
+    deprecated_by = Deprecated_no_replacement;
151578
+    blocking = false;
151578
+    shortdesc = "get direct appliance mode flag";
151578
+    longdesc = "\
151578
+Return the direct appliance mode flag." };
151578
+
151578
 ]
151578
 
151578
 let daemon_functions = [
151578
diff --git a/rescue/rescue.c b/rescue/rescue.c
151578
index 45967b2ad..b692e5a07 100644
151578
--- a/rescue/rescue.c
151578
+++ b/rescue/rescue.c
151578
@@ -295,9 +295,12 @@ main (int argc, char *argv[])
151578
     usage (EXIT_FAILURE);
151578
   }
151578
 
151578
+#pragma GCC diagnostic push
151578
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
151578
   /* Setting "direct mode" is required for the rescue appliance. */
151578
   if (guestfs_set_direct (g, 1) == -1)
151578
     exit (EXIT_FAILURE);
151578
+#pragma GCC diagnostic pop
151578
 
151578
   {
151578
     /* The libvirt backend doesn't support direct mode.  As a temporary
151578
diff --git a/test-tool/test-tool.c b/test-tool/test-tool.c
151578
index 20e2a32fa..2ae266d7d 100644
151578
--- a/test-tool/test-tool.c
151578
+++ b/test-tool/test-tool.c
151578
@@ -224,7 +224,6 @@ main (int argc, char *argv[])
151578
   p = guestfs_get_cachedir (g);
151578
   printf ("guestfs_get_cachedir: %s\n", p ? : "(null)");
151578
   free (p);
151578
-  printf ("guestfs_get_direct: %d\n", guestfs_get_direct (g));
151578
   p = guestfs_get_hv (g);
151578
   printf ("guestfs_get_hv: %s\n", p);
151578
   free (p);
151578
-- 
151578
2.14.3
151578