qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/8] migration: support to detect compressionand


From: Xiao Guangrong
Subject: Re: [Qemu-devel] [PATCH 3/8] migration: support to detect compressionand decompression errors
Date: Mon, 19 Mar 2018 16:01:30 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0



On 03/19/2018 03:56 PM, address@hidden wrote:
Hi, guangrong
@@ -1051,11 +1052,13 @@ static int do_compress_ram_page(QEMUFile *f, z_stream 
*stream, RAMBlock *block,
{
RAMState *rs = ram_state;
int bytes_sent, blen;
-    uint8_t *p = block->host + (offset & TARGET_PAGE_MASK);
+    uint8_t buf[TARGET_PAGE_SIZE], *p;

+    p = block->host + (offset & TARGET_PAGE_MASK);
bytes_sent = save_page_header(rs, f, block, offset |
RAM_SAVE_FLAG_COMPRESS_PAGE);
-    blen = qemu_put_compression_data(f, stream, p, TARGET_PAGE_SIZE);
+    memcpy(buf, p, TARGET_PAGE_SIZE);
+    blen = qemu_put_compression_data(f, stream, buf, TARGET_PAGE_SIZE);
Memory copy operation for every page to be compressed is not cheap, especially
when the page number is huge, and it may be not necessary for pages never
updated during migration.

This is only for 4k page.

Is there any possibility that we can distinguish the real compress/decompress
errors from those being caused by source VM updating? Such as the return
value of qemu_uncompress(distinguish Z_DATA_ERROR and other error codes
returned by inflate())?

Unfortunately, no. :(



reply via email to

[Prev in Thread] Current Thread [Next in Thread]