Re: [Qemu-block] [PATCH v2 06/21] block: Exclude nested options only for children in append_open_options()

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > Some drivers have nested options (e.g. blkdebug rule arrays), which > don't belong to a child node and shouldn't be removed. Don't remove all > options with "." in their name, but check for the complete prefixes of > actually existing child nodes. > >

Re: [Qemu-block] [PATCH v2 14/21] blockdev: Set 'format' indicates non-empty drive

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > Creating an empty drive while specifying 'format' doesn't make sense. > The specified format driver would simply be ignored. > > Make a set 'format' option an indication that a non-empty drive should > be created. This makes 'format' consistent with

Re: [Qemu-block] [PATCH v2 18/21] blkdebug: Enable reopen

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > Just reopening the children (as block.c does now) is enough. > > Signed-off-by: Kevin Wolf > --- > block/blkdebug.c | 7 +++ > 1 file changed, 7 insertions(+) Reviewed-by: Max Reitz signature.asc Description:

Re: [Qemu-block] [PATCH v2 17/21] block: Move cache options into options QDict

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > This adds the cache mode options to the QDict, so that they can be > specified for child nodes (e.g. backing.cache.direct=off). > > The cache modes are not removed from the flags at this point; instead, > options and flags are kept in sync. If the user

Re: [Qemu-block] [PATCH v2 13/21] block: Introduce bs->explicit_options

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > bs->options doesn't only contain options that the user explicitly > requested, but also option that were derived from flags, the filename or > inherited from the parent node. > > For reopen, it is important to know the difference because reopening the >

Re: [Qemu-block] [PATCH v6 20/21] iotests: add incremental backup failure recovery test

2015-11-27 Thread Kevin Wolf
Am 18.04.2015 um 01:50 hat John Snow geschrieben: > Test the failure case for incremental backups. > > Signed-off-by: John Snow > Reviewed-by: Max Reitz > --- > tests/qemu-iotests/124 | 57 > ++ >

Re: [Qemu-block] [PATCH v2 06/21] block: Exclude nested options only for children in append_open_options()

2015-11-27 Thread Max Reitz
On 27.11.2015 18:58, Max Reitz wrote: > On 23.11.2015 16:59, Kevin Wolf wrote: >> Some drivers have nested options (e.g. blkdebug rule arrays), which >> don't belong to a child node and shouldn't be removed. Don't remove all >> options with "." in their name, but check for the complete prefixes of

Re: [Qemu-block] [PATCH v2 12/21] block: Split out parse_json_protocol()

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > The next patch distinguishes options that were explicitly set and > options that were derived. bdrv_fill_option() added options of both > types: Options given by json: syntax should be counted as explicit, but > the rest is derived. > > In preparation for

Re: [Qemu-block] [PATCH v2 03/21] mirror: Error out when a BDS would get two BBs

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > bdrv_replace_in_backing_chain() asserts that not both old and new > BlockDdriverState have a BlockBackend attached to them because both > would have to end up pointing to the new BDS and we don't support more > than one BB per BDS yet. > > Before we can

Re: [Qemu-block] [PATCH v2 02/21] block: Fix reopen with semantically overlapping options

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > This fixes bdrv_reopen() calls like the following one: > > qemu-io -c 'open -o overlap-check.template=all /tmp/test.qcow2' \ > -c 'reopen -o overlap-check=none' > > The approach taken so far would result in an options QDict that has both >

Re: [Qemu-block] [PATCH v2 04/21] block: Allow references for backing files

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > For bs->file, using references to existing BDSes has been possible for a > while already. This patch enables the same for bs->backing_hd. It's just "backing" now (instead of "backing_hd"). > > Signed-off-by: Kevin Wolf > --- > block.c

Re: [Qemu-block] [PATCH v2 11/21] block: Add infrastructure for option inheritance

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > Options are not actually inherited from the parent node yet, but this > commit lays the grounds for doing so. > > Signed-off-by: Kevin Wolf > --- > block.c | 52 > --- >

Re: [Qemu-block] [Qemu-devel] [PATCH v9] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

2015-11-27 Thread Programmingkid
On Nov 25, 2015, at 11:23 PM, Eric Blake wrote: > On 11/25/2015 09:10 PM, Programmingkid wrote: >> Mac OS X can be picky when it comes to allowing the user >> to use physical devices in QEMU. Most mounted volumes >> appear to be off limits to QEMU. If an issue is detected, >> a message is

[Qemu-block] [PATCH 08/15] nbd: make server compliant with fixed newstyle spec

2015-11-27 Thread Daniel P. Berrange
If the client does not request the fixed new style protocol, then we should only accept NBD_OPT_EXPORT_NAME. All other options are only valid when fixed new style has been activated. The qemu-nbd client doesn't currently request fixed new style protocol, but this change won't break qemu-nbd,

[Qemu-block] [PATCH 10/15] nbd: allow setting of an export name for qemu-nbd server

2015-11-27 Thread Daniel P. Berrange
The qemu-nbd server currently always uses the old style protocol since it never sets any export name. This is a problem because future TLS support will require use of the new style protocol negotiation. This adds a "--exportname NAME" argument to qemu-nbd which allows the user to set an explicit

[Qemu-block] [PATCH 11/15] nbd: pick first exported volume if no export name is requested

2015-11-27 Thread Daniel P. Berrange
The NBD client is currently only capable of using the new style protocol negotiation if an explicit export name is provided. This is a problem, because TLS support will require use of the new style protocol in all cases, and we wish to keep the export name as an optional request for backwards

[Qemu-block] [PATCH 12/15] nbd: implement TLS support in the protocol negotiation

2015-11-27 Thread Daniel P. Berrange
This extends the NBD protocol handling code so that it is capable of negotiating TLS support during the connection setup. This involves requesting the STARTTLS protocol option before any other NBD options. Signed-off-by: Daniel P. Berrange --- block/nbd-client.c | 12 ++-

[Qemu-block] [PATCH 06/15] nbd: convert to using I/O channels for actual socket I/O

2015-11-27 Thread Daniel P. Berrange
Now that all callers are converted to use I/O channels for initial connection setup, it is possible to switch the core NBD protocol handling core over to use QIOChannel APIs for acutal sockets I/O. Signed-off-by: Daniel P. Berrange --- block/nbd-client.c | 19 ++--

[Qemu-block] [PATCH 09/15] nbd: make client request fixed new style if advertized

2015-11-27 Thread Daniel P. Berrange
If the server advertizes support for the fixed new style negotiation, the client should in turn enable new style. This will allow the client to negotiate further NBD options besides the export name. Signed-off-by: Daniel P. Berrange --- nbd.c | 27

[Qemu-block] [PATCH 13/15] nbd: enable use of TLS with NBD block driver

2015-11-27 Thread Daniel P. Berrange
This modifies the NBD driver so that it is possible to request use of TLS. This is done by providing the 'tls-creds' parameter with the ID of a previously created QCryptoTLSCreds object. For example $QEMU -object tls-creds-x509,id=tls0,endpoint=client,\

[Qemu-block] [PATCH 15/15] nbd: enable use of TLS with nbd-server-start command

2015-11-27 Thread Daniel P. Berrange
This modifies the nbd-server-start QMP command so that it is possible to request use of TLS. This is done by adding a new optional parameter "tls-creds" which provides the ID of a previously created QCryptoTLSCreds object instance. TLS is only supported when using an IPv4/IPv6 socket listener.

[Qemu-block] [PATCH 14/15] nbd: enable use of TLS with qemu-nbd server

2015-11-27 Thread Daniel P. Berrange
This modifies the qemu-nbd program so that it is possible to request the use of TLS with the server. It simply adds a new command line option --tls-creds which is used to provide the ID of a QCryptoTLSCreds object previously created via the --object command line option. For example qemu-nbd

[Qemu-block] [PATCH 00/15] Implement TLS support to QEMU NBD server & client

2015-11-27 Thread Daniel P. Berrange
This series of patches implements support for TLS in the QEMU NBD server and client code. It is implementing the NBD_OPT_STARTTLS option that was previously discussed here: https://www.redhat.com/archives/libvir-list/2014-October/msg00506.html And is also described in the NBD spec here:

[Qemu-block] [PATCH 05/15] nbd: convert blockdev NBD server to use I/O channels for connection setup

2015-11-27 Thread Daniel P. Berrange
This converts the blockdev NBD server to use the QIOChannelSocket class for initial listener socket setup and accepting of client connections. Actual I/O is still being performed against the socket file descriptor using the POSIX socket APIs. Signed-off-by: Daniel P. Berrange

[Qemu-block] [PATCH 01/15] qom: add user_creatable_add & user_creatable_del methods

2015-11-27 Thread Daniel P. Berrange
The QMP monitor code has two helper methods object_add and qmp_object_del that are called from several places in the code (QMP, HMP and main emulator startup). We soon need to use this code from qemu-img, qemu-io and qemu-nbd too, but don't want those to depend on the monitor. To avoid this,

[Qemu-block] [PATCH 07/15] nbd: invert client logic for negotiating protocol version

2015-11-27 Thread Daniel P. Berrange
The nbd_receive_negotiate() method takes different code paths based on whether 'name == NULL', and then checks the expected protocol version in each branch. This patch inverts the logic, so that it takes different code paths based on what protocol version it receives and then checks if name is

[Qemu-block] [PATCH 03/15] nbd: convert block client to use I/O channels for connection setup

2015-11-27 Thread Daniel P. Berrange
This converts the NBD block driver client to use the QIOChannelSocket class for initial connection setup. The NbdClientSession struct has two pointers, one to the master QIOChannelSocket providing the raw data channel, and one to a QIOChannel which is the current channel used for I/O. Initially

[Qemu-block] [PATCH 04/15] nbd: convert qemu-nbd server to use I/O channels for connection setup

2015-11-27 Thread Daniel P. Berrange
This converts the qemu-nbd server to use the QIOChannelSocket class for initial listener socket setup and accepting of client connections. Actual I/O is still being performed against the socket file descriptor using the POSIX socket APIs. In this initial conversion though, all I/O is still

Re: [Qemu-block] [PATCH 00/15] Implement TLS support to QEMU NBD server & client

2015-11-27 Thread Wouter Verhelst
[nbd-general added to Cc] Hi Daniel, On Fri, Nov 27, 2015 at 12:20:38PM +, Daniel P. Berrange wrote: > This series of patches implements support for TLS in the QEMU NBD > server and client code. > > It is implementing the NBD_OPT_STARTTLS option that was previously > discussed here: > >

Re: [Qemu-block] [Qemu-devel] [PATCH v9] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

2015-11-27 Thread Programmingkid
On Nov 25, 2015, at 11:29 PM, Eric Blake wrote: > On 11/25/2015 09:23 PM, Eric Blake wrote: > >>> +static kern_return_t FindEjectableOpticalMedia(io_iterator_t >>> *mediaIterator, >>> +char >>> *mediaType) >> >> Unusual

Re: [Qemu-block] [PATCH v2 20/21] qemu-iotests: Test cache mode option inheritance

2015-11-27 Thread Max Reitz
On 23.11.2015 16:59, Kevin Wolf wrote: > This is doing a more complete test on setting cache modes both while > opening an image (i.e. in a -drive command line) and in reopen > situations. It checks that reopen can specify options for child nodes > and that cache modes are correctly inherited from