Hello

We are using libguestfs with nested partitions: One partition encrypted with LUKS include a GPT and several partition. In order to make the nested partition available to the system after the cryptsetup-open, partprobe need to be run.
I guess it is true for all kind of nested partitions (encrypted or not).

This patch add a partprobe call in the API.

Regards

Philippe



--


*This email and any attachment contains EasyMile’s confidential information, and must not be modified or circulated without EasyMile’s prior written consent. It is intended exclusively for their recipient.s. If you received this message by mistake, please notify us promptly and immediately delete this email and any of its attachments.*

*As data controller, EasyMile processes personal data, in compliance with the European GDPR (EU) 2016/679 of 27 April 2016. To exercise your rights, you can contact EasyMile at priv...@easymile.com, and if necessary, you may contact the local competent supervisory authority.”*

*Cet e-mail et toute pièce jointe contiennent des informations confidentielles d'EasyMile et ne doivent pas être modifiés ou diffusés sans le consentement écrit préalable d'EasyMile. Ils sont destinés exclusivement à leur destinataire.s. Si vous avez reçu ce message par erreur, veuillez nous en informer rapidement et supprimer immédiatement cet e-mail et toutes ses pièces jointes.  *

*En tant que responsable de traitement, EasyMile traite des données personnelles, conformément au RGPD européen (UE) 2016/679 du 27 avril 2016. Pour exercer vos droits, vous pouvez contacter EasyMile à  priv...@easymile.com <mailto:priv...@easymile.com>, et si nécessaire, vous pouvez contacter l'autorité de contrôle locale compétente.*
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index bb2e58d01..8c34f3634 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -164,6 +164,7 @@ guestfsd_SOURCES = \
 	optgroups.c \
 	optgroups.h \
 	parted.c \
+	partprobe.c \
 	pingdaemon.c \
 	proto.c \
 	readdir.c \
diff --git a/docs/C_SOURCE_FILES b/docs/C_SOURCE_FILES
index 7a20e5594..0e845dcec 100644
--- a/docs/C_SOURCE_FILES
+++ b/docs/C_SOURCE_FILES
@@ -125,6 +125,7 @@ daemon/ntfsclone.c
 daemon/optgroups.c
 daemon/optgroups.h
 daemon/parted.c
+daemon/partprobe.c
 daemon/pingdaemon.c
 daemon/proto.c
 daemon/readdir.c
diff --git a/generator/actions_core.ml b/generator/actions_core.ml
index addbe4ec1..f63065426 100644
--- a/generator/actions_core.ml
+++ b/generator/actions_core.ml
@@ -5110,6 +5110,16 @@ partition table), C<gpt> (a GPT/EFI-style partition table).  Other
 values are possible, although unusual.  See C<guestfs_part_init>
 for a full list." };
 
+  { defaults with
+    name = "partprobe"; added = (1, 0, 54);
+    style =  RErr, [String (Device, "device")], [];
+    tests = [];
+    shortdesc = "run partprobe";
+    longdesc = "\
+This command runs the C<partprobe> on a device in order to inform
+the OS of partition table change
+usage for C<path>.It is neede in case of nested partition."};
+
   { defaults with
     name = "fill"; added = (1, 0, 79);
     style = RErr, [Int "c"; Int "len"; String (Pathname, "path")], [];
diff --git a/generator/proc_nr.ml b/generator/proc_nr.ml
index f71a849c9..342ba6e82 100644
--- a/generator/proc_nr.ml
+++ b/generator/proc_nr.ml
@@ -516,6 +516,7 @@ let proc_nr = [
 511, "internal_readdir";
 512, "clevis_luks_unlock";
 513, "inspect_get_build_id";
+514, "partprobe";
 ]
 
 (* End of list.  If adding a new entry, add it at the end of the list
diff --git a/lib/MAX_PROC_NR b/lib/MAX_PROC_NR
index 31cf34b8d..a08796291 100644
--- a/lib/MAX_PROC_NR
+++ b/lib/MAX_PROC_NR
@@ -1 +1 @@
-513
+514
_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs

Reply via email to