[PATCH] Add partprobe call in the API
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 privacy@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 à privacy@easymile.com <mailto:privacy@easymile.com>, et si nécessaire, vous pouvez contacter l'autorité de contrôle locale compétente.*
On Tue, Jun 20, 2023 at 02:09:36PM +0200, Philippe Midol-Monnet wrote:
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.*
(You might want to change this warning, as it may prevent us from including this code upstream ...)
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);
This should be the next version, ie. (1, 51, 4)
+ 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
The patch is fine as far as it goes, but you'll need to include the new partprobe.c file :-) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com nbdkit - Flexible, fast NBD server with plugins https://gitlab.com/nbdkit/nbdkit
Hello Sorry for the missing file and for the email warning. I will check with my company for the warning and send you a new version. Regards Philippe On 20/06/2023 14:30, Richard W.M. Jones wrote:
On Tue, Jun 20, 2023 at 02:09:36PM +0200, Philippe Midol-Monnet wrote:
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.* (You might want to change this warning, as it may prevent us from including this code upstream ...)
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); This should be the next version, ie. (1, 51, 4)
+ 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 The patch is fine as far as it goes, but you'll need to include the new partprobe.c file :-)
Rich.
-- *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 privacy@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 à privacy@easymile.com <mailto:privacy@easymile.com>, et si nécessaire, vous pouvez contacter l'autorité de contrôle locale compétente.*
Hello You will find in the joined file a new version of the patch including the missing code. The automatic disclaimer automatically added to end of this e-mail does not apply to the patch file as seen with our legal team. Regards Philippe On 20/06/2023 14:30, Richard W.M. Jones wrote:
On Tue, Jun 20, 2023 at 02:09:36PM +0200, Philippe Midol-Monnet wrote:
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.* (You might want to change this warning, as it may prevent us from including this code upstream ...)
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); This should be the next version, ie. (1, 51, 4)
+ 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 The patch is fine as far as it goes, but you'll need to include the new partprobe.c file :-)
Rich.
-- *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 privacy@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 à privacy@easymile.com <mailto:privacy@easymile.com>, et si nécessaire, vous pouvez contacter l'autorité de contrôle locale compétente.*
participants (2)
-
Philippe Midol-Monnet -
Richard W.M. Jones