libxl: Fix up some incorrect printf formats
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 28 May 2010 08:31:43 +0000 (09:31 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 28 May 2010 08:31:43 +0000 (09:31 +0100)
We need to use PRIu32 for domids, and also to pass arguments in the
right order.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl_dom.c
tools/libxl/libxl_xshelp.c

index fceb4d5b4153a2e6937cbc5047b5622379254610..375306f196bced41526f76e7dfac81a6eace4b71 100644 (file)
@@ -230,7 +230,7 @@ int libxl_domain_rename(struct libxl_ctx *ctx, uint32_t domid,
                   new_name, strlen(new_name))) {
         XL_LOG(ctx, XL_LOG_ERROR, "failed to write new name `%s'"
                " for domain %"PRIu32" previously named `%s'",
-               domid, new_name, old_name);
+               new_name, domid, old_name);
         goto x_fail;
     }
 
@@ -240,7 +240,7 @@ int libxl_domain_rename(struct libxl_ctx *ctx, uint32_t domid,
             if (errno != EAGAIN) {
                 XL_LOG(ctx, XL_LOG_ERROR, "failed to commit new name `%s'"
                        " for domain %"PRIu32" previously named `%s'",
-                       domid, new_name, old_name);
+                       new_name, domid, old_name);
                 goto x_fail;
             }
             XL_LOG(ctx, XL_LOG_DEBUG, "need to retry rename transaction"
index 483a92804ff80de43df8f2c050290ad3ad8bf893..ba7dfe0e37701d22c771bbf37e83a06d55b179d7 100644 (file)
@@ -386,7 +386,7 @@ static const char *userdata_path(struct libxl_ctx *ctx, uint32_t domid,
     rc = libxl_domain_info(ctx, &info, domid);
     if (rc) {
         XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "unable to find domain info"
-                     " for domain %l"PRIu32, domid);
+                     " for domain %"PRIu32, domid);
         return 0;
     }
     uuid_string = string_of_uuid(ctx, info.uuid);
index 16e8c842ee293f12bf7659f5c63484ad1edab44b..b5c6dbfccbf9307ebcd789ea34419a827311ca16 100644 (file)
@@ -19,6 +19,7 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <stdarg.h>
+#include <inttypes.h>
 
 #include "libxl.h"
 #include "libxl_internal.h"
@@ -119,7 +120,7 @@ char *libxl_xs_get_dompath(struct libxl_ctx *ctx, uint32_t domid)
 {
     char *s = xs_get_domain_path(ctx->xsh, domid);
     if (!s) {
-        XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "failed to get dompath for %lu",
+        XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "failed to get dompath for %" PRIu32,
                      domid);
         return NULL;
     }