From: Orit Wasserman <owasserm@redhat.com>
To: qemu-devel@nongnu.org
Cc: blauwirbel@gmail.com, stefanha@gmail.com,
Orit Wasserman <owasserm@redhat.com>,
avi@redhat.com, quintela@redhat.com
Subject: [Qemu-devel] [PATCH v6 03/11] Add save_block_hdr function
Date: Wed, 25 Jan 2012 13:26:41 +0200 [thread overview]
Message-ID: <1327490809-21393-4-git-send-email-owasserm@redhat.com> (raw)
In-Reply-To: <1327490809-21393-1-git-send-email-owasserm@redhat.com>
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
---
arch_init.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index 34e4e60..1218306 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -300,6 +300,16 @@ static void cache_insert(unsigned long addr, uint8_t *pdata)
it->it_addr = addr;
}
+static void save_block_hdr(QEMUFile *f, RAMBlock *block, ram_addr_t offset,
+ int cont, int flag)
+{
+ qemu_put_be64(f, offset | cont | flag);
+ if (!cont) {
+ qemu_put_byte(f, strlen(block->idstr));
+ qemu_put_buffer(f, (uint8_t *)block->idstr,
+ strlen(block->idstr));
+ }
+}
static RAMBlock *last_block;
static ram_addr_t last_offset;
@@ -326,21 +336,11 @@ static int ram_save_block(QEMUFile *f)
p = memory_region_get_ram_ptr(mr) + offset;
if (is_dup_page(p)) {
- qemu_put_be64(f, offset | cont | RAM_SAVE_FLAG_COMPRESS);
- if (!cont) {
- qemu_put_byte(f, strlen(block->idstr));
- qemu_put_buffer(f, (uint8_t *)block->idstr,
- strlen(block->idstr));
- }
+ save_block_hdr(f, block, offset, cont, RAM_SAVE_FLAG_COMPRESS);
qemu_put_byte(f, *p);
bytes_sent = 1;
} else {
- qemu_put_be64(f, offset | cont | RAM_SAVE_FLAG_PAGE);
- if (!cont) {
- qemu_put_byte(f, strlen(block->idstr));
- qemu_put_buffer(f, (uint8_t *)block->idstr,
- strlen(block->idstr));
- }
+ save_block_hdr(f, block, offset, cont, RAM_SAVE_FLAG_PAGE);
qemu_put_buffer(f, p, TARGET_PAGE_SIZE);
bytes_sent = TARGET_PAGE_SIZE;
}
--
1.7.6.5
next prev parent reply other threads:[~2012-01-25 11:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-25 11:26 [Qemu-devel] [PATCH v6 00/11] XBRLE delta for live migration of large memory app Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 01/11] Add cache handling functions Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 02/11] Add uleb encoding/decoding functions Orit Wasserman
2012-01-25 11:48 ` Avi Kivity
2012-01-25 12:22 ` Orit Wasserman
2012-01-25 12:27 ` Orit Wasserman
2012-01-25 11:26 ` Orit Wasserman [this message]
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 04/11] Add host_from_stream_offset_versioned function Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 05/11] Add XBZRLE to ram_save_block and ram_save_live Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 06/11] Add MigrationParams structure Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 07/11] Add XBZRLE parameters to MigrationState Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 08/11] Add migration capabilties Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 09/11] Add set_cachesize command Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 10/11] Add XBZRLE option to migrate command Orit Wasserman
2012-01-25 11:26 ` [Qemu-devel] [PATCH v6 11/11] Add XBZRLE statstics information Orit Wasserman
2012-01-25 11:53 ` [Qemu-devel] [PATCH v6 00/11] XBRLE delta for live migration of large memory app Avi Kivity
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=1327490809-21393-4-git-send-email-owasserm@redhat.com \
--to=owasserm@redhat.com \
--cc=avi@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).