All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akio Takebe <takebe_akio@jp.fujitsu.com>
To: Akio Takebe <takebe_akio@jp.fujitsu.com>,
	Ken Hironaka <hironaka.ken@soft.fujitsu.com>,
	xen-devel@lists.xensource.com
Subject: Re: [PATCH][XEN]xm dump command add on
Date: Wed, 16 Aug 2006 09:57:55 +0900	[thread overview]
Message-ID: <2C6C0CF01F3CDtakebe_akio@jp.fujitsu.com> (raw)
In-Reply-To: <1C6C0CE6886BAtakebe_akio@jp.fujitsu.com>

Oops I send wrong patch.


>Hi, Ken
>
>Good work!
>But you should check coding-style. ;-)
>
>How about the following patch?
>I think cpy_sts is always -1 or 0.
>I think checking error counter is more worth than error status.
>I don't test the following patch. This is RFC.
>

How about the following patch? 

diff -r bef360142b62 tools/libxc/xc_core.c
--- a/tools/libxc/xc_core.c     Mon Aug 14 14:21:21 2006 -0600
+++ b/tools/libxc/xc_core.c     Wed Aug 16 09:59:21 2006 +0900
@@ -37,6 +37,7 @@ xc_domain_dumpcore_via_callback(int xc_h
     char dummy[PAGE_SIZE];
     int dummy_len;
     int sts;
+    unsigned int err_cnt = 0;
 
     if ( (dump_mem_start = malloc(DUMP_INCREMENT*PAGE_SIZE)) == NULL )
     {
@@ -103,7 +104,10 @@ xc_domain_dumpcore_via_callback(int xc_h
 
     for ( dump_mem = dump_mem_start, i = 0; i < nr_pages; i++ )
     {
-        copy_from_domain_page(xc_handle, domid, page_array[i], dump_mem);
+        sts = copy_from_domain_page(xc_handle, domid, page_array[i], dump_mem);
+        if ( sts != 0 )
+            err_cnt++;
+
         dump_mem += PAGE_SIZE;
         if ( ((i + 1) % DUMP_INCREMENT == 0) || ((i + 1) == nr_pages) )
         {
@@ -112,6 +116,11 @@ xc_domain_dumpcore_via_callback(int xc_h
                 goto error_out;
             dump_mem = dump_mem_start;
         }
+    }
+
+    if ( err_cnt != 0 ){
+        IPRINTF("Could not copy from domid=%d (%d)pages\n", domid, err_cnt);
+        goto error_out;
     }
 
     free(dump_mem_start);

Best Regards,

Akio Takebe

  reply	other threads:[~2006-08-16  0:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-14  8:03 [PATCH][XEN]xm dump command add on Ken Hironaka
2006-08-14 12:28 ` Jimi Xenidis
2006-08-14 12:31   ` Keir Fraser
2006-08-14 23:57     ` Ken Hironaka
2006-08-14 14:50 ` John Levon
2006-08-14 23:49   ` Ken Hironaka
2006-08-14 23:58     ` John Levon
2006-08-15  2:19       ` Ken Hironaka
2006-08-16  0:53 ` Akio Takebe
2006-08-16  0:57   ` Akio Takebe [this message]
2006-08-16  1:13   ` Ken Hironaka
2006-08-16  1:57     ` Akio Takebe
  -- strict thread matches above, loose matches on Subject: below --
2006-08-16 17:01 Graham, Simon
2006-08-16 23:57 ` Ken Hironaka
2006-08-17  2:47 Graham, Simon
2006-08-17  8:13 ` Ken Hironaka
2006-08-21 15:48   ` John Levon
2006-08-22  0:26     ` Ken Hironaka

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=2C6C0CF01F3CDtakebe_akio@jp.fujitsu.com \
    --to=takebe_akio@jp.fujitsu.com \
    --cc=hironaka.ken@soft.fujitsu.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.