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

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