1. 27 5月, 2016 24 次提交
  2. 26 5月, 2016 16 次提交
    • A
      vfio: Enable sparse mmap capability · b53b0f69
      Alex Williamson 提交于
      The sparse mmap capability in a vfio region info allows vfio to tell
      us which sub-areas of a region may be mmap'd.  Thus rather than
      assuming a single mmap covers the entire region and later frobbing it
      ourselves for things like the PCI MSI-X vector table, we can read that
      directly from vfio.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
      Tested-by: NGerd Hoffmann <kraxel@redhat.com>
      b53b0f69
    • P
      Merge remote-tracking branch 'remotes/amit-migration/tags/migration-2.7-2' into staging · aef11b8d
      Peter Maydell 提交于
      migration: add TLS support to the migration data channel
      
      This is a big refactoring of the migration backend code - moving away from
      QEMUFile to the new QIOChannel framework introduced here.  This brings a
      good level of abstraction and reduction of many lines of code.
      
      This series also adds the ability for many backends (all except RDMA) to
      use TLS for encrypting the migration data between the endpoints.
      
      # gpg: Signature made Thu 26 May 2016 07:07:08 BST using RSA key ID 657EF670
      # gpg: Good signature from "Amit Shah <amit@amitshah.net>"
      # gpg:                 aka "Amit Shah <amit@kernel.org>"
      # gpg:                 aka "Amit Shah <amitshah@gmx.net>"
      
      * remotes/amit-migration/tags/migration-2.7-2: (28 commits)
        migration: remove qemu_get_fd method from QEMUFile
        migration: remove support for non-iovec based write handlers
        migration: add support for encrypting data with TLS
        migration: define 'tls-creds' and 'tls-hostname' migration parameters
        migration: don't use an array for storing migrate parameters
        migration: move definition of struct QEMUFile back into qemu-file.c
        migration: delete QEMUFile stdio implementation
        migration: delete QEMUFile sockets implementation
        migration: delete QEMUSizedBuffer struct
        migration: delete QEMUFile buffer implementation
        migration: convert savevm to use QIOChannel for writing to files
        migration: convert RDMA to use QIOChannel interface
        migration: convert exec socket protocol to use QIOChannel
        migration: convert fd socket protocol to use QIOChannel
        migration: convert tcp socket protocol to use QIOChannel
        migration: rename unix.c to socket.c
        migration: convert unix socket protocol to use QIOChannel
        migration: convert post-copy to use QIOChannelBuffer
        migration: add reporting of errors for outgoing migration
        migration: add helpers for creating QEMUFile from a QIOChannel
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      aef11b8d
    • P
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · 2c56d06b
      Peter Maydell 提交于
      Block layer patches
      
      # gpg: Signature made Wed 25 May 2016 18:32:40 BST using RSA key ID C88F2FD6
      # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
      
      * remotes/kevin/tags/for-upstream: (31 commits)
        blockjob: Remove BlockJob.bs
        commit: Use BlockBackend for I/O
        backup: Use BlockBackend for I/O
        backup: Remove bs parameter from backup_do_cow()
        backup: Pack Notifier within BackupBlockJob
        backup: Don't leak BackupBlockJob in error path
        mirror: Use BlockBackend for I/O
        mirror: Allow target that already has a BlockBackend
        stream: Use BlockBackend for I/O
        block: Make blk_co_preadv/pwritev() public
        block: Convert block job core to BlockBackend
        block: Default to enabled write cache in blk_new()
        block: Cancel jobs first in bdrv_close_all()
        block: keep a list of block jobs
        block: Rename blk_write_zeroes()
        dma-helpers: change BlockBackend to opaque value in DMAIOFunc
        dma-helpers: change interface to byte-based
        block: Propagate .drained_begin/end callbacks
        block: Fix reconfiguring graph with drained nodes
        block: Make bdrv_drain() use bdrv_drained_begin/end()
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2c56d06b
    • A
      qdev: Start disentangling bus from device · a62c8911
      Andreas Färber 提交于
      Move bus type and related APIs to a separate file bus.c.
      This is a first step in breaking up qdev.c into more manageable chunks.
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      [AF: Rebased onto osdep.h]
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      [PMM: added bus.o to link line for test-qdev-global-props]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      a62c8911
    • S
      cpu-exec: Fix direct jump to TB spanning page · c88c67e5
      Sergey Fedorov 提交于
      It is not safe to make a direct jump to a TB spanning two pages in
      system emulation because the mapping for the second page can get changed
      but we don't take care of direct jumps in this case.
      
      However in user mode emulation, this is not the case because there's
      only static address translation and TBs are always invalidated properly.
      
      Fixes: 5b053a4a ("tcg: Clean up direct block chaining safety checks")
      Reported-by: NMax Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: NSergey Fedorov <serge.fdrv@gmail.com>
      Signed-off-by: NSergey Fedorov <sergey.fedorov@linaro.org>
      Tested-by: NMax Filippov <jcmvbkbc@gmail.com>
      Message-id: 1463404380-29302-1-git-send-email-sergey.fedorov@linaro.org
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      c88c67e5
    • P
      Merge remote-tracking branch 'remotes/afaerber/tags/maintainers-for-peter' into staging · 0533d3de
      Peter Maydell 提交于
      Andreas stepping down from most maintainer positions
      
      # gpg: Signature made Wed 25 May 2016 16:53:45 BST using RSA key ID 3E7E013F
      # gpg: Good signature from "Andreas Färber <afaerber@suse.de>"
      # gpg:                 aka "Andreas Färber <afaerber@suse.com>"
      
      * remotes/afaerber/tags/maintainers-for-peter:
        MAINTAINERS: Drop Andreas as CPU maintainer
        MAINTAINERS: Drop Andreas as 0.15 maintainer
        MAINTAINERS: Drop Andreas as PReP maintainer
        MAINTAINERS: Drop Andreas as Cocoa maintainer
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      0533d3de
    • D
      migration: remove qemu_get_fd method from QEMUFile · 12992c16
      Daniel P. Berrange 提交于
      Now that there is a set_blocking callback in QEMUFileOps,
      and all users needing non-blocking support have been
      converted to QIOChannel, there is no longer any codepath
      requiring the qemu_get_fd() method for QEMUFile. Remove it
      to avoid further code being introduced with an expectation
      of direct file handle access.
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1461751518-12128-29-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      12992c16
    • D
      migration: remove support for non-iovec based write handlers · 11808bb0
      Daniel P. Berrange 提交于
      All the remaining QEMUFile implementations provide an iovec
      based write handler, so the put_buffer callback can be removed
      to simplify the code.
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1461751518-12128-28-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      11808bb0
    • 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: define 'tls-creds' and 'tls-hostname' migration parameters · 69ef1f36
      Daniel P. Berrange 提交于
      Define two new migration parameters to be used with TLS encryption.
      The 'tls-creds' parameter provides the ID of an instance of the
      'tls-creds' object type, or rather a subclass such as 'tls-creds-x509'.
      Providing these credentials will enable use of TLS on the migration
      data stream.
      
      If using x509 certificates, together with a migration URI that does
      not include a hostname, the 'tls-hostname' parameter provides the
      hostname to use when verifying the server's x509 certificate. This
      allows TLS to be used in combination with fd: and exec: protocols
      where a TCP connection is established by a 3rd party outside of
      QEMU.
      
      NB, this requires changing the migrate_set_parameter method in the
      HMP to accept a 's' (string) value instead of 'i' (integer). This
      is backwards compatible, because the parsing of strings allows the
      quotes to be optional, thus any integer is also a valid string.
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1461751518-12128-26-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      69ef1f36
    • 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: move definition of struct QEMUFile back into qemu-file.c · a24939f2
      Daniel P. Berrange 提交于
      Now that the memory buffer based QEMUFile impl is gone, there
      is no need for any backend to be accessing internals of the
      QEMUFile struct, so it can be moved back into qemu-file.c
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1461751518-12128-24-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      a24939f2
    • D
      migration: delete QEMUFile stdio implementation · 7fdc61c7
      Daniel P. Berrange 提交于
      Now that the exec migration backend and savevm have converted
      to use the QIOChannel based QEMUFile, there is no user remaining
      for the stdio based QEMUFile impl and it can be deleted.
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1461751518-12128-23-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      7fdc61c7
    • D
      migration: delete QEMUFile sockets implementation · 40946ae4
      Daniel P. Berrange 提交于
      Now that the tcp, unix and fd migration backends have converted
      to use the QIOChannel based QEMUFile, there is no user remaining
      for the sockets based QEMUFile impl and it can be deleted.
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1461751518-12128-22-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      40946ae4
    • D
      migration: delete QEMUSizedBuffer struct · 2a22b4f3
      Daniel P. Berrange 提交于
      Now that we don't have have a buffer based QemuFile
      implementation, the QEMUSizedBuffer code is also
      unused and can be deleted. A simpler buffer class
      also exists in util/buffer.c which other code can
      used as needed.
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1461751518-12128-21-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      2a22b4f3
    • D
      migration: delete QEMUFile buffer implementation · 8b7c5c0f
      Daniel P. Berrange 提交于
      The qemu_bufopen() method is no longer used, so the memory
      buffer based QEMUFile backend can be deleted entirely.
      Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1461751518-12128-20-git-send-email-berrange@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      8b7c5c0f