Skip to contentSkip to conversation

libxl: clean up trailing whitespaces in code.

PATCH In review Wei Liu 2 participants 5 messages Jul 16, 2011 – Jul 19, 2011

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 libxl: clean up trailing whitespaces in code.

commit 46926d5d610d8f6cf60ede47ce0c40a63a2c9e43

Author: Wei Liu <[email protected]>
Date:   Sat Jul 16 16:01:57 2011 +0800

libxl: clean up trailing whitespaces in code.

find -not -iname '*.txt' -type f -print0 | xargs -0 sed -i.bak -E 's/[[:space:]]*$//'

tools/libxl/bash-completion +1 -1
index adf994f..b184f74 100644
@@ -9,7 +9,7 @@ _xl()
 	COMPREPLY=()
 	cur="${COMP_WORDS[COMP_CWORD]}"
 	xl=xl
-	
+
 	if [[ $COMP_CWORD == 1 ]] ; then
 		opts=`${xl} help 2>/dev/null | sed '1,4d' | awk '{print $1}' | sed 's/$/ ,/g'` && COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
 		return 0
tools/libxl/gentest.py +4 -4
index 5828cfd..47c7f0b 100644
@@ -21,10 +21,10 @@ if __name__ == '__main__':
         sys.exit(1)
 
     random.seed()
-    
+
     idl = sys.argv[1]
     (_,types) = libxltypes.parse(idl)
-                    
+
     impl = sys.argv[2]
     f = open(impl, "w")
     f.write("""
@@ -39,7 +39,7 @@ int main(int argc, char **argv)
         f.write("    %s %s_val;\n" % (ty.typename, ty.typename))
     f.write("    int rc;\n")
     f.write("\n")
-                
+
     for ty in [t for t in types if isinstance(t,libxltypes.Enumeration)]:
         f.write("    printf(\"%s -- to string:\\n\");\n" % (ty.typename))
         for v in ty.values:
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
             f.write("    %s_val = -1;\n" % (ty.typename))
             f.write("    rc = %s_from_string(\"%s\", &%s_val);\n" %\
                     (ty.typename, n, ty.typename))
-                    
+
             f.write("    printf(\"\\t%s = \\\"%%s\\\" = %%d (rc %%d)\\n\", \"%s\", %s_val, rc);\n" %\
                     (v, n, ty.typename))
         f.write("\n")
tools/libxl/gentypes.py +14 -14
index 120c6d3..3703dec 100644
@@ -17,7 +17,7 @@ def format_comment(level, comment):
     s += "%s */" % indent
     s += "\n"
     return s
-    
+
 def libxl_C_instance_of(ty, instancename):
     if isinstance(ty, libxltypes.Aggregate) and ty.typename is None:
         if instancename is None:
@@ -33,7 +33,7 @@ def libxl_C_type_define(ty, indent = ""):
     if isinstance(ty, libxltypes.Enumeration):
         if ty.comment is not None:
             s += format_comment(0, ty.comment)
-        
+
         if ty.typename is None:
             s += "enum {\n"
         else:
@@ -76,7 +76,7 @@ def libxl_C_type_define(ty, indent = ""):
     return s.replace("\n", "\n%s" % indent)
 
 def libxl_C_type_destroy(ty, v, indent = "    ", parent = None):
-        
+
     s = ""
     if isinstance(ty, libxltypes.KeyedUnion):
         if parent is None:
@@ -94,7 +94,7 @@ def libxl_C_type_destroy(ty, v, indent = "    ", parent = None):
     else:
         if ty.destructor_fn is not None:
             s += "%s(%s);\n" % (ty.destructor_fn, ty.pass_arg(v, parent is None))
-            
+
     if s != "":
         s = indent + s
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
@@ -121,7 +121,7 @@ def libxl_C_enum_strings(ty, indent=""):
     s += "    { NULL, -1 },\n"
     s += "};\n"
     s += "\n"
-    
+
     if s != "":
         s = indent + s
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
@@ -130,11 +130,11 @@ def libxl_C_enum_from_string(ty, str, e, indent = "    "):
     s = ""
     s += "return libxl__enum_from_string(%s_string_table,\n" % ty.typename
     s += "                               %s, (int *)%s);\n" % (str, e)
-    
+
     if s != "":
         s = indent + s
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
-    
+
 
 if __name__ == '__main__':
     if len(sys.argv) != 4:
@@ -144,11 +144,11 @@ if __name__ == '__main__':
     (_, idl, header, impl) = sys.argv
 
     (_,types) = libxltypes.parse(idl)
-                    
+
     print "outputting libxl type definitions to %s" % header
 
     f = open(header, "w")
-    
+
     f.write("""#ifndef __LIBXL_TYPES_H
 #define __LIBXL_TYPES_H
 
@@ -158,9 +158,9 @@ if __name__ == '__main__':
  * This file is autogenerated by
  * "%s"
  */
- 
+
 """ % " ".join(sys.argv))
-        
+
     for ty in types:
         f.write(libxl_C_type_define(ty) + ";\n")
         if ty.destructor_fn is not None:
@@ -173,7 +173,7 @@ if __name__ == '__main__':
 
     f.write("""#endif /* __LIBXL_TYPES_H */\n""")
     f.close()
-    
+
     print "outputting libxl type implementations to %s" % impl
 
     f = open(impl, "w")
@@ -212,11 +212,11 @@ if __name__ == '__main__':
         f.write("}\n")
         f.write("\n")
 
-        f.write(libxl_C_enum_strings(ty))               
+        f.write(libxl_C_enum_strings(ty))
 
         f.write("int %s_from_string(const char *s, %s *e)\n" % (ty.typename, ty.typename))
         f.write("{\n")
-        f.write(libxl_C_enum_from_string(ty, "s", "e"))               
+        f.write(libxl_C_enum_from_string(ty, "s", "e"))
         f.write("}\n")
         f.write("\n")
 
tools/libxl/libxl.c +11 -11
index 83d604c..4ef6c49 100644
@@ -64,7 +64,7 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version, xentoollog_logger * lg)
 
     ctx->xch = xc_interface_open(lg,lg,0);
     if (!ctx->xch) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno, 
+        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno,
                         "cannot open libxc handle");
         return ERROR_FAIL;
     }
@@ -73,7 +73,7 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version, xentoollog_logger * lg)
     if (!ctx->xsh)
         ctx->xsh = xs_domain_open();
     if (!ctx->xsh) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno, 
+        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno,
                         "cannot connect to xenstore");
         xc_interface_close(ctx->xch);
         return ERROR_FAIL;
@@ -88,7 +88,7 @@ int libxl_ctx_free(libxl_ctx *ctx)
     if (!ctx) return 0;
     if (ctx->xch) xc_interface_close(ctx->xch);
     libxl_version_info_destroy(&ctx->version_info);
-    if (ctx->xsh) xs_daemon_close(ctx->xsh); 
+    if (ctx->xsh) xs_daemon_close(ctx->xsh);
     return 0;
 }
 
@@ -247,15 +247,15 @@ int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid)
         goto out;
     }
     if (xc_domain_resume(ctx->xch, domid, 0)) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, 
-                        "xc_domain_resume failed for domain %u", 
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
+                        "xc_domain_resume failed for domain %u",
                         domid);
         rc = ERROR_FAIL;
         goto out;
     }
     if (!xs_resume_domain(ctx->xsh, domid)) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, 
-                        "xs_resume_domain failed for domain %u", 
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
+                        "xs_resume_domain failed for domain %u",
                         domid);
         rc = ERROR_FAIL;
     }
@@ -701,7 +701,7 @@ int libxl_event_get_disk_eject_info(libxl_ctx *ctx, uint32_t domid, libxl_event
 		disk->backend = LIBXL_DISK_BACKEND_QDISK;
 	} else {
 		disk->backend = LIBXL_DISK_BACKEND_UNKNOWN;
-	} 
+	}
 
     disk->pdev_path = strdup("");
     disk->format = LIBXL_DISK_FORMAT_EMPTY;
@@ -886,7 +886,7 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
         if ( lseek(autopass_fd, SEEK_SET, 0) ) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                              "rewind %s (autopass) failed", tmpname);
-            goto x_fail; 
+            goto x_fail;
         }
 
         args[2] = "-autopass";
@@ -1516,8 +1516,8 @@ static unsigned int libxl__append_disk_list_of_type(libxl__gc *gc,
             } else {
                 pdisk->pdev_path = physpath_tmp;
             }
-            libxl_string_to_backend(ctx, libxl__xs_read(gc, XBT_NULL, 
-                libxl__sprintf(gc, "%s/%s/type", be_path, *dir)), 
+            libxl_string_to_backend(ctx, libxl__xs_read(gc, XBT_NULL,
+                libxl__sprintf(gc, "%s/%s/type", be_path, *dir)),
                 &(pdisk->backend));
             pdisk->vdev = xs_read(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "%s/%s/dev", be_path, *dir), &len);
             removable = libxl__xs_read(gc, XBT_NULL, libxl__sprintf
tools/libxl/libxl.h +2 -2
index 562937d..09906bb 100644
@@ -365,7 +365,7 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_conso
  * if the guest is using stubdoms).
  * This function can be called after creating the device model, in
  * case of HVM guests, and before libxl_run_bootloader in case of PV
- * guests using pygrub. */ 
+ * guests using pygrub. */
 int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm);
 
 int libxl_domain_info(libxl_ctx*, libxl_dominfo *info_r,
@@ -515,7 +515,7 @@ static inline int libxl_domid_valid_guest(uint32_t domid)
 
 int libxl_flask_context_to_sid(libxl_ctx *ctx, char *buf, size_t len,
                                uint32_t *ssidref);
-int libxl_flask_sid_to_context(libxl_ctx *ctx, uint32_t ssidref, char **buf, 
+int libxl_flask_sid_to_context(libxl_ctx *ctx, uint32_t ssidref, char **buf,
                                size_t *len);
 int libxl_flask_getenforce(libxl_ctx *ctx);
 int libxl_flask_setenforce(libxl_ctx *ctx, int mode);
tools/libxl/libxl.idl +7 -7
index 183d2cd..2075195 100644
@@ -95,8 +95,8 @@ libxl_dominfo = Struct("dominfo",[
     ("paused",      bool),
     ("shutdown",    bool),
     ("dying",       bool),
-    
-    ("shutdown_reason", uint8, False, 
+
+    ("shutdown_reason", uint8, False,
 """Valid SHUTDOWN_* value from xen/sched.h iff (shutdown||dying).
 
 Otherwise set to a value guaranteed not to clash with any valid
@@ -134,7 +134,7 @@ libxl_version_info = Struct("version_info", [
     ("pagesize",          integer),
     ("commandline",       string),
     ])
-                                             
+
 libxl_domain_create_info = Struct("domain_create_info",[
     ("hvm",          bool),
     ("hap",          bool),
@@ -214,19 +214,19 @@ libxl_device_model_info = Struct("device_model_info",[
     ("opengl",           bool,              False, "opengl enabled or disabled (if enabled requires sdl enabled)"),
     ("spice",            bool,              False,
     "spice enabled or disabled"),
-    ("spiceport",        integer,           False, 
+    ("spiceport",        integer,           False,
     "the port that should be listened on for the spice server"),
     ("spicetls_port",    integer,           False, """the tls port
-that should be listened on for the spice server, 
+that should be listened on for the spice server,
 at least one of the port or tls port must be given"""),
     ("spicehost",        string,            False, """the interface
 that should be listened on if given otherwise any interface"""),
-    ("spicedisable_ticketing", bool,        False, 
+    ("spicedisable_ticketing", bool,        False,
     "enable client connection with no password"),
     ("spicepasswd",      string,            False, """set ticket password
 witch must be used by a client for connection.
 The password never expires"""),
-    ("spiceagent_mouse", bool,              False, 
+    ("spiceagent_mouse", bool,              False,
     "Whether spice agent is used for client mouse mode(default is on)"),
     ("nographic",        bool,              False, "no graphics, use serial port"),
     ("gfx_passthru",     bool,              False, "graphics passthrough enabled or disabled"),
tools/libxl/libxl_device.c +7 -7
index b644ce3..1b9e984 100644
@@ -166,7 +166,7 @@ static int disk_try_backend(disk_try_backend_args *a,
         LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend "
                    " %d unknown", a->disk->vdev, backend);
         return 0;
-        
+
     }
     abort(); /* notreached */
 
@@ -177,7 +177,7 @@ static int disk_try_backend(disk_try_backend_args *a,
                libxl_disk_backend_to_string(backend),
                libxl_disk_format_to_string(a->disk->format));
     return 0;
-}            
+}
 
 int libxl__device_disk_set_backend(libxl__gc *gc, libxl_device_disk *disk) {
     libxl_ctx *ctx = libxl__gc_owner(gc);
@@ -240,11 +240,11 @@ char *libxl__device_disk_string_of_format(libxl_disk_format format)
 {
     switch (format) {
         case LIBXL_DISK_FORMAT_QCOW: return "qcow";
-        case LIBXL_DISK_FORMAT_QCOW2: return "qcow2"; 
-        case LIBXL_DISK_FORMAT_VHD: return "vhd"; 
+        case LIBXL_DISK_FORMAT_QCOW2: return "qcow2";
+        case LIBXL_DISK_FORMAT_VHD: return "vhd";
         case LIBXL_DISK_FORMAT_RAW:
-        case LIBXL_DISK_FORMAT_EMPTY: return "aio"; 
-        default: return NULL; 
+        case LIBXL_DISK_FORMAT_EMPTY: return "aio";
+        default: return NULL;
     }
 }
 
@@ -474,7 +474,7 @@ int libxl__devices_destroy(libxl__gc *gc, uint32_t domid, int force)
     if (!force) {
         /* Linux-ism. Most implementations leave the timeout
          * untouched after select. Linux, however, will chip
-         * away the elapsed time from it, which is what we 
+         * away the elapsed time from it, which is what we
          * need to enforce a single time span waiting for
          * device destruction. */
         struct timeval tv;
tools/libxl/libxl_dm.c +3 -3
index e8a7664..0e213ce 100644
@@ -120,7 +120,7 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
             vncarg = libxl__sprintf(gc, "%s,password", vncarg);
         flexarray_append(dm_args, "-vnc");
         flexarray_append(dm_args, vncarg);
-        
+
         if (info->vncunused) {
             flexarray_append(dm_args, "-vncunused");
         }
@@ -274,11 +274,11 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
         }
 
         if (strchr(listen, ':') != NULL)
-            flexarray_append(dm_args, 
+            flexarray_append(dm_args,
                     libxl__sprintf(gc, "%s%s", listen,
                         info->vncunused ? ",to=99" : ""));
         else
-            flexarray_append(dm_args, 
+            flexarray_append(dm_args,
                     libxl__sprintf(gc, "%s:%d%s", listen, display,
                         info->vncunused ? ",to=99" : ""));
     }
tools/libxl/libxl_flask.c +6 -6
index a5d0b8a..8e0eb73 100644
@@ -22,23 +22,23 @@ int libxl_flask_context_to_sid(libxl_ctx *ctx, char *buf, size_t len,
     int rc;
 
     rc = xc_flask_context_to_sid(ctx->xch, buf, len, ssidref);
-   
+
     return rc;
 }
 
-int libxl_flask_sid_to_context(libxl_ctx *ctx, uint32_t ssidref, 
+int libxl_flask_sid_to_context(libxl_ctx *ctx, uint32_t ssidref,
                                char **buf, size_t *len)
 {
     int rc;
     char tmp[XC_PAGE_SIZE];
 
     rc = xc_flask_sid_to_context(ctx->xch, ssidref, tmp, sizeof(tmp));
-                                    
+
     if (!rc) {
         *len = strlen(tmp);
-        *buf = strdup(tmp); 
+        *buf = strdup(tmp);
     }
-     
+
     return rc;
 }
 
@@ -48,7 +48,7 @@ int libxl_flask_getenforce(libxl_ctx *ctx)
 
     rc = xc_flask_getenforce(ctx->xch);
 
-    return rc; 
+    return rc;
 }
 
 int libxl_flask_setenforce(libxl_ctx *ctx, int mode)
tools/libxl/libxl_pci.c +3 -3
index 89f5a30..b5dcab3 100644
@@ -535,7 +535,7 @@ int libxl_device_pci_list_assignable(libxl_ctx *ctx, libxl_device_pci **list, in
     return 0;
 }
 
-/* 
+/*
  * This function checks that all functions of a device are bound to pciback
  * driver. It also initialises a bit-mask of which function numbers are present
  * on that device.
@@ -598,7 +598,7 @@ static int pci_ins_check(libxl__gc *gc, uint32_t domid, const char *state, void
 
     return 1;
 }
- 
+
 static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, int starting)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
@@ -863,7 +863,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
                                              NULL, NULL, NULL) < 0) {
                 LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Device Model didn't respond in time");
                 /* This depends on guest operating system acknowledging the
-                 * SCI, if it doesn't respond in time then we may wish to 
+                 * SCI, if it doesn't respond in time then we may wish to
                  * force the removal.
                  */
                 return ERROR_FAIL;
tools/libxl/libxl_utils.c +1 -1
index 731b27e..3804c45 100644
@@ -313,7 +313,7 @@ int libxl_read_file_contents(libxl_ctx *ctx, const char *filename,
     int e;
     struct stat stab;
     ssize_t rs;
-    
+
     f = fopen(filename, "r");
     if (!f) {
         if (errno == ENOENT) return ENOENT;
tools/libxl/libxl_utils.h +1 -1
index a12c4c0..5e9edfd 100644
@@ -48,7 +48,7 @@ int libxl_write_exactly(libxl_ctx *ctx, int fd, const void *data,
    * EPROTO and you have no way to tell how much was read.  Errors are
    * logged using filename (which is only used for logging) and what
    * (which may be 0). */
-    
+
 pid_t libxl_fork(libxl_ctx *ctx);
 int libxl_pipe(libxl_ctx *ctx, int pipes[2]);
   /* Just like fork(2), pipe(2), but log errors. */
tools/libxl/libxltypes.py +5 -5
index b7b4669..ab58731 100644
@@ -44,12 +44,12 @@ class Type(object):
 
     def make_arg(self, n, passby=None):
         if passby is None: passby = self.passby
-        
+
         if passby == PASS_BY_REFERENCE:
             return "%s *%s" % (self.typename, n)
         else:
             return "%s %s" % (self.typename, n)
-        
+
     def pass_arg(self, n, isref=None, passby=None):
         if passby is None: passby = self.passby
         if isref is None: isref = self.passby == PASS_BY_REFERENCE
@@ -97,7 +97,7 @@ class EnumerationValue(object):
         self.name = str.upper(enum.namespace) + self.rawname
         self.value = value
         self.comment = kwargs.setdefault("comment", None)
-        
+
 class Enumeration(Type):
     def __init__(self, typename, values, **kwargs):
         kwargs.setdefault('destructor_fn', None)
@@ -116,7 +116,7 @@ class Enumeration(Type):
             self.values.append(EnumerationValue(self, num, name,
                                                 comment=comment,
                                                 typename=self.rawname))
-        
+
 class Field(object):
     """An element of an Aggregate type"""
     def __init__(self, type, name, **kwargs):
@@ -159,7 +159,7 @@ class Aggregate(Type):
             deref = v + "->"
         else:
             deref = v + "."
-        
+
         if f.name is None: # Anonymous
             return (deref, deref)
         else:
tools/libxl/libxlu_cfg.c +8 -8
index a895940..cb95283 100644
@@ -45,7 +45,7 @@ static int ctx_prep(CfgParseContext *ctx, XLU_Config *cfg) {
     ctx->lexerrlineno= -1;
     ctx->likely_python= 0;
     ctx->scanner= 0;
-    
+
     e= xlu__cfg_yylex_init_extra(ctx, &ctx->scanner);
     if (e) {
         fprintf(cfg->report,"%s: unable to create scanner: %s\n",
@@ -191,7 +191,7 @@ int xlu_cfg_get_string(const XLU_Config *cfg, const char *n,
     *value_r= set->values[0];
     return 0;
 }
- 
+
 int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
                            char **value_r) {
     XLU_ConfigSetting *set;
@@ -231,7 +231,7 @@ int xlu_cfg_get_long(const XLU_Config *cfg, const char *n,
     *value_r= l;
     return 0;
 }
-        
+
 
 int xlu_cfg_get_list(const XLU_Config *cfg, const char *n,
                      XLU_ConfigList **list_r, int *entries_r, int dont_warn) {
@@ -269,7 +269,7 @@ XLU_ConfigSetting *xlu__cfg_set_mk(CfgParseContext *ctx,
 
     set->name= 0; /* tbd */
     set->avalues= alloc;
-    
+
     if (!alloc) {
         set->nvalues= 0;
         set->values= 0;
@@ -295,11 +295,11 @@ void xlu__cfg_set_add(CfgParseContext *ctx, XLU_ConfigSetting *set,
     if (ctx->err) return;
 
     assert(atom);
-    
+
     if (set->nvalues >= set->avalues) {
         int new_avalues;
         char **new_values;
-        
+
         if (set->avalues > INT_MAX / 100) { ctx->err= ERANGE; return; }
         new_avalues= set->avalues * 4;
         new_values= realloc(set->values,
@@ -324,7 +324,7 @@ void xlu__cfg_set_store(CfgParseContext *ctx, char *name,
 
 char *xlu__cfgl_strdup(CfgParseContext *ctx, const char *src) {
     char *result;
-    
+
     if (ctx->err) return 0;
     result= strdup(src);
     if (!result) ctx->err= errno;
@@ -380,7 +380,7 @@ char *xlu__cfgl_dequote(CfgParseContext *ctx, const char *src) {
                     goto x;                                                  \
                 }                                                            \
                 p += (ep - numbuf);                                          \
- }while(0) 
+ }while(0)
 
                 p++;
                 NUMERIC_CHAR(2,2,16,"hex");
tools/libxl/libxlu_cfg_l.c +35 -35

227 lines not on this page · raw message

tools/libxl/libxlu_cfg_l.h +5 -5
index 4078302..327c3a4 100644
@@ -38,7 +38,7 @@
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
+ * if you want the limit (max/min) macros for int types.
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -55,7 +55,7 @@ typedef uint32_t flex_uint32_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 
@@ -193,7 +193,7 @@ struct yy_buffer_state
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
 	/* Whether to try to fill the input buffer when we reach the
 	 * end of it.
 	 */
@@ -281,9 +281,9 @@ YYSTYPE * xlu__cfg_yyget_lval (yyscan_t yyscanner );
 void xlu__cfg_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
 
        YYLTYPE *xlu__cfg_yyget_lloc (yyscan_t yyscanner );
-    
+
         void xlu__cfg_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
-    
+
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
  */
tools/libxl/libxlu_cfg_y.c +1 -1
index 737b1f6..cf7c40f 100644
@@ -819,7 +819,7 @@ int yydebug;
 # define YYMAXDEPTH 10000
 #endif
 
-
 
+
 
 #if YYERROR_VERBOSE

@@ -1030,7 +1030,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)

     }

}
#endif /* YYERROR_VERBOSE */
-

+

/*-----------------------------------------------.
| Release the memory associated to this symbol. |
@@ -1101,7 +1101,7 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, ctx)

 	break;
     }

}
-

+

/* Prevent warnings from -Wmissing-prototypes. */

tools/libxl/libxlu_cfg_y.y +1 -1
index 3c0a9fa..f0a0559 100644
@@ -45,7 +45,7 @@
 %%
 
 file: /* empty */
- |     file setting           
+ |     file setting
 
 setting: IDENT '=' value      { xlu__cfg_set_store(ctx,$1,$3,@3.first_line); }
                      endstmt
tools/libxl/libxlu_disk.c +1 -1
index 0984145..f8a1ba3 100644
@@ -19,7 +19,7 @@ static int dpc_prep(DiskParseContext *dpc, const char *spec) {
     int e;
 
     dpc->spec = spec;
-    
+
     e = xlu__disk_yylex_init_extra(dpc, &dpc->scanner);
     if (e) goto fail;
 
tools/libxl/libxlu_disk_l.c +28 -28

182 lines not on this page · raw message

tools/libxl/libxlu_disk_l.h +3 -3
index 2b6396e..c10ed2d 100644
@@ -38,7 +38,7 @@
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
+ * if you want the limit (max/min) macros for int types.
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -55,7 +55,7 @@ typedef uint32_t flex_uint32_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 
@@ -193,7 +193,7 @@ struct yy_buffer_state
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
 	/* Whether to try to fill the input buffer when we reach the
 	 * end of it.
 	 */
tools/libxl/libxlu_disk_l.l +2 -2
index e9d43c9..8c786fc 100644
@@ -99,7 +99,7 @@ static void setformat(DiskParseContext *dpc, const char *str) {
     else if (!strcmp(str,"vhd"))    DSET(dpc,format,FORMAT,str,VHD);
     else xlu__disk_err(dpc,str,"unknown value for format");
 }
- 
+
 /* Sets ->backend from the string.  IDL should provide something for this. */
 static void setbackendtype(DiskParseContext *dpc, const char *str) {
     if (     !strcmp(str,"phy"))   DSET(dpc,backend,BACKEND,str,PHY);
@@ -107,7 +107,7 @@ static void setbackendtype(DiskParseContext *dpc, const char *str) {
     else if (!strcmp(str,"qdisk")) DSET(dpc,backend,BACKEND,str,QDISK);
     else xlu__disk_err(dpc,str,"unknown value for backendtype");
 }
- 
+
 #define DEPRECATE(usewhatinstead) /* not currently reported */
 
 %}
tools/libxl/libxlutil.h +1 -1
index 80c8753..c20de1d 100644
@@ -33,7 +33,7 @@ int xlu_cfg_readfile(XLU_Config*, const char *real_filename);
 int xlu_cfg_readdata(XLU_Config*, const char *data, int length);
   /* If these fail, then it is undefined behaviour to call xlu_cfg_get_...
    * functions.  You have to just xlu_cfg_destroy. */
- 
+
 void xlu_cfg_destroy(XLU_Config*);
 
 
tools/libxl/xl.c +1 -1
index 1f231a8..fd3b9d8 100644
@@ -80,7 +80,7 @@ static void parse_global_config(const char *configfile,
 
     xlu_cfg_destroy(config);
 }
- 
+
 int main(int argc, char **argv)
 {
     int opt = 0;
tools/libxl/xl_cmdimpl.c +13 -13
index be58871..5aed84a 100644
@@ -552,7 +552,7 @@ static void parse_config_data(const char *configfile_filename_report,
                                     &c_info->ssidref);
         if (e) {
             if (errno == ENOSYS) {
-                fprintf(stderr, "XSM Disabled: seclabel not supported\n");    
+                fprintf(stderr, "XSM Disabled: seclabel not supported\n");
             } else {
                 fprintf(stderr, "Invalid seclabel: %s\n", buf);
                 exit(1);
@@ -579,7 +579,7 @@ static void parse_config_data(const char *configfile_filename_report,
     }else{
         libxl_uuid_generate(&c_info->uuid);
     }
- 
+
     if (!xlu_cfg_get_long(config, "oos", &l))
         c_info->oos = l;
 
@@ -1455,7 +1455,7 @@ static int create_domain(struct domain_create *dom_info)
             /* when we receive a domain we get its name from the config
              * file; and we receive it to a temporary name */
             assert(!common_domname);
-            
+
             common_domname = d_config.c_info.name;
             d_config.c_info.name = 0; /* steals allocation from config */
 
@@ -1638,7 +1638,7 @@ start:
 
                         /* Some settings only make sense on first boot. */
                         paused = 0;
-                        if (common_domname 
+                        if (common_domname
                             && strcmp(d_config.c_info.name, common_domname)) {
                             d_config.c_info.name = strdup(common_domname);
                         }
@@ -2250,8 +2250,8 @@ static void list_domains(int verbose, int context, const libxl_dominfo *info, in
             int rc;
             size_t size;
             char *buf;
-            rc = libxl_flask_sid_to_context(ctx, info[i].ssidref, &buf, 
-                                            &size); 
+            rc = libxl_flask_sid_to_context(ctx, info[i].ssidref, &buf,
+                                            &size);
             if (rc < 0)
                 printf("  -");
             else {
@@ -3640,7 +3640,7 @@ static int sched_credit_domain_get(
     rc = libxl_sched_credit_domain_get(ctx, domid, scinfo);
     if (rc)
         fprintf(stderr, "libxl_sched_credit_domain_get failed.\n");
-    
+
     return rc;
 }
 
@@ -5237,7 +5237,7 @@ int main_getenforce(int argc, char **argv)
     else if (ret == 0)
         printf("Permissive\n");
 
-    return ret; 
+    return ret;
 }
 
 int main_setenforce(int argc, char **argv)
@@ -5264,14 +5264,14 @@ int main_setenforce(int argc, char **argv)
         help("setenforce");
         return 2;
     }
-   
+
     ret = libxl_flask_setenforce(ctx, mode);
 
     if (ret) {
         if (errno == ENOSYS) {
             fprintf(stderr, "Flask XSM disabled\n");
-        } 
-        else 
+        }
+        else
             fprintf(stderr, "error occured while setting enforcing mode (%i)\n", ret);
     }
 
@@ -5299,7 +5299,7 @@ int main_loadpolicy(int argc, char **argv)
         ret = -1;
         goto done;
     }
-    
+
     ret = stat(polFName, &info);
     if ( ret < 0 ) {
         fprintf(stderr, "Error occurred retrieving information about"
@@ -5308,7 +5308,7 @@ int main_loadpolicy(int argc, char **argv)
     }
 
     polMemCp = malloc(info.st_size);
-     
+
     ret = read(polFd, polMemCp, info.st_size);
     if ( ret < 0 ) {
         fprintf(stderr, "Unable to read new Flask policy file: %s\n",
tools/libxl/xl_cmdtable.c +2 -2
index e6ff877..3dd0760 100644
@@ -54,7 +54,7 @@ struct cmd_spec cmd_table[] = {
       &main_reboot, 0,
       "Issue a reboot signal to a domain",
       "<Domain>",
-    }, 
+    },
     { "pci-attach",
       &main_pciattach, 0,
       "Insert a new pass-through pci device",
@@ -393,7 +393,7 @@ struct cmd_spec *cmdtable_lookup(const char *s)
     size_t len;
     int i, count = 0;
 
-    if (!s) 
+    if (!s)
         return NULL;
     len = strlen(s);
     for (i = 0; i < cmdtable_len; i++) {
author
#1 lore raw

Forget to add that "signed-off-by" thing.

Resend.

Wei.

commit 32c2e6d7ab293d3455a55ac8962ec9fd78b153dd

Author: Wei Liu <[email protected]>
Date:   Sat Jul 16 16:01:57 2011 +0800

libxl: clean up trailing whitespaces in code.

find -not -iname '*.txt' -type f -print0 | xargs -0 sed -i.bak -E 's/[[:space:]]*$//'

tools/libxl/bash-completion +1 -1
index adf994f..b184f74 100644
@@ -9,7 +9,7 @@ _xl()
 	COMPREPLY=()
 	cur="${COMP_WORDS[COMP_CWORD]}"
 	xl=xl
-	
+
 	if [[ $COMP_CWORD == 1 ]] ; then
 		opts=`${xl} help 2>/dev/null | sed '1,4d' | awk '{print $1}' | sed 's/$/ ,/g'` && COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
 		return 0
tools/libxl/gentest.py +4 -4
index 5828cfd..47c7f0b 100644
@@ -21,10 +21,10 @@ if __name__ == '__main__':
         sys.exit(1)
 
     random.seed()
-    
+
     idl = sys.argv[1]
     (_,types) = libxltypes.parse(idl)
-                    
+
     impl = sys.argv[2]
     f = open(impl, "w")
     f.write("""
@@ -39,7 +39,7 @@ int main(int argc, char **argv)
         f.write("    %s %s_val;\n" % (ty.typename, ty.typename))
     f.write("    int rc;\n")
     f.write("\n")
-                
+
     for ty in [t for t in types if isinstance(t,libxltypes.Enumeration)]:
         f.write("    printf(\"%s -- to string:\\n\");\n" % (ty.typename))
         for v in ty.values:
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
             f.write("    %s_val = -1;\n" % (ty.typename))
             f.write("    rc = %s_from_string(\"%s\", &%s_val);\n" %\
                     (ty.typename, n, ty.typename))
-                    
+
             f.write("    printf(\"\\t%s = \\\"%%s\\\" = %%d (rc %%d)\\n\", \"%s\", %s_val, rc);\n" %\
                     (v, n, ty.typename))
         f.write("\n")
tools/libxl/gentypes.py +14 -14
index 120c6d3..3703dec 100644
@@ -17,7 +17,7 @@ def format_comment(level, comment):
     s += "%s */" % indent
     s += "\n"
     return s
-    
+
 def libxl_C_instance_of(ty, instancename):
     if isinstance(ty, libxltypes.Aggregate) and ty.typename is None:
         if instancename is None:
@@ -33,7 +33,7 @@ def libxl_C_type_define(ty, indent = ""):
     if isinstance(ty, libxltypes.Enumeration):
         if ty.comment is not None:
             s += format_comment(0, ty.comment)
-        
+
         if ty.typename is None:
             s += "enum {\n"
         else:
@@ -76,7 +76,7 @@ def libxl_C_type_define(ty, indent = ""):
     return s.replace("\n", "\n%s" % indent)
 
 def libxl_C_type_destroy(ty, v, indent = "    ", parent = None):
-        
+
     s = ""
     if isinstance(ty, libxltypes.KeyedUnion):
         if parent is None:
@@ -94,7 +94,7 @@ def libxl_C_type_destroy(ty, v, indent = "    ", parent = None):
     else:
         if ty.destructor_fn is not None:
             s += "%s(%s);\n" % (ty.destructor_fn, ty.pass_arg(v, parent is None))
-            
+
     if s != "":
         s = indent + s
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
@@ -121,7 +121,7 @@ def libxl_C_enum_strings(ty, indent=""):
     s += "    { NULL, -1 },\n"
     s += "};\n"
     s += "\n"
-    
+
     if s != "":
         s = indent + s
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
@@ -130,11 +130,11 @@ def libxl_C_enum_from_string(ty, str, e, indent = "    "):
     s = ""
     s += "return libxl__enum_from_string(%s_string_table,\n" % ty.typename
     s += "                               %s, (int *)%s);\n" % (str, e)
-    
+
     if s != "":
         s = indent + s
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
-    
+
 
 if __name__ == '__main__':
     if len(sys.argv) != 4:
@@ -144,11 +144,11 @@ if __name__ == '__main__':
     (_, idl, header, impl) = sys.argv
 
     (_,types) = libxltypes.parse(idl)
-                    
+
     print "outputting libxl type definitions to %s" % header
 
     f = open(header, "w")
-    
+
     f.write("""#ifndef __LIBXL_TYPES_H
 #define __LIBXL_TYPES_H
 
@@ -158,9 +158,9 @@ if __name__ == '__main__':
  * This file is autogenerated by
  * "%s"
  */
- 
+
 """ % " ".join(sys.argv))
-        
+
     for ty in types:
         f.write(libxl_C_type_define(ty) + ";\n")
         if ty.destructor_fn is not None:
@@ -173,7 +173,7 @@ if __name__ == '__main__':
 
     f.write("""#endif /* __LIBXL_TYPES_H */\n""")
     f.close()
-    
+
     print "outputting libxl type implementations to %s" % impl
 
     f = open(impl, "w")
@@ -212,11 +212,11 @@ if __name__ == '__main__':
         f.write("}\n")
         f.write("\n")
 
-        f.write(libxl_C_enum_strings(ty))               
+        f.write(libxl_C_enum_strings(ty))
 
         f.write("int %s_from_string(const char *s, %s *e)\n" % (ty.typename, ty.typename))
         f.write("{\n")
-        f.write(libxl_C_enum_from_string(ty, "s", "e"))               
+        f.write(libxl_C_enum_from_string(ty, "s", "e"))
         f.write("}\n")
         f.write("\n")
 
tools/libxl/libxl.c +11 -11
index 83d604c..4ef6c49 100644
@@ -64,7 +64,7 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version, xentoollog_logger * lg)
 
     ctx->xch = xc_interface_open(lg,lg,0);
     if (!ctx->xch) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno, 
+        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno,
                         "cannot open libxc handle");
         return ERROR_FAIL;
     }
@@ -73,7 +73,7 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version, xentoollog_logger * lg)
     if (!ctx->xsh)
         ctx->xsh = xs_domain_open();
     if (!ctx->xsh) {
-        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno, 
+        LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, errno,
                         "cannot connect to xenstore");
         xc_interface_close(ctx->xch);
         return ERROR_FAIL;
@@ -88,7 +88,7 @@ int libxl_ctx_free(libxl_ctx *ctx)
     if (!ctx) return 0;
     if (ctx->xch) xc_interface_close(ctx->xch);
     libxl_version_info_destroy(&ctx->version_info);
-    if (ctx->xsh) xs_daemon_close(ctx->xsh); 
+    if (ctx->xsh) xs_daemon_close(ctx->xsh);
     return 0;
 }
 
@@ -247,15 +247,15 @@ int libxl_domain_resume(libxl_ctx *ctx, uint32_t domid)
         goto out;
     }
     if (xc_domain_resume(ctx->xch, domid, 0)) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, 
-                        "xc_domain_resume failed for domain %u", 
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
+                        "xc_domain_resume failed for domain %u",
                         domid);
         rc = ERROR_FAIL;
         goto out;
     }
     if (!xs_resume_domain(ctx->xsh, domid)) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, 
-                        "xs_resume_domain failed for domain %u", 
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
+                        "xs_resume_domain failed for domain %u",
                         domid);
         rc = ERROR_FAIL;
     }
@@ -701,7 +701,7 @@ int libxl_event_get_disk_eject_info(libxl_ctx *ctx, uint32_t domid, libxl_event
 		disk->backend = LIBXL_DISK_BACKEND_QDISK;
 	} else {
 		disk->backend = LIBXL_DISK_BACKEND_UNKNOWN;
-	} 
+	}
 
     disk->pdev_path = strdup("");
     disk->format = LIBXL_DISK_FORMAT_EMPTY;
@@ -886,7 +886,7 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
         if ( lseek(autopass_fd, SEEK_SET, 0) ) {
             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
                              "rewind %s (autopass) failed", tmpname);
-            goto x_fail; 
+            goto x_fail;
         }
 
         args[2] = "-autopass";
@@ -1516,8 +1516,8 @@ static unsigned int libxl__append_disk_list_of_type(libxl__gc *gc,
             } else {
                 pdisk->pdev_path = physpath_tmp;
             }
-            libxl_string_to_backend(ctx, libxl__xs_read(gc, XBT_NULL, 
-                libxl__sprintf(gc, "%s/%s/type", be_path, *dir)), 
+            libxl_string_to_backend(ctx, libxl__xs_read(gc, XBT_NULL,
+                libxl__sprintf(gc, "%s/%s/type", be_path, *dir)),
                 &(pdisk->backend));
             pdisk->vdev = xs_read(ctx->xsh, XBT_NULL, libxl__sprintf(gc, "%s/%s/dev", be_path, *dir), &len);
             removable = libxl__xs_read(gc, XBT_NULL, libxl__sprintf
tools/libxl/libxl.h +2 -2
index 562937d..09906bb 100644
@@ -365,7 +365,7 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_conso
  * if the guest is using stubdoms).
  * This function can be called after creating the device model, in
  * case of HVM guests, and before libxl_run_bootloader in case of PV
- * guests using pygrub. */ 
+ * guests using pygrub. */
 int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm);
 
 int libxl_domain_info(libxl_ctx*, libxl_dominfo *info_r,
@@ -515,7 +515,7 @@ static inline int libxl_domid_valid_guest(uint32_t domid)
 
 int libxl_flask_context_to_sid(libxl_ctx *ctx, char *buf, size_t len,
                                uint32_t *ssidref);
-int libxl_flask_sid_to_context(libxl_ctx *ctx, uint32_t ssidref, char **buf, 
+int libxl_flask_sid_to_context(libxl_ctx *ctx, uint32_t ssidref, char **buf,
                                size_t *len);
 int libxl_flask_getenforce(libxl_ctx *ctx);
 int libxl_flask_setenforce(libxl_ctx *ctx, int mode);
tools/libxl/libxl.idl +7 -7
index 183d2cd..2075195 100644
@@ -95,8 +95,8 @@ libxl_dominfo = Struct("dominfo",[
     ("paused",      bool),
     ("shutdown",    bool),
     ("dying",       bool),
-    
-    ("shutdown_reason", uint8, False, 
+
+    ("shutdown_reason", uint8, False,
 """Valid SHUTDOWN_* value from xen/sched.h iff (shutdown||dying).
 
 Otherwise set to a value guaranteed not to clash with any valid
@@ -134,7 +134,7 @@ libxl_version_info = Struct("version_info", [
     ("pagesize",          integer),
     ("commandline",       string),
     ])
-                                             
+
 libxl_domain_create_info = Struct("domain_create_info",[
     ("hvm",          bool),
     ("hap",          bool),
@@ -214,19 +214,19 @@ libxl_device_model_info = Struct("device_model_info",[
     ("opengl",           bool,              False, "opengl enabled or disabled (if enabled requires sdl enabled)"),
     ("spice",            bool,              False,
     "spice enabled or disabled"),
-    ("spiceport",        integer,           False, 
+    ("spiceport",        integer,           False,
     "the port that should be listened on for the spice server"),
     ("spicetls_port",    integer,           False, """the tls port
-that should be listened on for the spice server, 
+that should be listened on for the spice server,
 at least one of the port or tls port must be given"""),
     ("spicehost",        string,            False, """the interface
 that should be listened on if given otherwise any interface"""),
-    ("spicedisable_ticketing", bool,        False, 
+    ("spicedisable_ticketing", bool,        False,
     "enable client connection with no password"),
     ("spicepasswd",      string,            False, """set ticket password
 witch must be used by a client for connection.
 The password never expires"""),
-    ("spiceagent_mouse", bool,              False, 
+    ("spiceagent_mouse", bool,              False,
     "Whether spice agent is used for client mouse mode(default is on)"),
     ("nographic",        bool,              False, "no graphics, use serial port"),
     ("gfx_passthru",     bool,              False, "graphics passthrough enabled or disabled"),
tools/libxl/libxl_device.c +7 -7
index b644ce3..1b9e984 100644
@@ -166,7 +166,7 @@ static int disk_try_backend(disk_try_backend_args *a,
         LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend "
                    " %d unknown", a->disk->vdev, backend);
         return 0;
-        
+
     }
     abort(); /* notreached */
 
@@ -177,7 +177,7 @@ static int disk_try_backend(disk_try_backend_args *a,
                libxl_disk_backend_to_string(backend),
                libxl_disk_format_to_string(a->disk->format));
     return 0;
-}            
+}
 
 int libxl__device_disk_set_backend(libxl__gc *gc, libxl_device_disk *disk) {
     libxl_ctx *ctx = libxl__gc_owner(gc);
@@ -240,11 +240,11 @@ char *libxl__device_disk_string_of_format(libxl_disk_format format)
 {
     switch (format) {
         case LIBXL_DISK_FORMAT_QCOW: return "qcow";
-        case LIBXL_DISK_FORMAT_QCOW2: return "qcow2"; 
-        case LIBXL_DISK_FORMAT_VHD: return "vhd"; 
+        case LIBXL_DISK_FORMAT_QCOW2: return "qcow2";
+        case LIBXL_DISK_FORMAT_VHD: return "vhd";
         case LIBXL_DISK_FORMAT_RAW:
-        case LIBXL_DISK_FORMAT_EMPTY: return "aio"; 
-        default: return NULL; 
+        case LIBXL_DISK_FORMAT_EMPTY: return "aio";
+        default: return NULL;
     }
 }
 
@@ -474,7 +474,7 @@ int libxl__devices_destroy(libxl__gc *gc, uint32_t domid, int force)
     if (!force) {
         /* Linux-ism. Most implementations leave the timeout
          * untouched after select. Linux, however, will chip
-         * away the elapsed time from it, which is what we 
+         * away the elapsed time from it, which is what we
          * need to enforce a single time span waiting for
          * device destruction. */
         struct timeval tv;
tools/libxl/libxl_dm.c +3 -3
index e8a7664..0e213ce 100644
@@ -120,7 +120,7 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
             vncarg = libxl__sprintf(gc, "%s,password", vncarg);
         flexarray_append(dm_args, "-vnc");
         flexarray_append(dm_args, vncarg);
-        
+
         if (info->vncunused) {
             flexarray_append(dm_args, "-vncunused");
         }
@@ -274,11 +274,11 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
         }
 
         if (strchr(listen, ':') != NULL)
-            flexarray_append(dm_args, 
+            flexarray_append(dm_args,
                     libxl__sprintf(gc, "%s%s", listen,
                         info->vncunused ? ",to=99" : ""));
         else
-            flexarray_append(dm_args, 
+            flexarray_append(dm_args,
                     libxl__sprintf(gc, "%s:%d%s", listen, display,
                         info->vncunused ? ",to=99" : ""));
     }
tools/libxl/libxl_flask.c +6 -6
index a5d0b8a..8e0eb73 100644
@@ -22,23 +22,23 @@ int libxl_flask_context_to_sid(libxl_ctx *ctx, char *buf, size_t len,
     int rc;
 
     rc = xc_flask_context_to_sid(ctx->xch, buf, len, ssidref);
-   
+
     return rc;
 }
 
-int libxl_flask_sid_to_context(libxl_ctx *ctx, uint32_t ssidref, 
+int libxl_flask_sid_to_context(libxl_ctx *ctx, uint32_t ssidref,
                                char **buf, size_t *len)
 {
     int rc;
     char tmp[XC_PAGE_SIZE];
 
     rc = xc_flask_sid_to_context(ctx->xch, ssidref, tmp, sizeof(tmp));
-                                    
+
     if (!rc) {
         *len = strlen(tmp);
-        *buf = strdup(tmp); 
+        *buf = strdup(tmp);
     }
-     
+
     return rc;
 }
 
@@ -48,7 +48,7 @@ int libxl_flask_getenforce(libxl_ctx *ctx)
 
     rc = xc_flask_getenforce(ctx->xch);
 
-    return rc; 
+    return rc;
 }
 
 int libxl_flask_setenforce(libxl_ctx *ctx, int mode)
tools/libxl/libxl_pci.c +3 -3
index 89f5a30..b5dcab3 100644
@@ -535,7 +535,7 @@ int libxl_device_pci_list_assignable(libxl_ctx *ctx, libxl_device_pci **list, in
     return 0;
 }
 
-/* 
+/*
  * This function checks that all functions of a device are bound to pciback
  * driver. It also initialises a bit-mask of which function numbers are present
  * on that device.
@@ -598,7 +598,7 @@ static int pci_ins_check(libxl__gc *gc, uint32_t domid, const char *state, void
 
     return 1;
 }
- 
+
 static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, int starting)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
@@ -863,7 +863,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
                                              NULL, NULL, NULL) < 0) {
                 LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Device Model didn't respond in time");
                 /* This depends on guest operating system acknowledging the
-                 * SCI, if it doesn't respond in time then we may wish to 
+                 * SCI, if it doesn't respond in time then we may wish to
                  * force the removal.
                  */
                 return ERROR_FAIL;
tools/libxl/libxl_utils.c +1 -1
index 731b27e..3804c45 100644
@@ -313,7 +313,7 @@ int libxl_read_file_contents(libxl_ctx *ctx, const char *filename,
     int e;
     struct stat stab;
     ssize_t rs;
-    
+
     f = fopen(filename, "r");
     if (!f) {
         if (errno == ENOENT) return ENOENT;
tools/libxl/libxl_utils.h +1 -1
index a12c4c0..5e9edfd 100644
@@ -48,7 +48,7 @@ int libxl_write_exactly(libxl_ctx *ctx, int fd, const void *data,
    * EPROTO and you have no way to tell how much was read.  Errors are
    * logged using filename (which is only used for logging) and what
    * (which may be 0). */
-    
+
 pid_t libxl_fork(libxl_ctx *ctx);
 int libxl_pipe(libxl_ctx *ctx, int pipes[2]);
   /* Just like fork(2), pipe(2), but log errors. */
tools/libxl/libxltypes.py +5 -5
index b7b4669..ab58731 100644
@@ -44,12 +44,12 @@ class Type(object):
 
     def make_arg(self, n, passby=None):
         if passby is None: passby = self.passby
-        
+
         if passby == PASS_BY_REFERENCE:
             return "%s *%s" % (self.typename, n)
         else:
             return "%s %s" % (self.typename, n)
-        
+
     def pass_arg(self, n, isref=None, passby=None):
         if passby is None: passby = self.passby
         if isref is None: isref = self.passby == PASS_BY_REFERENCE
@@ -97,7 +97,7 @@ class EnumerationValue(object):
         self.name = str.upper(enum.namespace) + self.rawname
         self.value = value
         self.comment = kwargs.setdefault("comment", None)
-        
+
 class Enumeration(Type):
     def __init__(self, typename, values, **kwargs):
         kwargs.setdefault('destructor_fn', None)
@@ -116,7 +116,7 @@ class Enumeration(Type):
             self.values.append(EnumerationValue(self, num, name,
                                                 comment=comment,
                                                 typename=self.rawname))
-        
+
 class Field(object):
     """An element of an Aggregate type"""
     def __init__(self, type, name, **kwargs):
@@ -159,7 +159,7 @@ class Aggregate(Type):
             deref = v + "->"
         else:
             deref = v + "."
-        
+
         if f.name is None: # Anonymous
             return (deref, deref)
         else:
tools/libxl/libxlu_cfg.c +8 -8
index a895940..cb95283 100644
@@ -45,7 +45,7 @@ static int ctx_prep(CfgParseContext *ctx, XLU_Config *cfg) {
     ctx->lexerrlineno= -1;
     ctx->likely_python= 0;
     ctx->scanner= 0;
-    
+
     e= xlu__cfg_yylex_init_extra(ctx, &ctx->scanner);
     if (e) {
         fprintf(cfg->report,"%s: unable to create scanner: %s\n",
@@ -191,7 +191,7 @@ int xlu_cfg_get_string(const XLU_Config *cfg, const char *n,
     *value_r= set->values[0];
     return 0;
 }
- 
+
 int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
                            char **value_r) {
     XLU_ConfigSetting *set;
@@ -231,7 +231,7 @@ int xlu_cfg_get_long(const XLU_Config *cfg, const char *n,
     *value_r= l;
     return 0;
 }
-        
+
 
 int xlu_cfg_get_list(const XLU_Config *cfg, const char *n,
                      XLU_ConfigList **list_r, int *entries_r, int dont_warn) {
@@ -269,7 +269,7 @@ XLU_ConfigSetting *xlu__cfg_set_mk(CfgParseContext *ctx,
 
     set->name= 0; /* tbd */
     set->avalues= alloc;
-    
+
     if (!alloc) {
         set->nvalues= 0;
         set->values= 0;
@@ -295,11 +295,11 @@ void xlu__cfg_set_add(CfgParseContext *ctx, XLU_ConfigSetting *set,
     if (ctx->err) return;
 
     assert(atom);
-    
+
     if (set->nvalues >= set->avalues) {
         int new_avalues;
         char **new_values;
-        
+
         if (set->avalues > INT_MAX / 100) { ctx->err= ERANGE; return; }
         new_avalues= set->avalues * 4;
         new_values= realloc(set->values,
@@ -324,7 +324,7 @@ void xlu__cfg_set_store(CfgParseContext *ctx, char *name,
 
 char *xlu__cfgl_strdup(CfgParseContext *ctx, const char *src) {
     char *result;
-    
+
     if (ctx->err) return 0;
     result= strdup(src);
     if (!result) ctx->err= errno;
@@ -380,7 +380,7 @@ char *xlu__cfgl_dequote(CfgParseContext *ctx, const char *src) {
                     goto x;                                                  \
                 }                                                            \
                 p += (ep - numbuf);                                          \
- }while(0) 
+ }while(0)
 
                 p++;
                 NUMERIC_CHAR(2,2,16,"hex");
tools/libxl/libxlu_cfg_l.c +35 -35

227 lines not on this page · raw message

tools/libxl/libxlu_cfg_l.h +5 -5
index 4078302..327c3a4 100644
@@ -38,7 +38,7 @@
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
+ * if you want the limit (max/min) macros for int types.
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -55,7 +55,7 @@ typedef uint32_t flex_uint32_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 
@@ -193,7 +193,7 @@ struct yy_buffer_state
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
 	/* Whether to try to fill the input buffer when we reach the
 	 * end of it.
 	 */
@@ -281,9 +281,9 @@ YYSTYPE * xlu__cfg_yyget_lval (yyscan_t yyscanner );
 void xlu__cfg_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
 
        YYLTYPE *xlu__cfg_yyget_lloc (yyscan_t yyscanner );
-    
+
         void xlu__cfg_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
-    
+
 /* Macros after this point can all be overridden by user definitions in
  * section 1.
  */
tools/libxl/libxlu_cfg_y.c +3 -3
index 737b1f6..cf7c40f 100644
@@ -819,7 +819,7 @@ int yydebug;
 # define YYMAXDEPTH 10000
 #endif
 
-
+
 
 #if YYERROR_VERBOSE
 
@@ -1030,7 +1030,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
     }
 }
 #endif /* YYERROR_VERBOSE */
-
+
 
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
@@ -1101,7 +1101,7 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, ctx)
 	break;
     }
 }
-
+
 
 /* Prevent warnings from -Wmissing-prototypes.  */
 
tools/libxl/libxlu_cfg_y.y +1 -1
index 3c0a9fa..f0a0559 100644
@@ -45,7 +45,7 @@
 %%
 
 file: /* empty */
- |     file setting           
+ |     file setting
 
 setting: IDENT '=' value      { xlu__cfg_set_store(ctx,$1,$3,@3.first_line); }
                      endstmt
tools/libxl/libxlu_disk.c +1 -1
index 0984145..f8a1ba3 100644
@@ -19,7 +19,7 @@ static int dpc_prep(DiskParseContext *dpc, const char *spec) {
     int e;
 
     dpc->spec = spec;
-    
+
     e = xlu__disk_yylex_init_extra(dpc, &dpc->scanner);
     if (e) goto fail;
 
tools/libxl/libxlu_disk_l.c +28 -28

182 lines not on this page · raw message

tools/libxl/libxlu_disk_l.h +3 -3
index 2b6396e..c10ed2d 100644
@@ -38,7 +38,7 @@
 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
+ * if you want the limit (max/min) macros for int types.
  */
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS 1
@@ -55,7 +55,7 @@ typedef uint32_t flex_uint32_t;
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
+typedef unsigned char flex_uint8_t;
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 
@@ -193,7 +193,7 @@ struct yy_buffer_state
 
     int yy_bs_lineno; /**< The line count. */
     int yy_bs_column; /**< The column count. */
-    
+
 	/* Whether to try to fill the input buffer when we reach the
 	 * end of it.
 	 */
tools/libxl/libxlu_disk_l.l +2 -2
index e9d43c9..8c786fc 100644
@@ -99,7 +99,7 @@ static void setformat(DiskParseContext *dpc, const char *str) {
     else if (!strcmp(str,"vhd"))    DSET(dpc,format,FORMAT,str,VHD);
     else xlu__disk_err(dpc,str,"unknown value for format");
 }
- 
+
 /* Sets ->backend from the string.  IDL should provide something for this. */
 static void setbackendtype(DiskParseContext *dpc, const char *str) {
     if (     !strcmp(str,"phy"))   DSET(dpc,backend,BACKEND,str,PHY);
@@ -107,7 +107,7 @@ static void setbackendtype(DiskParseContext *dpc, const char *str) {
     else if (!strcmp(str,"qdisk")) DSET(dpc,backend,BACKEND,str,QDISK);
     else xlu__disk_err(dpc,str,"unknown value for backendtype");
 }
- 
+
 #define DEPRECATE(usewhatinstead) /* not currently reported */
 
 %}
tools/libxl/libxlutil.h +1 -1
index 80c8753..c20de1d 100644
@@ -33,7 +33,7 @@ int xlu_cfg_readfile(XLU_Config*, const char *real_filename);
 int xlu_cfg_readdata(XLU_Config*, const char *data, int length);
   /* If these fail, then it is undefined behaviour to call xlu_cfg_get_...
    * functions.  You have to just xlu_cfg_destroy. */
- 
+
 void xlu_cfg_destroy(XLU_Config*);
 
 
tools/libxl/xl.c +1 -1
index 1f231a8..fd3b9d8 100644
@@ -80,7 +80,7 @@ static void parse_global_config(const char *configfile,
 
     xlu_cfg_destroy(config);
 }
- 
+
 int main(int argc, char **argv)
 {
     int opt = 0;
tools/libxl/xl_cmdimpl.c +13 -13
index be58871..5aed84a 100644
@@ -552,7 +552,7 @@ static void parse_config_data(const char *configfile_filename_report,
                                     &c_info->ssidref);
         if (e) {
             if (errno == ENOSYS) {
-                fprintf(stderr, "XSM Disabled: seclabel not supported\n");    
+                fprintf(stderr, "XSM Disabled: seclabel not supported\n");
             } else {
                 fprintf(stderr, "Invalid seclabel: %s\n", buf);
                 exit(1);
@@ -579,7 +579,7 @@ static void parse_config_data(const char *configfile_filename_report,
     }else{
         libxl_uuid_generate(&c_info->uuid);
     }
- 
+
     if (!xlu_cfg_get_long(config, "oos", &l))
         c_info->oos = l;
 
@@ -1455,7 +1455,7 @@ static int create_domain(struct domain_create *dom_info)
             /* when we receive a domain we get its name from the config
              * file; and we receive it to a temporary name */
             assert(!common_domname);
-            
+
             common_domname = d_config.c_info.name;
             d_config.c_info.name = 0; /* steals allocation from config */
 
@@ -1638,7 +1638,7 @@ start:
 
                         /* Some settings only make sense on first boot. */
                         paused = 0;
-                        if (common_domname 
+                        if (common_domname
                             && strcmp(d_config.c_info.name, common_domname)) {
                             d_config.c_info.name = strdup(common_domname);
                         }
@@ -2250,8 +2250,8 @@ static void list_domains(int verbose, int context, const libxl_dominfo *info, in
             int rc;
             size_t size;
             char *buf;
-            rc = libxl_flask_sid_to_context(ctx, info[i].ssidref, &buf, 
-                                            &size); 
+            rc = libxl_flask_sid_to_context(ctx, info[i].ssidref, &buf,
+                                            &size);
             if (rc < 0)
                 printf("  -");
             else {
@@ -3640,7 +3640,7 @@ static int sched_credit_domain_get(
     rc = libxl_sched_credit_domain_get(ctx, domid, scinfo);
     if (rc)
         fprintf(stderr, "libxl_sched_credit_domain_get failed.\n");
-    
+
     return rc;
 }
 
@@ -5237,7 +5237,7 @@ int main_getenforce(int argc, char **argv)
     else if (ret == 0)
         printf("Permissive\n");
 
-    return ret; 
+    return ret;
 }
 
 int main_setenforce(int argc, char **argv)
@@ -5264,14 +5264,14 @@ int main_setenforce(int argc, char **argv)
         help("setenforce");
         return 2;
     }
-   
+
     ret = libxl_flask_setenforce(ctx, mode);
 
     if (ret) {
         if (errno == ENOSYS) {
             fprintf(stderr, "Flask XSM disabled\n");
-        } 
-        else 
+        }
+        else
             fprintf(stderr, "error occured while setting enforcing mode (%i)\n", ret);
     }
 
@@ -5299,7 +5299,7 @@ int main_loadpolicy(int argc, char **argv)
         ret = -1;
         goto done;
     }
-    
+
     ret = stat(polFName, &info);
     if ( ret < 0 ) {
         fprintf(stderr, "Error occurred retrieving information about"
@@ -5308,7 +5308,7 @@ int main_loadpolicy(int argc, char **argv)
     }
 
     polMemCp = malloc(info.st_size);
-     
+
     ret = read(polFd, polMemCp, info.st_size);
     if ( ret < 0 ) {
         fprintf(stderr, "Unable to read new Flask policy file: %s\n",
tools/libxl/xl_cmdtable.c +2 -2
index e6ff877..3dd0760 100644
@@ -54,7 +54,7 @@ struct cmd_spec cmd_table[] = {
       &main_reboot, 0,
       "Issue a reboot signal to a domain",
       "<Domain>",
-    }, 
+    },
     { "pci-attach",
       &main_pciattach, 0,
       "Insert a new pass-through pci device",
@@ -393,7 +393,7 @@ struct cmd_spec *cmdtable_lookup(const char *s)
     size_t len;
     int i, count = 0;
 
-    if (!s) 
+    if (!s)
         return NULL;
     len = strlen(s);
     for (i = 0; i < cmdtable_len; i++) {

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

Re: [PATCH] libxl: clean up trailing whitespaces in code. [and 1 more messages]

Wei Liu writes ("[Xen-devel] [PATCH] libxl: clean up trailing whitespaces in code."):

Quoted 7 lines

commit 46926d5d610d8f6cf60ede47ce0c40a63a2c9e43

Author: Wei Liu <[email protected]>
Date:   Sat Jul 16 16:01:57 2011 +0800

libxl: clean up trailing whitespaces in code.

find -not -iname '*.txt' -type f -print0 | xargs -0 sed -i.bak -E 's/[[:space:]]*$//'

Thanks. I'm inclined to take this patch, but I'd like to coordinate with other people who might have outstanding patch queues for libxl.

So: if anyone has outstanding libxl patches other than Ian Campbell's IDL enum series, please let me know whether I should wait, or whether you're happy dealing with rebasing your patches across the whitespace change.

Wei Liu: can you confirm that the patch you attached was /exactly/ the output of that rune ? If so I can just rerun it. If not then what are the things you had to fix up ?

Thanks,
Ian.

author
#3 lore raw

Re: Re: [PATCH] libxl: clean up trailing whitespaces in code. [and 1 more messages]

Quoted 12 lines · Ian Jackson

Wei Liu writes ("[Xen-devel] [PATCH] libxl: clean up trailing whitespaces in code."):

Quoted 7 lines

commit 46926d5d610d8f6cf60ede47ce0c40a63a2c9e43

Author: Wei Liu <[email protected]>
Date:   Sat Jul 16 16:01:57 2011 +0800

libxl: clean up trailing whitespaces in code.

find -not -iname '*.txt' -type f -print0 | xargs -0 sed -i.bak -E 's/[[:space:]]*$//'

Thanks. I'm inclined to take this patch, but I'd like to coordinate with other people who might have outstanding patch queues for libxl.

Quoted 8 lines

So: if anyone has outstanding libxl patches other than Ian Campbell's IDL enum series, please let me know whether I should wait, or whether you're happy dealing with rebasing your patches across the whitespace change.

Wei Liu: can you confirm that the patch you attached was /exactly/ the output of that rune ? If so I can just rerun it. If not then what are the things you had to fix up ?

I just run the command in libxl directory and commit all changes. Then I generate the patch with

  $ git show HEAD > ~/libxl-whitespace-cleanup.patch

The attached patch should be correct. No fixup is required.

I also re-compile libxl, all goes well.

Wei.

Quoted 3 lines

Thanks,
Ian.

#4 lore raw

Re: Re: [PATCH] libxl: clean up trailing whitespaces in code. [and 1 more messages]

Wei LIU writes ("Re: [Xen-devel] Re: [PATCH] libxl: clean up trailing whitespaces in code. [and 1 more messages]"):

Quoted 6 lines

I just run the command in libxl directory and commit all changes. Then I generate the patch with

  $ git show HEAD > ~/libxl-whitespace-cleanup.patch
The attached patch should be correct. No fixup is required.

I also re-compile libxl, all goes well.

Great, thanks a lot. I have applied the change. I found that my sed didn't understand -E so I did this instead:

    find \! -iname '*.txt' -type f -print0 | xargs -0 perl -p -i.bak -E 's/\s+\n/\n/'

Ian.