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

[Xen-devel] [PATCH] avoid duplication of domain ID in messages



text doesn't need to repeat that.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: 2007-12-10/xen/arch/x86/hvm/hvm.c
===================================================================
--- 2007-12-10.orig/xen/arch/x86/hvm/hvm.c      2007-12-10 09:19:12.000000000 
+0100
+++ 2007-12-10/xen/arch/x86/hvm/hvm.c   2007-12-10 09:22:53.000000000 +0100
@@ -533,8 +533,7 @@ static void hvm_vcpu_down(void)
     struct domain *d = v->domain;
     int online_count = 0;
 
-    gdprintk(XENLOG_INFO, "DOM%d/VCPU%d: going offline.\n",
-           d->domain_id, v->vcpu_id);
+    gdprintk(XENLOG_INFO, "VCPU%d: going offline.\n", v->vcpu_id);
 
     /* Doesn't halt us immediately, but we'll never return to guest context. */
     set_bit(_VPF_down, &v->pause_flags);
@@ -550,8 +549,7 @@ static void hvm_vcpu_down(void)
     /* ... Shut down the domain if not. */
     if ( online_count == 0 )
     {
-        gdprintk(XENLOG_INFO, "DOM%d: all CPUs offline -- powering off.\n",
-                d->domain_id);
+        gdprintk(XENLOG_INFO, "all CPUs offline -- powering off.\n");
         domain_shutdown(d, SHUTDOWN_poweroff);
     }
 }
Index: 2007-12-10/xen/arch/x86/mm.c
===================================================================
--- 2007-12-10.orig/xen/arch/x86/mm.c   2007-12-05 17:13:57.000000000 +0100
+++ 2007-12-10/xen/arch/x86/mm.c        2007-12-10 09:22:53.000000000 +0100
@@ -2028,8 +2028,7 @@ static int set_foreigndom(domid_t domid)
 
     if ( unlikely(domid == d->domain_id) )
     {
-        MEM_LOG("Dom %u tried to specify itself as foreign domain",
-                d->domain_id);
+        MEM_LOG("Cannot specify itself as foreign domain");
         okay = 0;
     }
     else if ( unlikely(paging_mode_translate(d)) )
@@ -2045,7 +2044,7 @@ static int set_foreigndom(domid_t domid)
             info->foreign = rcu_lock_domain(dom_io);
             break;
         default:
-            MEM_LOG("Dom %u cannot set foreign dom", d->domain_id);
+            MEM_LOG("Cannot set foreign dom");
             okay = 0;
             break;
         }
@@ -2336,8 +2335,7 @@ int do_mmuext_op(
 
             if ( paging_mode_external(d) )
             {
-                MEM_LOG("ignoring SET_LDT hypercall from external "
-                        "domain %u", d->domain_id);
+                MEM_LOG("ignoring SET_LDT hypercall from external domain");
                 okay = 0;
             }
             else if ( ((ptr & (PAGE_SIZE-1)) != 0) || 
Index: 2007-12-10/xen/arch/x86/mm/paging.c
===================================================================
--- 2007-12-10.orig/xen/arch/x86/mm/paging.c    2007-11-26 16:57:03.000000000 
+0100
+++ 2007-12-10/xen/arch/x86/mm/paging.c 2007-12-10 09:22:53.000000000 +0100
@@ -512,8 +512,7 @@ int paging_domctl(struct domain *d, xen_
 
     if ( unlikely(d == current->domain) )
     {
-        gdprintk(XENLOG_INFO, "Dom %u tried to do a paging op on itself.\n",
-                 d->domain_id);
+        gdprintk(XENLOG_INFO, "Tried to do a paging op on itself.\n");
         return -EINVAL;
     }
 
Index: 2007-12-10/xen/arch/x86/traps.c
===================================================================
--- 2007-12-10.orig/xen/arch/x86/traps.c        2007-12-10 09:19:12.000000000 
+0100
+++ 2007-12-10/xen/arch/x86/traps.c     2007-12-10 09:24:04.000000000 +0100
@@ -408,10 +408,9 @@ static int do_guest_trap(
         tb->flags |= TBF_INTERRUPT;
 
     if ( unlikely(null_trap_bounce(v, tb)) )
-        gdprintk(XENLOG_WARNING, "Unhandled %s fault/trap [#%d] in "
-                 "domain %d on VCPU %d [ec=%04x]\n",
-                 trapstr(trapnr), trapnr, v->domain->domain_id, v->vcpu_id,
-                 regs->error_code);
+        gdprintk(XENLOG_WARNING, "Unhandled %s fault/trap [#%d] "
+                 "on VCPU %d [ec=%04x]\n",
+                 trapstr(trapnr), trapnr, v->vcpu_id, regs->error_code);
 
     return 0;
 }
@@ -570,8 +569,8 @@ int wrmsr_hypervisor_regs(
         if ( idx > 0 )
         {
             gdprintk(XENLOG_WARNING,
-                    "Dom%d: Out of range index %u to MSR %08x\n",
-                    d->domain_id, idx, 0x40000000);
+                     "Out of range index %u to MSR %08x\n",
+                     idx, 0x40000000);
             return 0;
         }
 
@@ -581,8 +580,8 @@ int wrmsr_hypervisor_regs(
              !get_page_and_type(mfn_to_page(mfn), d, PGT_writable_page) )
         {
             gdprintk(XENLOG_WARNING,
-                    "Dom%d: Bad GMFN %lx (MFN %lx) to MSR %08x\n",
-                    d->domain_id, gmfn, mfn, 0x40000000);
+                     "Bad GMFN %lx (MFN %lx) to MSR %08x\n",
+                     gmfn, mfn, 0x40000000);
             return 0;
         }
 
Index: 2007-12-10/xen/common/event_channel.c
===================================================================
--- 2007-12-10.orig/xen/common/event_channel.c  2007-09-10 09:59:37.000000000 
+0200
+++ 2007-12-10/xen/common/event_channel.c       2007-12-10 09:22:53.000000000 
+0100
@@ -42,8 +42,16 @@
 #define ERROR_EXIT(_errno)                                          \
     do {                                                            \
         gdprintk(XENLOG_WARNING,                                    \
-                "EVTCHNOP failure: domain %d, error %d, line %d\n", \
-                current->domain->domain_id, (_errno), __LINE__);    \
+                "EVTCHNOP failure: error %d\n",                     \
+                (_errno));                                          \
+        rc = (_errno);                                              \
+        goto out;                                                   \
+    } while ( 0 )
+#define ERROR_EXIT_DOM(_errno, _dom)                                \
+    do {                                                            \
+        gdprintk(XENLOG_WARNING,                                    \
+                "EVTCHNOP failure: domain %d, error %d\n",          \
+                (_dom)->domain_id, (_errno));                       \
         rc = (_errno);                                              \
         goto out;                                                   \
     } while ( 0 )
@@ -132,7 +140,7 @@ static long evtchn_alloc_unbound(evtchn_
     spin_lock(&d->evtchn_lock);
 
     if ( (port = get_free_port(d)) < 0 )
-        ERROR_EXIT(port);
+        ERROR_EXIT_DOM(port, d);
     chn = evtchn_from_port(d, port);
 
     rc = xsm_evtchn_unbound(d, chn, alloc->remote_dom);
@@ -186,11 +194,11 @@ static long evtchn_bind_interdomain(evtc
     lchn = evtchn_from_port(ld, lport);
 
     if ( !port_is_valid(rd, rport) )
-        ERROR_EXIT(-EINVAL);
+        ERROR_EXIT_DOM(-EINVAL, rd);
     rchn = evtchn_from_port(rd, rport);
     if ( (rchn->state != ECS_UNBOUND) ||
          (rchn->u.unbound.remote_domid != ld->domain_id) )
-        ERROR_EXIT(-EINVAL);
+        ERROR_EXIT_DOM(-EINVAL, rd);
 
     rc = xsm_evtchn_interdomain(ld, lchn, rd, rchn);
     if ( rc )
Index: 2007-12-10/xen/common/schedule.c
===================================================================
--- 2007-12-10.orig/xen/common/schedule.c       2007-09-27 10:42:44.000000000 
+0200
+++ 2007-12-10/xen/common/schedule.c    2007-12-10 09:22:53.000000000 +0100
@@ -524,9 +524,9 @@ long do_set_timer_op(s_time_t timeout)
          * timeout in this case can burn a lot of CPU. We therefore go for a
          * reasonable middleground of triggering a timer event in 100ms.
          */
-        gdprintk(XENLOG_INFO, "Warning: huge timeout set by domain %d "
-                "(vcpu %d): %"PRIx64"\n",
-                v->domain->domain_id, v->vcpu_id, (uint64_t)timeout);
+        gdprintk(XENLOG_INFO,
+                 "Warning: huge timeout set by vcpu %d: %"PRIx64"\n",
+                 v->vcpu_id, (uint64_t)timeout);
         set_timer(&v->singleshot_timer, NOW() + MILLISECS(100));
     }
     else



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


 


Rackspace

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