1. 26 5月, 2016 10 次提交
  2. 24 5月, 2016 2 次提交
    • G
      migration: regain control of images when migration fails to complete · fe904ea8
      Greg Kurz 提交于
      We currently have an error path during migration that can cause
      the source QEMU to abort:
      
      migration_thread()
        migration_completion()
          runstate_is_running() ----------------> true if guest is running
          bdrv_inactivate_all() ----------------> inactivate images
          qemu_savevm_state_complete_precopy()
           ... qemu_fflush()
                 socket_writev_buffer() --------> error because destination fails
               qemu_fflush() -------------------> set error on migration stream
        migration_completion() -----------------> set migrate state to FAILED
      migration_thread() -----------------------> break migration loop
        vm_start() -----------------------------> restart guest with inactive
                                                  images
      
      and you get:
      
      qemu-system-ppc64: socket_writev_buffer: Got err=104 for (32768/18446744073709551615)
      qemu-system-ppc64: /home/greg/Work/qemu/qemu-master/block/io.c:1342:bdrv_co_do_pwritev: Assertion `!(bs->open_flags & 0x0800)' failed.
      Aborted (core dumped)
      
      If we try postcopy with a similar scenario, we also get the writev error
      message but QEMU leaves the guest paused because entered_postcopy is true.
      
      We could possibly do the same with precopy and leave the guest paused.
      But since the historical default for migration errors is to restart the
      source, this patch adds a call to bdrv_invalidate_cache_all() instead.
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      Message-Id: <146357896785.6003.11983081732454362715.stgit@bahia.huguette.org>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      fe904ea8
    • G
      savevm: fail if migration blockers are present · 24f3902b
      Greg Kurz 提交于
      QEMU has currently two ways to prevent migration to occur:
      - migration blocker when it depends on runtime state
      - VMStateDescription.unmigratable when migration is not supported at all
      
      This patch gathers all the logic into a single function to be called from
      both the savevm and the migrate paths.
      
      This fixes a bug with 9p, at least, where savevm would succeed and the
      following would happen in the guest after loadvm:
      
      $ ls /host
      ls: cannot access /host: Protocol error
      
      With this patch:
      
      (qemu) savevm foo
      Migration is disabled when VirtFS export path '/' is mounted in the guest
      using mount_tag 'host'
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <146239057139.11271.9011797645454781543.stgit@bahia.huguette.org>
      
      [Update subject according to Paolo's suggestion - Amit]
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      24f3902b
  3. 23 5月, 2016 1 次提交
  4. 18 5月, 2016 1 次提交
  5. 23 3月, 2016 1 次提交
  6. 11 3月, 2016 2 次提交
  7. 08 3月, 2016 1 次提交
  8. 26 2月, 2016 1 次提交
    • D
      migration (ordinary): move bdrv_invalidate_cache_all of of coroutine context · 0aa6aefc
      Denis V. Lunev 提交于
      There is a possibility to hit an assert in qcow2_get_specific_info that
      s->qcow_version is undefined. This happens when VM in starting from
      suspended state, i.e. it processes incoming migration, and in the same
      time 'info block' is called.
      
      The problem is that qcow2_invalidate_cache() closes the image and
      memset()s BDRVQcowState in the middle.
      
      The patch moves processing of bdrv_invalidate_cache_all out of
      coroutine context for standard migration to avoid that.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Juan Quintela <quintela@redhat.com>
      CC: Amit Shah <amit.shah@redhat.com>
      Message-Id: <1456304019-10507-2-git-send-email-den@openvz.org>
      
      [Amit: Fix a use-after-free bug]
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      0aa6aefc
  9. 23 2月, 2016 1 次提交
    • D
      Postcopy+spice: Pass spice migration data earlier · b82fc321
      Dr. David Alan Gilbert 提交于
      Spice hooks the migration status changes to figure out when to
      transmit information to the new spice server; but the migration
      status in postcopy doesn't quite fit - the destination starts
      running before the end of the source migration.
      
      It's not a case of hanging off the migration status change to
      postcopy-active either, since that happens before we stop the
      guest CPU.
      
      Fix it by sending a notify just after sending the device state,
      and adding a flag that can be tested by the notify receiver.
      
      Symptom:
         spice handover doesn't work with the error:
         red_worker.c:11540:display_channel_wait_for_migrate_data: timeout
      Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: NAmit Shah <amit.shah@redhat.com>
      Message-id: 1456161452-25318-1-git-send-email-dgilbert@redhat.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      b82fc321
  10. 11 2月, 2016 1 次提交
  11. 05 2月, 2016 2 次提交
  12. 29 1月, 2016 1 次提交
  13. 20 1月, 2016 1 次提交
    • K
      block: Inactivate BDS when migration completes · 76b1c7fe
      Kevin Wolf 提交于
      So far, live migration with shared storage meant that the image is in a
      not-really-ready don't-touch-me state on the destination while the
      source is still actively using it, but after completing the migration,
      the image was fully opened on both sides. This is bad.
      
      This patch adds a block driver callback to inactivate images on the
      source before completing the migration. Inactivation means that it goes
      to a state as if it was just live migrated to the qemu instance on the
      source (i.e. BDRV_O_INACTIVE is set). You're then supposed to continue
      either on the source or on the destination, which takes ownership of the
      image.
      
      A typical migration looks like this now with respect to disk images:
      
      1. Destination qemu is started, the image is opened with
         BDRV_O_INACTIVE. The image is fully opened on the source.
      
      2. Migration is about to complete. The source flushes the image and
         inactivates it. Now both sides have the image opened with
         BDRV_O_INACTIVE and are expecting the other side to still modify it.
      
      3. One side (the destination on success) continues and calls
         bdrv_invalidate_all() in order to take ownership of the image again.
         This removes BDRV_O_INACTIVE on the resuming side; the flag remains
         set on the other side.
      
      This ensures that the same image isn't written to by both instances
      (unless both are resumed, but then you get what you deserve). This is
      important because .bdrv_close for non-BDRV_O_INACTIVE images could write
      to the image file, which is definitely forbidden while another host is
      using the image.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      76b1c7fe
  14. 13 1月, 2016 2 次提交
  15. 17 12月, 2015 1 次提交
    • E
      qapi: Don't let implicit enum MAX member collide · 7fb1cf16
      Eric Blake 提交于
      Now that we guarantee the user doesn't have any enum values
      beginning with a single underscore, we can use that for our
      own purposes.  Renaming ENUM_MAX to ENUM__MAX makes it obvious
      that the sentinel is generated.
      
      This patch was mostly generated by applying a temporary patch:
      
      |diff --git a/scripts/qapi.py b/scripts/qapi.py
      |index e6d014b..b862ec9 100644
      |--- a/scripts/qapi.py
      |+++ b/scripts/qapi.py
      |@@ -1570,6 +1570,7 @@ const char *const %(c_name)s_lookup[] = {
      |     max_index = c_enum_const(name, 'MAX', prefix)
      |     ret += mcgen('''
      |     [%(max_index)s] = NULL,
      |+// %(max_index)s
      | };
      | ''',
      |                max_index=max_index)
      
      then running:
      
      $ cat qapi-{types,event}.c tests/test-qapi-types.c |
          sed -n 's,^// \(.*\)MAX,s|\1MAX|\1_MAX|g,p' > list
      $ git grep -l _MAX | xargs sed -i -f list
      
      The only things not generated are the changes in scripts/qapi.py.
      
      Rejecting enum members named 'MAX' is now useless, and will be dropped
      in the next patch.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1447836791-369-23-git-send-email-eblake@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      [Rebased to current master, commit message tweaked]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      7fb1cf16
  16. 03 12月, 2015 1 次提交
  17. 19 11月, 2015 2 次提交
  18. 13 11月, 2015 3 次提交
  19. 10 11月, 2015 6 次提交