[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] tools/xenstored: remove the "-R" command line option



commit c4ccad6f3f169f2aa4de02e772891c3e973a6c88
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Tue Nov 21 12:40:47 2023 +0100
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Thu Dec 7 12:56:34 2023 +0000

    tools/xenstored: remove the "-R" command line option
    
    The "-R" (no recovery) command line option enables to omit fixing the
    node store in case of detected inconsistencies.
    
    This might have been of interest in the past, when the node data base
    was kept in a file, but now the usability of this option is zero.
    
    Remove the "-R" option.
    
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 tools/xenstored/core.c | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 1f5505d05e..31968df0ce 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -78,7 +78,6 @@ char **orig_argv;
 
 LIST_HEAD(connections);
 int tracefd = -1;
-static bool recovery = true;
 bool keep_orphans = false;
 static int reopen_log_pipe[2];
 static int reopen_log_pipe0_pollfd_idx = -1;
@@ -2443,9 +2442,6 @@ int remember_string(struct hashtable *hash, const char 
*str)
  * have a corresponding child node (and if so, delete them).  Each valid child
  * is then recursively checked.
  *
- * No deleting is performed if the recovery flag is cleared (i.e. -R was
- * passed on the command line).
- *
  * As we go, we record each node in the given reachable hashtable.  These
  * entries will be used later in clean_store.
  */
@@ -2462,8 +2458,7 @@ static int check_store_step(const void *ctx, struct 
connection *conn,
 
        if (hashtable_search(data->reachable, (void *)node->name)) {
                log("check_store: '%s' is duplicated!", node->name);
-               return recovery ? WALK_TREE_RM_CHILDENTRY
-                               : WALK_TREE_SKIP_CHILDREN;
+               return WALK_TREE_RM_CHILDENTRY;
        }
 
        if (remember_string(data->reachable, node->name))
@@ -2479,7 +2474,7 @@ static int check_store_enoent(const void *ctx, struct 
connection *conn,
 {
        log("check_store: node '%s' not found", name);
 
-       return recovery ? WALK_TREE_RM_CHILDENTRY : WALK_TREE_OK;
+       return WALK_TREE_RM_CHILDENTRY;
 }
 
 
@@ -2504,8 +2499,7 @@ static int clean_store_(const void *key, void *val, void 
*private)
        }
        if (!hashtable_search(reachable, name)) {
                log("clean_store: '%s' is orphaned!", name);
-               if (recovery)
-                       db_delete(NULL, name, NULL);
+               db_delete(NULL, name, NULL);
        }
 
        talloc_free(name);
@@ -2686,8 +2680,6 @@ static void usage(void)
 "  -w, --timeout <what>=<seconds>   set the timeout in seconds for <what>,\n"
 "                          allowed timeout candidates are:\n"
 "                          watch-event: time a watch-event is kept pending\n"
-"  -R, --no-recovery       to request that no recovery should be attempted 
when\n"
-"                          the store is corrupted (debug only),\n"
 "  -K, --keep-orphans      don't delete nodes owned by a domain when the\n"
 "                          domain is deleted (this is a security risk!)\n");
 }
@@ -2710,7 +2702,6 @@ static struct option options[] = {
        { "quota", 1, NULL, 'Q' },
        { "quota-soft", 1, NULL, 'q' },
        { "timeout", 1, NULL, 'w' },
-       { "no-recovery", 0, NULL, 'R' },
        { "keep-orphans", 0, NULL, 'K' },
        { "watch-nb", 1, NULL, 'W' },
 #ifndef NO_LIVE_UPDATE
@@ -2831,7 +2822,7 @@ int main(int argc, char *argv[])
        orig_argv = argv;
 
        while ((opt = getopt_long(argc, argv,
-                                 "E:F:H::KNS:t:A:M:Q:q:T:RW:w:U",
+                                 "E:F:H::KNS:t:A:M:Q:q:T:W:w:U",
                                  options, NULL)) != -1) {
                switch (opt) {
                case 'E':
@@ -2846,9 +2837,6 @@ int main(int argc, char *argv[])
                case 'N':
                        dofork = false;
                        break;
-               case 'R':
-                       recovery = false;
-                       break;
                case 'S':
                        hard_quotas[ACC_NODESZ].val = get_optval_uint(optarg);
                        break;
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.