Blame SOURCES/0008-get-kernel-sparsify-set-networking-for-key-ID-clevis.patch

ca2a74
From 77a10b30f6f6fdb1648b12f68147e6a894526802 Mon Sep 17 00:00:00 2001
ca2a74
From: Laszlo Ersek <lersek@redhat.com>
ca2a74
Date: Tue, 28 Jun 2022 13:57:00 +0200
ca2a74
Subject: [PATCH] get-kernel, sparsify: set networking for "--key ID:clevis"
ca2a74
ca2a74
Call the OCaml-language helper "key_store_requires_network" in those OCaml
ca2a74
utilities that pass "~key_opts:true" to "create_standard_options", and do
ca2a74
not have any code related to networking yet.
ca2a74
ca2a74
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1809453
ca2a74
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
ca2a74
Message-Id: <20220628115702.5584-3-lersek@redhat.com>
ca2a74
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
ca2a74
(cherry picked from commit 4f66f0892e6fd75d10dcfa2f9e94b3e32bdb906e)
ca2a74
---
ca2a74
 get-kernel/get_kernel.ml | 1 +
ca2a74
 sparsify/copying.ml      | 1 +
ca2a74
 sparsify/in_place.ml     | 1 +
ca2a74
 3 files changed, 3 insertions(+)
ca2a74
ca2a74
diff --git a/get-kernel/get_kernel.ml b/get-kernel/get_kernel.ml
ca2a74
index e485cf495..9c2aa17c2 100644
ca2a74
--- a/get-kernel/get_kernel.ml
ca2a74
+++ b/get-kernel/get_kernel.ml
ca2a74
@@ -176,6 +176,7 @@ let main () =
ca2a74
   (* Connect to libguestfs. *)
ca2a74
   let g = open_guestfs () in
ca2a74
   add g;
ca2a74
+  g#set_network (key_store_requires_network ks);
ca2a74
   g#launch ();
ca2a74
 
ca2a74
   (* Decrypt the disks. *)
ca2a74
diff --git a/sparsify/copying.ml b/sparsify/copying.ml
ca2a74
index 39d06c94c..21a603d63 100644
ca2a74
--- a/sparsify/copying.ml
ca2a74
+++ b/sparsify/copying.ml
ca2a74
@@ -187,6 +187,7 @@ You can ignore this warning or change it to a hard failure using the
ca2a74
       let machine_readable = machine_readable () <> None in
ca2a74
       Progress.set_up_progress_bar ~machine_readable g
ca2a74
     );
ca2a74
+    g#set_network (key_store_requires_network ks);
ca2a74
     g#launch ();
ca2a74
 
ca2a74
     g in
ca2a74
diff --git a/sparsify/in_place.ml b/sparsify/in_place.ml
ca2a74
index 00f0e0564..0eec63e6f 100644
ca2a74
--- a/sparsify/in_place.ml
ca2a74
+++ b/sparsify/in_place.ml
ca2a74
@@ -58,6 +58,7 @@ let run disk format ignores zeroes ks =
ca2a74
     let machine_readable = machine_readable () <> None in
ca2a74
     Progress.set_up_progress_bar ~machine_readable g
ca2a74
   );
ca2a74
+  g#set_network (key_store_requires_network ks);
ca2a74
   g#launch ();
ca2a74
 
ca2a74
   (* If discard is not supported in the appliance, we must return exit
ca2a74
-- 
ca2a74
2.31.1
ca2a74