qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 1fd791: s390: use FILE instead of QEMUFile fo


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 1fd791: s390: use FILE instead of QEMUFile for creating te...
Date: Thu, 26 May 2016 09:30:06 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 1fd791f007821e2510899e60be0ddad3077120e3
      
https://github.com/qemu/qemu/commit/1fd791f007821e2510899e60be0ddad3077120e3
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M hw/s390x/s390-skeys.c

  Log Message:
  -----------
  s390: use FILE instead of QEMUFile for creating text file

The s390 skeys monitor command needs to write out a plain text
file. Currently it is using the QEMUFile class for this, but
work is ongoing to refactor QEMUFile and eliminate much code
related to it. The only feature qemu_fopen() gives over fopen()
is support for QEMU FD passing, but this can be achieved with
qemu_open() + fdopen() too. Switching to regular stdio FILE
APIs avoids the need to sprintf via an intermedia buffer which
slightly simplifies the code.

Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: d656ec5ea823bcdb59b6512cb73b3f2f97a8308f
      
https://github.com/qemu/qemu/commit/d656ec5ea823bcdb59b6512cb73b3f2f97a8308f
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M io/channel-buffer.c

  Log Message:
  -----------
  io: avoid double-free when closing QIOChannelBuffer

The QIOChannelBuffer's close implementation will free
the internal data buffer. It failed to reset the pointer
to NULL though, so when the object is later finalized
it will free it a second time with predictable crash.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: a8ec4437cd52b2258c77d6b4195c927139c4ced5
      
https://github.com/qemu/qemu/commit/a8ec4437cd52b2258c77d6b4195c927139c4ced5
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M tests/Makefile
    M tests/test-vmstate.c

  Log Message:
  -----------
  migration: remove use of qemu_bufopen from vmstate tests

Some of the test-vmstate.c test cases use a temporary file
while others use a memory buffer. To facilitate the future
removal of the qemu_bufopen() function, convert all the tests
to use a temporary file.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: baf51e7739a4d176284d2e38e1755afeafcd2ee0
      
https://github.com/qemu/qemu/commit/baf51e7739a4d176284d2e38e1755afeafcd2ee0
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/qemu-file.h
    M migration/qemu-file.c

  Log Message:
  -----------
  migration: ensure qemu_fflush() always writes full data amount

The QEMUFile writev_buffer / put_buffer functions are expected
to write out the full set of requested data, blocking until
complete. The qemu_fflush() caller does not expect to deal with
partial writes. Clarify the function comments and add a sanity
check to the code to catch mistaken implementations.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 0436e09f9654dfa6f7439531bf443b1f78870ed6
      
https://github.com/qemu/qemu/commit/0436e09f9654dfa6f7439531bf443b1f78870ed6
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/qemu-file.h
    M migration/qemu-file-internal.h
    M migration/qemu-file.c
    M migration/rdma.c

  Log Message:
  -----------
  migration: split migration hooks out of QEMUFileOps

The QEMUFileOps struct contains the I/O subsystem callbacks
and the migration stage hooks. Split the hooks out into a
separate QEMUFileHooks struct to make it easier to refactor
the I/O side of QEMUFile without affecting the hooks.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 06ad513532b1a6085abf4a5dab15d1a4719f715c
      
https://github.com/qemu/qemu/commit/06ad513532b1a6085abf4a5dab15d1a4719f715c
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/qemu-file.h
    M migration/migration.c
    M migration/qemu-file.c

  Log Message:
  -----------
  migration: introduce set_blocking function in QEMUFileOps

Remove the assumption that every QEMUFile implementation has
a file descriptor available by introducing a new function
in QEMUFileOps to change the blocking state of a QEMUFile.

If not set, it will fallback to the original code using
the get_fd method.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 9e4d2b98ee98f4cee50d671e500eceeefa751ee0
      
https://github.com/qemu/qemu/commit/9e4d2b98ee98f4cee50d671e500eceeefa751ee0
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M migration/migration.c

  Log Message:
  -----------
  migration: force QEMUFile to blocking mode for outgoing migration

Instead of relying on the default QEMUFile I/O blocking flag
state, explicitly turn on blocking I/O for outgoing migration
since it takes place in a background thread.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: a9cfeb33bb23a8104eeeac5769165476cbf13fe3
      
https://github.com/qemu/qemu/commit/a9cfeb33bb23a8104eeeac5769165476cbf13fe3
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/qemu-file.h
    M migration/Makefile.objs
    A migration/qemu-file-channel.c

  Log Message:
  -----------
  migration: introduce a new QEMUFile impl based on QIOChannel

Introduce a new QEMUFile implementation that is based on
the QIOChannel objects. This impl is different from existing
impls in that there is no file descriptor that can be made
available, as some channels may be based on higher level
protocols such as TLS.

Although the QIOChannel based implementation can trivially
provide a bi-directional stream, initially we have separate
functions for opening input & output directions to fit with
the expectation of the current QEMUFile interface.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 48f07489edc1c9b10f21781c850e99e0cde97545
      
https://github.com/qemu/qemu/commit/48f07489edc1c9b10f21781c850e99e0cde97545
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/migration.h
    M migration/migration.c

  Log Message:
  -----------
  migration: add helpers for creating QEMUFile from a QIOChannel

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: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Acked-by: Juan Quintela <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: d59ce6f34434bf47a9b26138c908650bf9a24be1
      
https://github.com/qemu/qemu/commit/d59ce6f34434bf47a9b26138c908650bf9a24be1
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M hmp.c
    M include/migration/migration.h
    M include/qapi/error.h
    M migration/migration.c
    M migration/rdma.c
    M migration/tcp.c
    M migration/unix.c
    M qapi-schema.json
    M trace-events
    M util/error.c

  Log Message:
  -----------
  migration: add reporting of errors for outgoing migration

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: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 61b67d473d2471d5b470cd4653947ddaaa2c1c44
      
https://github.com/qemu/qemu/commit/61b67d473d2471d5b470cd4653947ddaaa2c1c44
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M docs/migration.txt
    M include/sysemu/sysemu.h
    M migration/migration.c
    M migration/savevm.c

  Log Message:
  -----------
  migration: convert post-copy to use QIOChannelBuffer

The post-copy code does some I/O to/from an intermediate
in-memory buffer rather than direct to the underlying
I/O channel. Switch this code to use QIOChannelBuffer
instead of QEMUSizedBuffer.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: d984464eb9e7ebc10e65469b0b7158556489ac96
      
https://github.com/qemu/qemu/commit/d984464eb9e7ebc10e65469b0b7158556489ac96
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M migration/Makefile.objs
    M migration/migration.c
    M migration/unix.c
    M trace-events

  Log Message:
  -----------
  migration: convert unix socket protocol to use QIOChannel

Convert the unix socket migration protocol driver to use
QIOChannel and QEMUFileChannel, instead of plain sockets
APIs. It can be unconditionally built, since the socket
impl of QIOChannel will report a suitable error on platforms
where UNIX sockets are unavailable.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 6f860ae75566e858593d2c067909a6d1e9feccbf
      
https://github.com/qemu/qemu/commit/6f860ae75566e858593d2c067909a6d1e9feccbf
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M migration/Makefile.objs
    A migration/socket.c
    R migration/unix.c
    M trace-events

  Log Message:
  -----------
  migration: rename unix.c to socket.c

The unix.c file will be nearly the same as the tcp.c file,
only differing in the initial SocketAddress creation code.
Rename unix.c to socket.c and refactor it a little to
prepare for merging the TCP code.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: e65c67e4dad18a1f04be426f23cc4d64a32c7548
      
https://github.com/qemu/qemu/commit/e65c67e4dad18a1f04be426f23cc4d64a32c7548
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M migration/Makefile.objs
    M migration/socket.c
    R migration/tcp.c

  Log Message:
  -----------
  migration: convert tcp socket protocol to use QIOChannel

Drop the current TCP socket migration driver and extend
the new generic socket driver to cope with the TCP address
format

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 64802ee57f68a2aedcdf06b8d4a65daa6d894e3a
      
https://github.com/qemu/qemu/commit/64802ee57f68a2aedcdf06b8d4a65daa6d894e3a
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M migration/Makefile.objs
    M migration/fd.c
    M migration/migration.c
    M trace-events

  Log Message:
  -----------
  migration: convert fd socket protocol to use QIOChannel

Convert the fd socket migration protocol driver to use
QIOChannel and QEMUFileChannel, instead of plain sockets
APIs. It can be unconditionally built because the
QIOChannel APIs it uses will take care to report suitable
error messages if needed.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 527792fae60486c912146a14f601b830d160fe36
      
https://github.com/qemu/qemu/commit/527792fae60486c912146a14f601b830d160fe36
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M migration/Makefile.objs
    M migration/exec.c
    M migration/migration.c
    M trace-events

  Log Message:
  -----------
  migration: convert exec socket protocol to use QIOChannel

Convert the exec socket migration protocol driver to use
QIOChannel and QEMUFileChannel, instead of the stdio
popen APIs. It can be unconditionally built because the
QIOChannelCommand class can report suitable error messages
on platforms which can't fork processes.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 6ddd2d76ca6f86f7a6c29291ec3bca32d15bab24
      
https://github.com/qemu/qemu/commit/6ddd2d76ca6f86f7a6c29291ec3bca32d15bab24
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M migration/rdma.c

  Log Message:
  -----------
  migration: convert RDMA to use QIOChannel interface

This converts the RDMA code to provide a subclass of QIOChannel
that uses RDMA for the data transport.

This implementation of RDMA does not correctly handle non-blocking
mode. Reads might block if there was not already some pending data
and writes will block until all data is sent. This flawed behaviour
was already present in the existing impl, so appears to not be a
critical problem at this time. It should be on the list of things
to fix in the future though.

The RDMA code would be much better off it it could be split up in
a generic RDMA layer, a QIOChannel impl based on RMDA, and then
the RMDA migration glue. This is left as a future exercise for
the brave.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 8925839f00cd2d9fd96066154098db476140b715
      
https://github.com/qemu/qemu/commit/8925839f00cd2d9fd96066154098db476140b715
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M migration/savevm.c
    M tests/Makefile
    M tests/test-vmstate.c

  Log Message:
  -----------
  migration: convert savevm to use QIOChannel for writing to files

Convert the exec savevm code to use QIOChannel and QEMUFileChannel,
instead of the stdio APIs.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 8b7c5c0f525561ac081d49363863799f11eb3113
      
https://github.com/qemu/qemu/commit/8b7c5c0f525561ac081d49363863799f11eb3113
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/qemu-file.h
    M migration/qemu-file-buf.c

  Log Message:
  -----------
  migration: delete QEMUFile buffer implementation

The qemu_bufopen() method is no longer used, so the memory
buffer based QEMUFile backend can be deleted entirely.

Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 2a22b4f3703e1e3daf448841966a01a9d1a3f4ae
      
https://github.com/qemu/qemu/commit/2a22b4f3703e1e3daf448841966a01a9d1a3f4ae
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/qemu-file.h
    M include/qemu/typedefs.h
    M migration/Makefile.objs
    R migration/qemu-file-buf.c

  Log Message:
  -----------
  migration: delete QEMUSizedBuffer struct

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: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 40946ae40b33b8aa03fa9b56a374f5d4b5f7aab7
      
https://github.com/qemu/qemu/commit/40946ae40b33b8aa03fa9b56a374f5d4b5f7aab7
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/qemu-file.h
    M migration/Makefile.objs
    R migration/qemu-file-unix.c

  Log Message:
  -----------
  migration: delete QEMUFile sockets implementation

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: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 7fdc61c75d4064d2e48777172bbe8e0e970de7d9
      
https://github.com/qemu/qemu/commit/7fdc61c75d4064d2e48777172bbe8e0e970de7d9
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/qemu-file.h
    M migration/Makefile.objs
    R migration/qemu-file-stdio.c

  Log Message:
  -----------
  migration: delete QEMUFile stdio implementation

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: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: a24939f2791d930f109ddb2658147aa4eae40361
      
https://github.com/qemu/qemu/commit/a24939f2791d930f109ddb2658147aa4eae40361
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    R migration/qemu-file-internal.h
    M migration/qemu-file.c

  Log Message:
  -----------
  migration: move definition of struct QEMUFile back into qemu-file.c

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: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 2594f56d4c7ef621da5d0c21921f8fda32025623
      
https://github.com/qemu/qemu/commit/2594f56d4c7ef621da5d0c21921f8fda32025623
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/migration.h
    M migration/migration.c
    M migration/ram.c

  Log Message:
  -----------
  migration: don't use an array for storing migrate parameters

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: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 69ef1f36b0f882fc5ba9491fb272fa5f83ac1d3d
      
https://github.com/qemu/qemu/commit/69ef1f36b0f882fc5ba9491fb272fa5f83ac1d3d
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M hmp-commands.hx
    M hmp.c
    M migration/migration.c
    M qapi-schema.json

  Log Message:
  -----------
  migration: define 'tls-creds' and 'tls-hostname' migration parameters

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: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: e122636562218b3d442cd2cd18fbc188dd9ce709
      
https://github.com/qemu/qemu/commit/e122636562218b3d442cd2cd18fbc188dd9ce709
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/migration.h
    M migration/Makefile.objs
    M migration/exec.c
    M migration/fd.c
    M migration/migration.c
    M migration/socket.c
    A migration/tls.c
    M trace-events

  Log Message:
  -----------
  migration: add support for encrypting data with TLS

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: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 11808bb0c422134bf09119f4aa22c59b0ce84bf3
      
https://github.com/qemu/qemu/commit/11808bb0c422134bf09119f4aa22c59b0ce84bf3
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/qemu-file.h
    M migration/qemu-file.c
    M migration/savevm.c

  Log Message:
  -----------
  migration: remove support for non-iovec based write handlers

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: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: 12992c16d9afd8a23a94a84ad532a1adedf9e511
      
https://github.com/qemu/qemu/commit/12992c16d9afd8a23a94a84ad532a1adedf9e511
  Author: Daniel P. Berrange <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M include/migration/qemu-file.h
    M migration/qemu-file.c

  Log Message:
  -----------
  migration: remove qemu_get_fd method from QEMUFile

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: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Amit Shah <address@hidden>


  Commit: aef11b8d33ff9018b20ae29d87b1d674ed23dab9
      
https://github.com/qemu/qemu/commit/aef11b8d33ff9018b20ae29d87b1d674ed23dab9
  Author: Peter Maydell <address@hidden>
  Date:   2016-05-26 (Thu, 26 May 2016)

  Changed paths:
    M docs/migration.txt
    M hmp-commands.hx
    M hmp.c
    M hw/s390x/s390-skeys.c
    M include/migration/migration.h
    M include/migration/qemu-file.h
    M include/qapi/error.h
    M include/qemu/typedefs.h
    M include/sysemu/sysemu.h
    M io/channel-buffer.c
    M migration/Makefile.objs
    M migration/exec.c
    M migration/fd.c
    M migration/migration.c
    R migration/qemu-file-buf.c
    A migration/qemu-file-channel.c
    R migration/qemu-file-internal.h
    R migration/qemu-file-stdio.c
    R migration/qemu-file-unix.c
    M migration/qemu-file.c
    M migration/ram.c
    M migration/rdma.c
    M migration/savevm.c
    A migration/socket.c
    R migration/tcp.c
    A migration/tls.c
    R migration/unix.c
    M qapi-schema.json
    M tests/Makefile
    M tests/test-vmstate.c
    M trace-events
    M util/error.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/amit-migration/tags/migration-2.7-2' 
into staging

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 <address@hidden>"
# gpg:                 aka "Amit Shah <address@hidden>"
# gpg:                 aka "Amit Shah <address@hidden>"

* 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: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/2c56d06bafd8...aef11b8d33ff

reply via email to

[Prev in Thread] Current Thread [Next in Thread]