|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
Backport of the guestfs_aug_clear API from upstream development branch
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
(commit 66477d07e37ffe66c).
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
diff -ur libguestfs-1.2.2.orig/daemon/augeas.c libguestfs-1.2.2/daemon/augeas.c
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
--- libguestfs-1.2.2.orig/daemon/augeas.c 2010-04-12 19:03:41.000000000 +0100
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+++ libguestfs-1.2.2/daemon/augeas.c 2010-04-14 10:03:10.307680521 +0100
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
@@ -210,6 +210,26 @@
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
}
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
int
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+do_aug_clear (const char *path)
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+{
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+#ifdef HAVE_AUGEAS
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ int r;
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ NEED_AUG (-1);
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ r = aug_set (aug, path, NULL);
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ if (r == -1) {
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ reply_with_error ("Augeas clear failed");
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ return -1;
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ return 0;
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+#else
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ NOT_AVAILABLE (-1);
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+#endif
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+}
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+int
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
do_aug_insert (const char *path, const char *label, int before)
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
{
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
#ifdef HAVE_AUGEAS
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
diff -ur libguestfs-1.2.2.orig/src/generator.ml libguestfs-1.2.2/src/generator.ml
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
--- libguestfs-1.2.2.orig/src/generator.ml 2010-04-12 19:05:28.000000000 +0100
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+++ libguestfs-1.2.2/src/generator.ml 2010-04-14 10:03:10.312679892 +0100
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
@@ -1238,7 +1238,12 @@
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
[], (* XXX Augeas code needs tests. *)
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
"set Augeas path to value",
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
"\
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
-Set the value associated with C<path> to C<value>.");
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+Set the value associated with C<path> to C<val>.
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+In the Augeas API, it is possible to clear a node by setting
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+the value to NULL. Due to an oversight in the libguestfs API
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+you cannot do that with this call. Instead you must use the
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+C<guestfs_aug_clear> call.");
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
("aug_insert", (RErr, [String "augpath"; String "label"; Bool "before"]), 21, [Optional "augeas"],
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
[], (* XXX Augeas code needs tests. *)
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
@@ -4400,6 +4405,13 @@
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
You will get undefined results for other partition table
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
types (see C<guestfs_part_get_parttype>).");
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ ("aug_clear", (RErr, [String "augpath"]), 239, [Optional "augeas"],
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ [], (* XXX Augeas code needs tests. *)
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ "clear Augeas path",
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+ "\
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+Set the value associated with C<path> to C<NULL>. This
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+is the same as the L<augtool(1)> C<clear> command.");
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
]
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
let all_functions = non_daemon_functions @ daemon_functions
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
diff -ur libguestfs-1.2.2.orig/src/MAX_PROC_NR libguestfs-1.2.2/src/MAX_PROC_NR
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
--- libguestfs-1.2.2.orig/src/MAX_PROC_NR 2010-04-12 19:06:21.000000000 +0100
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+++ libguestfs-1.2.2/src/MAX_PROC_NR 2010-04-14 10:03:43.885055262 +0100
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
@@ -1 +1 @@
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
-236
|
|
![](https://seccdn.libravatar.org/avatar/2b144df64913845151df534542e1c73358afff4b3b67d9228c548513b08c6d02?s=16&d=retro) |
f617d8b |
+239
|