1. 14 2月, 2017 1 次提交
  2. 06 2月, 2017 1 次提交
  3. 25 1月, 2017 4 次提交
  4. 30 10月, 2016 2 次提交
  5. 13 10月, 2016 1 次提交
  6. 15 9月, 2016 1 次提交
  7. 16 6月, 2016 2 次提交
  8. 26 5月, 2016 4 次提交
    • D
      migration: add support for encrypting data with TLS · e1226365
      Daniel P. Berrange 提交于
      This extends the migration_set_incoming_channel and
      migration_set_outgoing_channel methods so that they
      will automatically wrap the QIOChannel in a
      QIOChannelTLS instance if TLS credentials are configured
      in the migration parameters.
      
      This allows TLS to work for tcp, unix, fd and exec
      migration protocols. It does not (currently) work for
      RDMA since it does not use these APIs, but it is
      unlikely that TLS would be desired with RDMA anyway
      since it would degrade the performance to that seen
      with TCP defeating the purpose of using RDMA.
      
      On the target host, QEMU would be launched with a set
      of TLS credentials for a server endpoint
      
       $ qemu-system-x86_64 -monitor stdio -incoming defer \
          -object tls-creds-x509,dir=/home/berrange/security/qemutls,endpoint=server,id=tls0 \
          ...other args...
      
      To enable incoming TLS migration 2 monitor commands are
      then used
      
        (qemu) migrate_set_str_parameter tls-creds tls0
        (qemu) migrate_incoming tcp:myhostname:9000
      
      On the source host, QEMU is launched in a similar
      manner but using client endpoint credentials
      
       $ qemu-system-x86_64 -monitor stdio \
          -object tls-creds-x509,dir=/home/berrange/security/qemutls,endpoint=client,id=tls0 \
          ...other args...
      
      To enable outgoing TLS migration 2 monitor commands are
      then used
      
        (qemu) migrate_set_str_parameter tls-creds tls0
        (qemu) migrate tcp:otherhostname:9000
      
      Thanks to earlier improvements to error reporting,
      TLS errors can be seen 'info migrate' when doing a
      detached migration. For example:
      
        (qemu) info migrate
        capabilities: xbzrle: off rdma-pin-all: off auto-converge: off zero-blocks: off compress: off events: off x-postcopy-ram: off
        Migration status: failed
        total time: 0 milliseconds
        error description: TLS handshake failed: The TLS connection was non-properly terminated.
      
      Or
      
        (qemu) info migrate
        capabilities: xbzrle: off rdma-pin-all: off auto-converge: off zero-blocks: off compress: off events: off x-postcopy-ram: off
        Migration status: failed
        total time: 0 milliseconds
        error description: Certificate does not match the hostname localhost
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1461751518-12128-27-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      e1226365
    • D
      migration: don't use an array for storing migrate parameters · 2594f56d
      Daniel P. Berrange 提交于
      The MigrateState struct uses an array for storing migration
      parameters. This presumes that all future parameters will
      be integers too, which is not going to be the case. There
      is no functional reason why an array is used, if anything
      it makes the code less clear. The QAPI schema already
      defines a struct - MigrationParameters - capable of storing
      all the individual parameters, so just use that instead of
      an array.
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1461751518-12128-25-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      2594f56d
    • D
      migration: add reporting of errors for outgoing migration · d59ce6f3
      Daniel P. Berrange 提交于
      Currently if an application initiates an outgoing migration,
      it may or may not, get an error reported back on failure. If
      the error occurs synchronously to the 'migrate' command
      execution, the client app will see the error message. This
      is the case for DNS lookup failures. If the error occurs
      asynchronously to the monitor command though, the error
      will be thrown away and the client left guessing about
      what went wrong. This is the case for failure to connect
      to the TCP server (eg due to wrong port, or firewall
      rules, or other similar errors).
      
      In the future we'll be adding more scope for errors to
      happen asynchronously with the TLS protocol handshake.
      TLS errors are hard to diagnose even when they are well
      reported, so discarding errors entirely will make it
      impossible to debug TLS connection problems.
      
      Management apps which do migration are already using
      'query-migrate' / 'info migrate' to check up on progress
      of background migration operations and to see their end
      status. This is a fine place to also include the error
      message when things go wrong.
      
      This patch thus adds an 'error-desc' field to the
      MigrationInfo struct, which will be populated when
      the 'status' is set to 'failed':
      
      (qemu) migrate -d tcp:localhost:9001
      (qemu) info migrate
      capabilities: xbzrle: off rdma-pin-all: off auto-converge: off zero-blocks: off compress: off events: off x-postcopy-ram: off
      Migration status: failed (Error connecting to socket: Connection refused)
      total time: 0 milliseconds
      
      In the HMP, when doing non-detached migration, it is
      also possible to display this error message directly
      to the app.
      
      (qemu) migrate tcp:localhost:9001
      Error connecting to socket: Connection refused
      
      Or with QMP
      
        {
          "execute": "query-migrate",
          "arguments": {}
        }
        {
          "return": {
            "status": "failed",
            "error-desc": "address resolution failed for myhost:9000: No address associated with hostname"
          }
        }
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      Message-Id: <1461751518-12128-11-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      d59ce6f3
    • D
      migration: add helpers for creating QEMUFile from a QIOChannel · 48f07489
      Daniel P. Berrange 提交于
      Currently creating a QEMUFile instance from a QIOChannel is
      quite simple only requiring a single call to
      qemu_fopen_channel_input or  qemu_fopen_channel_output
      depending on the end of migration connection.
      
      When QEMU gains TLS support, however, there will need to be
      a TLS negotiation done inbetween creation of the QIOChannel
      and creation of the final QEMUFile. Introduce some helper
      methods that will encapsulate this logic, isolating the
      migration protocol drivers from knowledge about TLS.
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Acked-by: NJuan Quintela <quintela@redhat.com>
      Message-Id: <1461751518-12128-10-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      48f07489
  9. 24 5月, 2016 1 次提交
    • 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
  10. 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
  11. 23 2月, 2016 2 次提交
    • P
      include: Clean up includes · 90ce6e26
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      
      NB: If this commit breaks compilation for your out-of-tree
      patchseries or fork, then you need to make sure you add
      #include "qemu/osdep.h" to any new .c files that you have.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      90ce6e26
    • 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
  12. 05 2月, 2016 1 次提交
  13. 13 1月, 2016 2 次提交
  14. 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
  15. 10 11月, 2015 16 次提交