All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/3] Migration pull request
@ 2015-03-26 14:45 Juan Quintela
  2015-03-26 14:45 ` [Qemu-devel] [PULL 1/3] Avoid crashing on multiple -incoming Juan Quintela
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Juan Quintela @ 2015-03-26 14:45 UTC (permalink / raw)
  To: qemu-devel

Hi Peter,

In this pull requset:
- rdma fixes (Padmanabh)
- fix crash on multiple -incoming (dave)
- don't access last_sent_block outside migration_thread (me)
  It is needed by migration compression patches

Please apply.

Thanks, Juan.


The following changes since commit 087c4c9419d3086ac0a920899e4fed8ceaf9bb2b:

  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2015-03-26 12:18:44 +0000)

are available in the git repository at:

  git://github.com/juanquintela/qemu.git tags/migration/20150326

for you to fetch changes up to 43edc0ed11a4d25f2fe67bb9d89a8a6a0a43b1e0:

  migration:  remove last_sent_block from save_page_header (2015-03-26 15:31:46 +0100)

----------------------------------------------------------------
migration/next for 20150326

----------------------------------------------------------------
Dr. David Alan Gilbert (1):
      Avoid crashing on multiple -incoming

Juan Quintela (1):
      migration:  remove last_sent_block from save_page_header

Padmanabh Ratnakar (1):
      rdma: Fix cleanup in error paths

 arch_init.c      | 12 ++++++------
 migration/rdma.c | 22 ++++++++--------------
 vl.c             |  4 +++-
 3 files changed, 17 insertions(+), 21 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PULL 1/3] Avoid crashing on multiple -incoming
  2015-03-26 14:45 [Qemu-devel] [PULL 0/3] Migration pull request Juan Quintela
@ 2015-03-26 14:45 ` Juan Quintela
  2015-03-26 14:45 ` [Qemu-devel] [PULL 2/3] rdma: Fix cleanup in error paths Juan Quintela
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Juan Quintela @ 2015-03-26 14:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Passing multiple -incoming options used to crash qemu (due to
an invalid state transition incoming->incoming).  Instead we now
take the last -incoming option, e.g.:

qemu-system-x86_64 -nographic -incoming tcp::4444 -incoming defer

ends up doing the defer.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 vl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vl.c b/vl.c
index 75ec292..74c2681 100644
--- a/vl.c
+++ b/vl.c
@@ -3618,8 +3618,10 @@ int main(int argc, char **argv, char **envp)
                 }
                 break;
             case QEMU_OPTION_incoming:
+                if (!incoming) {
+                    runstate_set(RUN_STATE_INMIGRATE);
+                }
                 incoming = optarg;
-                runstate_set(RUN_STATE_INMIGRATE);
                 break;
             case QEMU_OPTION_nodefaults:
                 has_defaults = 0;
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PULL 2/3] rdma: Fix cleanup in error paths
  2015-03-26 14:45 [Qemu-devel] [PULL 0/3] Migration pull request Juan Quintela
  2015-03-26 14:45 ` [Qemu-devel] [PULL 1/3] Avoid crashing on multiple -incoming Juan Quintela
@ 2015-03-26 14:45 ` Juan Quintela
  2015-03-26 14:45 ` [Qemu-devel] [PULL 3/3] migration: remove last_sent_block from save_page_header Juan Quintela
  2015-03-26 15:42 ` [Qemu-devel] [PULL 0/3] Migration pull request Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Juan Quintela @ 2015-03-26 14:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Padmanabh Ratnakar, Meghana Cheripady

From: Padmanabh Ratnakar <padmanabh.ratnakar@Emulex.Com>

As part of commit e325b49a320b493cc5d69e263751ff716dc458fe,
order in which resources are destroyed was changed for fixing
a seg fault. Due to this change, CQ will never get destroyed as
CQ should be destroyed after QP destruction. Seg fault is caused
improper cleanup when connection fails. Fixing cleanup after
connection failure and order in which resources are destroyed
in qemu_rdma_cleanup() routine.

Signed-off-by: Meghana Cheripady <meghana.cheripady@emulex.com>
Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/rdma.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/migration/rdma.c b/migration/rdma.c
index e6c3a67..77e3444 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -2194,6 +2194,10 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
         }
     }

+    if (rdma->qp) {
+        rdma_destroy_qp(rdma->cm_id);
+        rdma->qp = NULL;
+    }
     if (rdma->cq) {
         ibv_destroy_cq(rdma->cq);
         rdma->cq = NULL;
@@ -2206,18 +2210,14 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
         ibv_dealloc_pd(rdma->pd);
         rdma->pd = NULL;
     }
-    if (rdma->listen_id) {
-        rdma_destroy_id(rdma->listen_id);
-        rdma->listen_id = NULL;
-    }
     if (rdma->cm_id) {
-        if (rdma->qp) {
-            rdma_destroy_qp(rdma->cm_id);
-            rdma->qp = NULL;
-        }
         rdma_destroy_id(rdma->cm_id);
         rdma->cm_id = NULL;
     }
+    if (rdma->listen_id) {
+        rdma_destroy_id(rdma->listen_id);
+        rdma->listen_id = NULL;
+    }
     if (rdma->channel) {
         rdma_destroy_event_channel(rdma->channel);
         rdma->channel = NULL;
@@ -2309,8 +2309,6 @@ static int qemu_rdma_connect(RDMAContext *rdma, Error **errp)
     if (ret) {
         perror("rdma_connect");
         ERROR(errp, "connecting to destination!");
-        rdma_destroy_id(rdma->cm_id);
-        rdma->cm_id = NULL;
         goto err_rdma_source_connect;
     }

@@ -2319,8 +2317,6 @@ static int qemu_rdma_connect(RDMAContext *rdma, Error **errp)
         perror("rdma_get_cm_event after rdma_connect");
         ERROR(errp, "connecting to destination!");
         rdma_ack_cm_event(cm_event);
-        rdma_destroy_id(rdma->cm_id);
-        rdma->cm_id = NULL;
         goto err_rdma_source_connect;
     }

@@ -2328,8 +2324,6 @@ static int qemu_rdma_connect(RDMAContext *rdma, Error **errp)
         perror("rdma_get_cm_event != EVENT_ESTABLISHED after rdma_connect");
         ERROR(errp, "connecting to destination!");
         rdma_ack_cm_event(cm_event);
-        rdma_destroy_id(rdma->cm_id);
-        rdma->cm_id = NULL;
         goto err_rdma_source_connect;
     }
     rdma->connected = true;
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PULL 3/3] migration: remove last_sent_block from save_page_header
  2015-03-26 14:45 [Qemu-devel] [PULL 0/3] Migration pull request Juan Quintela
  2015-03-26 14:45 ` [Qemu-devel] [PULL 1/3] Avoid crashing on multiple -incoming Juan Quintela
  2015-03-26 14:45 ` [Qemu-devel] [PULL 2/3] rdma: Fix cleanup in error paths Juan Quintela
@ 2015-03-26 14:45 ` Juan Quintela
  2015-03-26 15:42 ` [Qemu-devel] [PULL 0/3] Migration pull request Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Juan Quintela @ 2015-03-26 14:45 UTC (permalink / raw)
  To: qemu-devel

Compression code (still not on tree) want to call this funtion from
outside the migration thread, so we can't write to last_sent_block.

Instead of reverting full patch:

[PULL 07/11] save_block_hdr: we can recalculate

Just revert the parts that touch last_sent_block.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 arch_init.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch_init.c b/arch_init.c
index fcfa328..4c8fcee 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -332,19 +332,14 @@ static size_t save_page_header(QEMUFile *f, RAMBlock *block, ram_addr_t offset)
 {
     size_t size;

-    if (block == last_sent_block) {
-        offset |= RAM_SAVE_FLAG_CONTINUE;
-    }
-
     qemu_put_be64(f, offset);
     size = 8;

-    if (block != last_sent_block) {
+    if (!(offset & RAM_SAVE_FLAG_CONTINUE)) {
         qemu_put_byte(f, strlen(block->idstr));
         qemu_put_buffer(f, (uint8_t *)block->idstr,
                         strlen(block->idstr));
         size += 1 + strlen(block->idstr);
-        last_sent_block = block;
     }
     return size;
 }
@@ -644,6 +639,10 @@ static int ram_save_page(QEMUFile *f, RAMBlock* block, ram_addr_t offset,
     XBZRLE_cache_lock();

     current_addr = block->offset + offset;
+
+    if (block == last_sent_block) {
+        offset |= RAM_SAVE_FLAG_CONTINUE;
+    }
     if (ret != RAM_SAVE_CONTROL_NOT_SUPP) {
         if (ret != RAM_SAVE_CONTROL_DELAYED) {
             if (bytes_xmit > 0) {
@@ -739,6 +738,7 @@ static int ram_find_and_save_block(QEMUFile *f, bool last_stage,

             /* if page is unmodified, continue to the next */
             if (pages > 0) {
+                last_sent_block = block;
                 break;
             }
         }
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PULL 0/3] Migration pull request
  2015-03-26 14:45 [Qemu-devel] [PULL 0/3] Migration pull request Juan Quintela
                   ` (2 preceding siblings ...)
  2015-03-26 14:45 ` [Qemu-devel] [PULL 3/3] migration: remove last_sent_block from save_page_header Juan Quintela
@ 2015-03-26 15:42 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2015-03-26 15:42 UTC (permalink / raw)
  To: Juan Quintela; +Cc: QEMU Developers

On 26 March 2015 at 14:45, Juan Quintela <quintela@redhat.com> wrote:
> Hi Peter,
>
> In this pull requset:
> - rdma fixes (Padmanabh)
> - fix crash on multiple -incoming (dave)
> - don't access last_sent_block outside migration_thread (me)
>   It is needed by migration compression patches
>
> Please apply.
>
> Thanks, Juan.
>
>
> The following changes since commit 087c4c9419d3086ac0a920899e4fed8ceaf9bb2b:
>
>   Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2015-03-26 12:18:44 +0000)
>
> are available in the git repository at:
>
>   git://github.com/juanquintela/qemu.git tags/migration/20150326
>
> for you to fetch changes up to 43edc0ed11a4d25f2fe67bb9d89a8a6a0a43b1e0:
>
>   migration:  remove last_sent_block from save_page_header (2015-03-26 15:31:46 +0100)
>
> ----------------------------------------------------------------
> migration/next for 20150326
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-26 15:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-26 14:45 [Qemu-devel] [PULL 0/3] Migration pull request Juan Quintela
2015-03-26 14:45 ` [Qemu-devel] [PULL 1/3] Avoid crashing on multiple -incoming Juan Quintela
2015-03-26 14:45 ` [Qemu-devel] [PULL 2/3] rdma: Fix cleanup in error paths Juan Quintela
2015-03-26 14:45 ` [Qemu-devel] [PULL 3/3] migration: remove last_sent_block from save_page_header Juan Quintela
2015-03-26 15:42 ` [Qemu-devel] [PULL 0/3] Migration pull request Peter Maydell

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.