All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Thomas <bthomas@virtualiron.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Simple patch to quiet some messages in xc_domain.c
Date: Tue, 06 Jun 2006 08:58:00 -0400	[thread overview]
Message-ID: <44857BD8.40003@virtualiron.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 726 bytes --]

xc_domain.c has a few fprintfs producing information about some error
cases. These probably should be handled as debugging messages, and
this patch implements one approach to this. The affected APIs are
unaffected and continue to return the appropriate error status.
They just are no longer as chatty when doing so.

Signed-off-by: Ben Thomas (ben@virtualiron.com)

-- 
------------------------------------------------------------------------
Ben Thomas                                         Virtual Iron Software
bthomas@virtualiron.com                            Tower 1, Floor 2
978-849-1214                                       900 Chelmsford Street
                                                    Lowell, MA 01851

[-- Attachment #2: xcdom.patch --]
[-- Type: text/x-patch, Size: 1816 bytes --]

diff -r c191c649cdb3 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Tue Jun 06 10:25:59 2006 +0100
+++ b/tools/libxc/xc_domain.c	Tue Jun 06 08:45:38 2006 -0400
@@ -9,6 +9,15 @@
 #include "xc_private.h"
 #include <xen/memory.h>
 
+#define DEBUG 0
+
+#if DEBUG
+#define DPRINTF(_f, _a...) fprintf(stderr, _f , ## _a)
+#else
+#define DPRINTF(_f, _a...) ((void)0)
+#endif
+
+
 int xc_domain_create(int xc_handle,
                      uint32_t ssidref,
                      xen_domain_handle_t handle,
@@ -310,7 +319,7 @@ int xc_domain_memory_increase_reservatio
 
     if ( err > 0 )
     {
-        fprintf(stderr, "Failed allocation for dom %d: "
+        DPRINTF("Failed allocation for dom %d: "
                 "%ld pages order %d addr_bits %d\n",
                 domid, nr_extents, extent_order, address_bits);
         errno = ENOMEM;
@@ -338,7 +347,7 @@ int xc_domain_memory_decrease_reservatio
 
     if ( extent_start == NULL )
     {
-        fprintf(stderr,"decrease_reservation extent_start is NULL!\n");
+        DPRINTF("decrease_reservation extent_start is NULL!\n");
         errno = EINVAL;
         return -1;
     }
@@ -349,7 +358,7 @@ int xc_domain_memory_decrease_reservatio
 
     if ( err > 0 )
     {
-        fprintf(stderr,"Failed deallocation for dom %d: %ld pages order %d\n",
+        DPRINTF("Failed deallocation for dom %d: %ld pages order %d\n",
                 domid, nr_extents, extent_order);
         errno = EBUSY;
         err = -1;
@@ -380,7 +389,7 @@ int xc_domain_memory_populate_physmap(in
 
     if ( err > 0 )
     {
-        fprintf(stderr,"Failed deallocation for dom %d: %ld pages order %d\n",
+        DPRINTF("Failed deallocation for dom %d: %ld pages order %d\n",
                 domid, nr_extents, extent_order);
         errno = EBUSY;
         err = -1;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2006-06-06 12:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44857BD8.40003@virtualiron.com \
    --to=bthomas@virtualiron.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.