[Qemu-devel] [PATCH 11/17] savevm: adjust ram_control_save_page for page flipping

2013-11-21 Thread Lei Li
As callback save_page will always be opened by
qemu_fopen_socket_local(), and without unix_page_flipping
it will return RAM_SAVE_CONTROL_NOT_SUPP, it leads to a
wrong qemu_file_set_error() based on the current logic.
So this patch adds RAM_SAVE_CONTROL_NOT_SUPP to the check.

Reviewed-by: Paolo Bonzini pbonz...@redhat.com
Signed-off-by: Lei Li li...@linux.vnet.ibm.com
---
 savevm.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/savevm.c b/savevm.c
index 3ee256e..4576145 100644
--- a/savevm.c
+++ b/savevm.c
@@ -668,7 +668,8 @@ size_t ram_control_save_page(QEMUFile *f, MemoryRegion *mr, 
ram_addr_t offset,
 int ret = f-ops-save_page(f, f-opaque, mr, offset,
 size, bytes_sent);
 
-if (ret != RAM_SAVE_CONTROL_DELAYED) {
+if (ret != RAM_SAVE_CONTROL_DELAYED 
+ret != RAM_SAVE_CONTROL_NOT_SUPP) {
 if (bytes_sent  *bytes_sent  0) {
 qemu_update_position(f, *bytes_sent);
 } else if (ret  0) {
-- 
1.7.7.6




Re: [Qemu-devel] [PATCH 11/17] savevm: adjust ram_control_save_page for page flipping

2013-10-24 Thread Paolo Bonzini
Il 22/10/2013 04:25, Lei Li ha scritto:
 As callback save_page will always be opened by
 qemu_fopen_socket_local(), and without unix_page_flipping
 it will return RAM_SAVE_CONTROL_NOT_SUPP, it leads to a
 wrong qemu_file_set_error() based on the current logic.
 So this patch adds RAM_SAVE_CONTROL_NOT_SUPP to the check.
 
 Signed-off-by: Lei Li li...@linux.vnet.ibm.com
 ---
  savevm.c |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
 
 diff --git a/savevm.c b/savevm.c
 index 56b8643..b102275 100644
 --- a/savevm.c
 +++ b/savevm.c
 @@ -668,7 +668,8 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t 
 block_offset,
  int ret = f-ops-save_page(f, f-opaque, block_offset,
  offset, size, bytes_sent);
  
 -if (ret != RAM_SAVE_CONTROL_DELAYED) {
 +if (ret != RAM_SAVE_CONTROL_DELAYED 
 +ret != RAM_SAVE_CONTROL_NOT_SUPP) {
  if (bytes_sent  *bytes_sent  0) {
  qemu_update_position(f, *bytes_sent);
  } else if (ret  0) {
 

Reviewed-by: Paolo Bonzini pbonz...@redhat.com



[Qemu-devel] [PATCH 11/17] savevm: adjust ram_control_save_page for page flipping

2013-10-21 Thread Lei Li
As callback save_page will always be opened by
qemu_fopen_socket_local(), and without unix_page_flipping
it will return RAM_SAVE_CONTROL_NOT_SUPP, it leads to a
wrong qemu_file_set_error() based on the current logic.
So this patch adds RAM_SAVE_CONTROL_NOT_SUPP to the check.

Signed-off-by: Lei Li li...@linux.vnet.ibm.com
---
 savevm.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/savevm.c b/savevm.c
index 56b8643..b102275 100644
--- a/savevm.c
+++ b/savevm.c
@@ -668,7 +668,8 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t 
block_offset,
 int ret = f-ops-save_page(f, f-opaque, block_offset,
 offset, size, bytes_sent);
 
-if (ret != RAM_SAVE_CONTROL_DELAYED) {
+if (ret != RAM_SAVE_CONTROL_DELAYED 
+ret != RAM_SAVE_CONTROL_NOT_SUPP) {
 if (bytes_sent  *bytes_sent  0) {
 qemu_update_position(f, *bytes_sent);
 } else if (ret  0) {
-- 
1.7.7.6