[Qemu-block] [PATCH v1 1/2] crypto: use glib as fallback for hash algorithm

2016-07-05 Thread Daniel P. Berrange
be disabled at runtime, so a check for qcrypto_hash_supports() is still best practice to report good error messages. Signed-off-by: Daniel P. Berrange --- crypto/Makefile.objs | 2 +- crypto/hash-glib.c | 94 crypto/hash-stub.c |

[Qemu-block] [PATCH v1 0/2] Use GChecksum as fallback hash impl

2016-07-05 Thread Daniel P. Berrange
This uses the GChecksum APIs as final hash impl, instead of a no-op stub. This lets us remove conditional registration of the quorum driver. Daniel P. Berrange (2): crypto: use glib as fallback for hash algorithm Revert "block: don't register quorum driver if SHA256 support is u

[Qemu-block] [PATCH v1 2/2] Revert "block: don't register quorum driver if SHA256 support is unavailable"

2016-07-05 Thread Daniel P. Berrange
The qcrypto hash APIs now guarantee that sha256 is available at compile time, so skipping registration is rarely needed. A check at time of open is kept to ensure good error reporting in the (unlikely) case sha256 is runtime disabled. This reverts commit e94867ed5f241008d0f53142b2704a075f9ed505. -

Re: [Qemu-block] [Qemu-devel] [PATCH] quorum: Only compile when supported

2016-07-05 Thread Daniel P. Berrange
On Tue, Jul 05, 2016 at 10:26:56AM +0100, Daniel P. Berrange wrote: > On Tue, Jul 05, 2016 at 11:18:29AM +0200, Alberto Garcia wrote: > > On Tue 05 Jul 2016 10:45:21 AM CEST, Daniel P. Berrange wrote: > > > > > The point of using qcrypto_hash_supports() is that it isola

Re: [Qemu-block] [Qemu-devel] [PATCH] quorum: Only compile when supported

2016-07-05 Thread Daniel P. Berrange
On Tue, Jul 05, 2016 at 04:57:58PM +0800, Fam Zheng wrote: > On Tue, 07/05 09:45, Daniel P. Berrange wrote: > > On Tue, Jun 28, 2016 at 09:47:47AM +0800, Fam Zheng wrote: > > > This was the only exceptional module init function that does something > > > else than a s

Re: [Qemu-block] [Qemu-devel] [PATCH] quorum: Only compile when supported

2016-07-05 Thread Daniel P. Berrange
On Tue, Jul 05, 2016 at 11:18:29AM +0200, Alberto Garcia wrote: > On Tue 05 Jul 2016 10:45:21 AM CEST, Daniel P. Berrange wrote: > > > The point of using qcrypto_hash_supports() is that it isolates the > > block code Makefile rules from the details of the current specific &g

Re: [Qemu-block] [Qemu-devel] [PATCH] quorum: Only compile when supported

2016-07-05 Thread Daniel P. Berrange
On Tue, Jun 28, 2016 at 09:47:47AM +0800, Fam Zheng wrote: > This was the only exceptional module init function that does something > else than a simple list of bdrv_register() calls, in all the block > drivers. > > The qcrypto_hash_supports is actually a static check, determined at > compile time

Re: [Qemu-block] [Qemu-devel] [PATCH v3 04/11] block: Use block_job_get() in find_block_job()

2016-07-04 Thread Daniel P. Berrange
On Mon, Jul 04, 2016 at 03:23:14PM +0200, Kevin Wolf wrote: > Am 02.07.2016 um 16:02 hat Max Reitz geschrieben: > > On 01.07.2016 17:52, Alberto Garcia wrote: > > > find_block_job() looks for a block backend with a specified name, > > > checks whether it has a block job and acquires its AioContext.

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] blockdev: Add dynamic module loading for block drivers

2016-06-24 Thread Daniel P. Berrange
On Fri, Jun 24, 2016 at 11:04:43AM +0100, Stefan Hajnoczi wrote: > On Wed, Jun 22, 2016 at 05:35:54PM -0400, Colin Lord wrote: > > > > > @@ -447,8 +466,15 @@ int get_tmp_filename(char *filename, int size) > > static BlockDriver *find_hdev_driver(const char *filename) > > { > > int score_m

[Qemu-block] [PATCH v3 2/2] block: export LUKS specific data to qemu-img info

2016-06-14 Thread Daniel P. Berrange
later by changing the way the block layer pretty-prints the image specific data. Signed-off-by: Daniel P. Berrange --- block/crypto.c | 49 + qapi/block-core.json | 6 +- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a

[Qemu-block] [PATCH v3 0/2] Report format specific info for LUKS block driver

2016-06-14 Thread Daniel P. Berrange
ters if keyslot is inactive - Add missing QAPI schema docs Daniel P. Berrange (2): crypto: add support for querying parameters for block encryption block: export LUKS specific data to qemu-img info block/crypto.c | 49 crypto/block

[Qemu-block] [PATCH v3 1/2] crypto: add support for querying parameters for block encryption

2016-06-14 Thread Daniel P. Berrange
. Signed-off-by: Daniel P. Berrange --- crypto/block-luks.c| 67 crypto/block.c | 17 +++ crypto/blockpriv.h | 4 +++ include/crypto/block.h | 16 +++ qapi/crypto.json | 76

Re: [Qemu-block] [PATCH v2 2/2] block: export LUKS specific data to qemu-img info

2016-06-14 Thread Daniel P. Berrange
On Tue, Jun 14, 2016 at 05:49:24PM +0200, Max Reitz wrote: > On 14.06.2016 17:47, Daniel P. Berrange wrote: > > On Tue, Jun 14, 2016 at 05:38:36PM +0200, Max Reitz wrote: > >> On 14.06.2016 12:56, Daniel P. Berrange wrote: > >>> The qemu-img info command ha

Re: [Qemu-block] [PATCH v2 2/2] block: export LUKS specific data to qemu-img info

2016-06-14 Thread Daniel P. Berrange
On Tue, Jun 14, 2016 at 05:38:36PM +0200, Max Reitz wrote: > On 14.06.2016 12:56, Daniel P. Berrange wrote: > > The qemu-img info command has the ability to expose format > > specific metadata about volumes. Wire up this facility for > > the LUKS driver to report on cipher

Re: [Qemu-block] [Qemu-devel] [PATCH v5 03/11] qom: support arbitrary non-scalar properties with -object

2016-06-14 Thread Daniel P. Berrange
On Thu, Jun 09, 2016 at 04:43:35PM +0200, Markus Armbruster wrote: > "Daniel P. Berrange" writes: > > > The current -object command line syntax only allows for > > creation of objects with scalar properties, or a list > > with a fixed scalar element type. Obje

Re: [Qemu-block] [PATCH v5 02/11] qapi: allow QmpInputVisitor to auto-cast types

2016-06-14 Thread Daniel P. Berrange
On Wed, Jun 08, 2016 at 02:01:23PM +0200, Paolo Bonzini wrote: > > > On 02/06/2016 18:46, Daniel P. Berrange wrote: > > Currently the QmpInputVisitor assumes that all scalar > > values are directly represented as their final types. > > ie it assumes an 'int

Re: [Qemu-block] [PATCH v1 0/6] Report format specific info for LUKS block driver

2016-06-14 Thread Daniel P. Berrange
On Tue, Jun 14, 2016 at 03:56:30PM +0200, Max Reitz wrote: > On 07.06.2016 12:11, Daniel P. Berrange wrote: > > The 'qemu-img info' tool has ability to print format specific > > information, eg with qcow2 it reports two extra items: > > > > $ qemu-

Re: [Qemu-block] [Qemu-devel] [PATCH v5 02/11] qapi: allow QmpInputVisitor to auto-cast types

2016-06-14 Thread Daniel P. Berrange
On Thu, Jun 09, 2016 at 04:03:50PM +0200, Markus Armbruster wrote: > "Daniel P. Berrange" writes: > > > Currently the QmpInputVisitor assumes that all scalar > > values are directly represented as their final types. > > ie it assumes an 'int' is

Re: [Qemu-block] [Qemu-devel] [PATCH v5 01/11] qdict: implement a qdict_crumple method for un-flattening a dict

2016-06-14 Thread Daniel P. Berrange
On Thu, Jun 09, 2016 at 03:20:47PM +0200, Markus Armbruster wrote: > I apologize for the lateness of this review. > > "Daniel P. Berrange" writes: > > > The qdict_flatten() method will take a dict whose elements are > > further nested dicts/lists and flat

[Qemu-block] [PATCH v2 2/2] block: export LUKS specific data to qemu-img info

2016-06-14 Thread Daniel P. Berrange
later by changing the way the block layer pretty-prints the image specific data. Signed-off-by: Daniel P. Berrange --- block/crypto.c | 59 qapi/block-core.json | 7 ++- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a

[Qemu-block] [PATCH v2 1/2] crypto: add support for querying parameters for block encryption

2016-06-14 Thread Daniel P. Berrange
. Signed-off-by: Daniel P. Berrange --- crypto/block-luks.c| 70 ++ crypto/block.c | 17 +++ crypto/blockpriv.h | 4 +++ include/crypto/block.h | 16 +++ qapi/crypto.json | 76

[Qemu-block] [PATCH v2 0/2] Report format specific info for LUKS block driver

2016-06-14 Thread Daniel P. Berrange
porting stripes/iters if keyslot is inactive - Add missing QAPI schema docs Daniel P. Berrange (2): crypto: add support for querying parameters for block encryption block: export LUKS specific data to qemu-img info block/crypto.c | 59 +++ cryp

[Qemu-block] [PATCH v2] block: drop support for using qcow[2] encryption with system emulators

2016-06-13 Thread Daniel P. Berrange
The code still exists today, but by a (happy?) accident we entirely broke the ability to use qcow[2] encryption in the system emulators in the 2.4.0 release due to commit 8336aafae1451d54c81dd2b187b45f7c45d2428e Author: Daniel P. Berrange Date: Tue May 12 17:09:18 2015 +0100 qcow2

[Qemu-block] [PATCH] block: drop support for using qcow[2] encryption with system emulators

2016-06-10 Thread Daniel P. Berrange
The code still exists today, but by a (happy?) accident we entirely broke the ability to use qcow[2] encryption in the system emulators in the 2.4.0 release due to commit 8336aafae1451d54c81dd2b187b45f7c45d2428e Author: Daniel P. Berrange Date: Tue May 12 17:09:18 2015 +0100 qcow2

Re: [Qemu-block] [Qemu-devel] [PATCH v5 01/11] qdict: implement a qdict_crumple method for un-flattening a dict

2016-06-09 Thread Daniel P. Berrange
On Thu, Jun 09, 2016 at 03:20:47PM +0200, Markus Armbruster wrote: > I apologize for the lateness of this review. > > "Daniel P. Berrange" writes: > > > The qdict_flatten() method will take a dict whose elements are > > further nested dicts/lists and flat

Re: [Qemu-block] [PATCH v5 00/11] Provide a QOM-based authorization API

2016-06-08 Thread Daniel P. Berrange
On Thu, Jun 02, 2016 at 05:46:16PM +0100, Daniel P. Berrange wrote: > This is a followup of previously posted work in 2.6 cycle: > > v1: https://lists.gnu.org/archive/html/qemu-devel/2016-02/msg04618.html > v2: https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg01454.html

Re: [Qemu-block] [PATCH v1 4/6] qapi: add a text output visitor for pretty printing types

2016-06-07 Thread Daniel P. Berrange
On Tue, Jun 07, 2016 at 10:40:36AM -0600, Eric Blake wrote: > On 06/07/2016 10:20 AM, Daniel P. Berrange wrote: > > On Tue, Jun 07, 2016 at 10:09:48AM -0600, Eric Blake wrote: > >> On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: > >>> The current approach for pr

Re: [Qemu-block] [PATCH v1 4/6] qapi: add a text output visitor for pretty printing types

2016-06-07 Thread Daniel P. Berrange
On Tue, Jun 07, 2016 at 10:09:48AM -0600, Eric Blake wrote: > On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: > > The current approach for pretty-printing QAPI types is to > > convert them to JSON using the QMP output visitor and then > > pretty-print the JSON document.

Re: [Qemu-block] [PATCH v1 2/6] block: export LUKS specific data to qemu-img info

2016-06-07 Thread Daniel P. Berrange
On Tue, Jun 07, 2016 at 09:36:08AM -0600, Eric Blake wrote: > On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: > > +++ b/qapi/block-core.json > > @@ -74,6 +74,37 @@ > >'extents': ['ImageInfo'] > >} } > > > > + > >

Re: [Qemu-block] [PATCH v1 3/6] qapi: assert that visitor impls have required callbacks

2016-06-07 Thread Daniel P. Berrange
On Tue, Jun 07, 2016 at 09:40:25AM -0600, Eric Blake wrote: > On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: > > Not all visitor implementations supply the full set of > > visitor callback functions. For example, the string > > output visitor does not provide 'start_s

Re: [Qemu-block] [PATCH v1 0/6] Report format specific info for LUKS block driver

2016-06-07 Thread Daniel P. Berrange
On Tue, Jun 07, 2016 at 06:04:36AM -0600, Eric Blake wrote: > On 06/07/2016 04:11 AM, Daniel P. Berrange wrote: > > uuid: 6ddee74b-3a22-408c-8909-6789d4fa2594 > > slots: > > [0]: > > active: true > &

[Qemu-block] [PATCH v1 6/6] block: convert to use qapi_stringify_ImageInfoSpecific

2016-06-07 Thread Daniel P. Berrange
ndom order. Convert this to use the qapi_stringify_ImageInfoSpecific() which uses a visitor to directly pretty-print the objects without the intermediate QObject conversion, and thus will maintain struct field ordering. Signed-off-by: Daniel P. Berrange --- block/qa

[Qemu-block] [PATCH v1 5/6] qapi: generate a qapi_stringify_TYPENAME method for all types

2016-06-07 Thread Daniel P. Berrange
rint out a QAPI object. To address this, add a qapi_stringify_TYPENAME() method for all types which wraps around the TextOutputVisitor to turn objects into pretty strings. Signed-off-by: Daniel P. Berrange --- scripts/qapi-types.py | 45 + 1 file c

[Qemu-block] [PATCH v1 1/6] crypto: add support for querying parameters for block encryption

2016-06-07 Thread Daniel P. Berrange
. Signed-off-by: Daniel P. Berrange --- crypto/block-luks.c| 66 +- crypto/block.c | 17 + crypto/blockpriv.h | 4 +++ include/crypto/block.h | 16 qapi/crypto.json | 65

[Qemu-block] [PATCH v1 4/6] qapi: add a text output visitor for pretty printing types

2016-06-07 Thread Daniel P. Berrange
. To address this, introduce a text output visitor that can directly pretty print a QAPI type into a string. Signed-off-by: Daniel P. Berrange --- include/qapi/text-output-visitor.h | 73 include/qapi/visitor-impl.h| 5 +- include/qapi/visitor.h | 5 +- qapi

[Qemu-block] [PATCH v1 0/6] Report format specific info for LUKS block driver

2016-06-07 Thread Daniel P. Berrange
able to easily dump an QAPI object or any QObject to a humand friendly format for debugging and the less code I need write to add this temporary debug output the better. Daniel P. Berrange (6): crypto: add support for querying parameters for block encryption block: export LUKS specific data t

[Qemu-block] [PATCH v1 3/6] qapi: assert that visitor impls have required callbacks

2016-06-07 Thread Daniel P. Berrange
re dumped) Crashing is fine, because this is a programmer mistake, but we can improve the error message upon crash to make it obvious what failed by adding assert()s: qapi/qapi-visit-core.c:32: visit_start_struct: Assertion `v->start_struct != ((void *)0)' failed. Signed-off-by: Daniel

[Qemu-block] [PATCH v1 2/6] block: export LUKS specific data to qemu-img info

2016-06-07 Thread Daniel P. Berrange
printed out in (apparantly) random order. This will be addressed later by changing the way the block layer pretty-prints the image specific data. Signed-off-by: Daniel P. Berrange --- block/crypto.c | 80 qapi/block-core.json | 34

[Qemu-block] [PATCH v5 11/11] vnc: allow specifying a custom ACL object name

2016-06-02 Thread Daniel P. Berrange
authz-simple,id=saslacl0,policy=deny,\ rules.0.match=f...@redhat.com,rules.0.policy=allow \ rules.0.match=j...@redhat.com,rules.0.policy=allow \ -vnc 0.0.0.0:1,tls-creds=tls0,tls-acl=tlsacl0, sasl,sasl-acl=saslacl0 \ ...oth

[Qemu-block] [PATCH v5 08/11] nbd: allow an ACL to be set with nbd-server-start QMP command

2016-06-02 Thread Daniel P. Berrange
arguments': { 'addr': { 'type': 'inet', 'host': '127.0.0.1', 'port': '9000' }, 'tls-creds': 'tls0', 'tls-acl': 'tlsacl0'

[Qemu-block] [PATCH v5 01/11] qdict: implement a qdict_crumple method for un-flattening a dict

2016-06-02 Thread Daniel P. Berrange
;.', then it must be escaped as '..'. ie a flat dict { 'foo..bar': 'wizz', 'bar.foo..bar': 'eek', 'bar.hello': 'world' } Will end up as { 'foo.bar': 'wizz', 'bar':

[Qemu-block] [PATCH v5 04/11] util: add QAuthZ object as an authorization base class

2016-06-02 Thread Daniel P. Berrange
tion providers. Signed-off-by: Daniel P. Berrange --- MAINTAINERS | 7 + Makefile | 1 + Makefile.objs| 2 ++ Makefile.target | 2 ++ include/qemu/authz.h | 89 util/Makefile.objs | 2 ++ util/aut

[Qemu-block] [PATCH v5 07/11] qemu-nbd: add support for ACLs for TLS clients

2016-06-02 Thread Daniel P. Berrange
s,\ endpoint=server,verify-peer=yes \ -object authz-simple,id=acl0,policy=deny,\ rules.0.match=*CN=fred,rules.0.policy=allow \ -tls-creds tls0 \ -tls-acl acl0 other qemu-nbd args... Signed-off-by

[Qemu-block] [PATCH v5 10/11] chardev: add support for ACLs for TLS clients

2016-06-02 Thread Daniel P. Berrange
e/berrange/qemutls,\ endpoint=server,verify-peer=yes \ -object authz-simple,id=acl0,policy=deny,\ rules.0.match=\*CN=fred,rules.0.policy=allow \ -chardev socket,host=127.0.0.1,port=9000,server,\ tls-creds=tls0,tls-acl=acl0 \ ..

[Qemu-block] [PATCH v5 09/11] migration: add support for a "tls-acl" migration parameter

2016-06-02 Thread Daniel P. Berrange
QOM ID of a QAuthZ subclass instance that provides the access control check. This ACL is checked against the x509 certificate obtained during the TLS handshake. Signed-off-by: Daniel P. Berrange --- hmp.c | 8 migration/migration.c | 7 +++ migration/tls.c |

[Qemu-block] [PATCH v5 06/11] acl: delete existing ACL implementation

2016-06-02 Thread Daniel P. Berrange
uperset of the functionality in qemu_acl, so the latter can now be deleted. The HMP 'acl_*' monitor commands are converted to use the new QAuthZSimple data type instead in order to provide backwards compatibility, but their use is discouraged. Signed-off-by: Daniel P. Ber

[Qemu-block] [PATCH v5 02/11] qapi: allow QmpInputVisitor to auto-cast types

2016-06-02 Thread Daniel P. Berrange
behaviour is turned on by requesting the 'autocast' flag in the constructor. This makes it possible to use QmpInputVisitor with a QDict produced from QemuOpts, where everything is in string format. Signed-off-by: Daniel P. Berrange --- docs/qapi-code-gen.txt | 2 +- in

[Qemu-block] [PATCH v5 03/11] qom: support arbitrary non-scalar properties with -object

2016-06-02 Thread Daniel P. Berrange
HMP monitor with the same syntax. (hmp) object_add demo,id=demo0,\ foo.0.bar=one,foo.0.wizz=1,\ foo.1.bar=two,foo.1.wizz=2 NB indentation should not be used with HMP commands, this is just for convenient formatting in this commit message. Signed-off

[Qemu-block] [PATCH v5 05/11] util: add QAuthZSimple object type for a simple access control list

2016-06-02 Thread Daniel P. Berrange
} Or via the -object command line $QEMU \ -object authz-simple,id=acl0,policy=deny,\ rules.0.match=fred,rules.0.policy=allow,rules.0.format=exact,\ rules.1.match=bob,rules.1.policy=allow,rules.1.format=exact,\ rules.2.match=danb,rules.2.policy=deny,rules

[Qemu-block] [PATCH v5 00/11] Provide a QOM-based authorization API

2016-06-02 Thread Daniel P. Berrange
saner variable names in qdict_crumple (Max) - Added some tests for bad inputs to qdict_crumple Daniel P. Berrange (11): qdict: implement a qdict_crumple method for un-flattening a dict qapi: allow QmpInputVisitor to auto-cast types qom: support arbitrary non-scalar properties with -object

Re: [Qemu-block] [PATCH v3 1/2] Makefile: Add a "FORCE" target

2016-06-01 Thread Daniel P. Berrange
gt; @@ -81,7 +81,7 @@ Makefile: ; > configure: ; > > .PHONY: all clean cscope distclean dvi html info install install-doc \ > - pdf recurse-all speed test dist msi > + pdf recurse-all speed test dist msi FORCE > > $(call set-vpath, $(SRC_PATH)) Reviewed-by

Re: [Qemu-block] [PATCH v3 2/2] Makefile: Derive "PKGVERSION" from "git describe" by default

2016-06-01 Thread Daniel P. Berrange
| 4 > vl.c | 1 + > 6 files changed, 25 insertions(+), 5 deletions(-) Reviewed-by: Daniel P. Berrange Regards, Daniel -- |: http://berrange.com -o-http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :

Re: [Qemu-block] [Qemu-devel] [PATCH v4 09/11] nbd: Add qemu-nbd -D for human-readable description

2016-05-12 Thread Daniel P. Berrange
On Thu, May 12, 2016 at 09:38:58AM -0600, Eric Blake wrote: > On 05/12/2016 01:47 AM, Daniel P. Berrange wrote: > > On Wed, May 11, 2016 at 04:39:42PM -0600, Eric Blake wrote: > >> The NBD protocol allows servers to advertise a human-readable > >> description alon

Re: [Qemu-block] [Qemu-devel] [PATCH v4 09/11] nbd: Add qemu-nbd -D for human-readable description

2016-05-12 Thread Daniel P. Berrange
On Wed, May 11, 2016 at 04:39:42PM -0600, Eric Blake wrote: > The NBD protocol allows servers to advertise a human-readable > description alongside an export name during NBD_OPT_LIST. Add > an option to pass through the user's string to the NBD client. > > Doing this also makes it easier to test

[Qemu-block] Creating / formatting volumes with non-file based block backends

2016-05-11 Thread Daniel P. Berrange
I'm looking once again at the process of creating volumes for QEMU formatted with LUKS encryption. For plain files it is easily possible with qemu-img create -f luks \ --object secret,id=sec0,file=passphrase.txt \ -o key-secret=sec0 \ demo.l

[Qemu-block] [PATCH v4 10/10] vnc: allow specifying a custom ACL object name

2016-05-11 Thread Daniel P. Berrange
authz-simple,id=saslacl0,policy=deny,\ rules.0.match=f...@redhat.com,rules.0.policy=allow \ rules.0.match=j...@redhat.com,rules.0.policy=allow \ -vnc 0.0.0.0:1,tls-creds=tls0,tls-acl=tlsacl0, sasl,sasl-acl=saslacl0 \ ...oth

[Qemu-block] [PATCH v4 06/10] acl: delete existing ACL implementation

2016-05-11 Thread Daniel P. Berrange
uperset of the functionality in qemu_acl, so the latter can now be deleted. The HMP 'acl_*' monitor commands are converted to use the new QAuthZSimple data type instead in order to provide backwards compatibility, but their use is discouraged. Signed-off-by: Daniel P. Ber

[Qemu-block] [PATCH v4 09/10] chardev: add support for ACLs for TLS clients

2016-05-11 Thread Daniel P. Berrange
e/berrange/qemutls,\ endpoint=server,verify-peer=yes \ -object authz-simple,id=acl0,policy=deny,\ rules.0.match=\*CN=fred,rules.0.policy=allow \ -chardev socket,host=127.0.0.1,port=9000,server,\ tls-creds=tls0,tls-acl=acl0 \ ..

[Qemu-block] [PATCH v4 07/10] qemu-nbd: add support for ACLs for TLS clients

2016-05-11 Thread Daniel P. Berrange
s,\ endpoint=server,verify-peer=yes \ -object authz-simple,id=acl0,policy=deny,\ rules.0.match=*CN=fred,rules.0.policy=allow \ -tls-creds tls0 \ -tls-acl acl0 other qemu-nbd args... Signed-off-by

[Qemu-block] [PATCH v4 05/10] util: add QAuthZSimple object type for a simple access control list

2016-05-11 Thread Daniel P. Berrange
via the -object command line $QEMU \ -object authz-simple,id=acl0,policy=deny,\ match.0.name=fred,match.0.policy=allow,match.0.format=exact,\ match.1.name=bob,match.1.policy=allow,match.1.format=exact,\ match.2.name=danb,match.2.policy=deny,match.2.fo

[Qemu-block] [PATCH v4 00/10]Provide a QOM-based authorization API

2016-05-11 Thread Daniel P. Berrange
asts, instead of C type casts (Max) Changed in v2: - Adapt to changes in qapi visitor APIs - Add a 'bool recursive' flag to qdict_crumple (Max) - Fix memory leaks in qdict_crumple (Max) - Split out key splitting code from qdict_crumple (Max) - Use saner variable names in qdict

[Qemu-block] [PATCH v4 04/10] util: add QAuthZ object as an authorization base class

2016-05-11 Thread Daniel P. Berrange
tion providers. Signed-off-by: Daniel P. Berrange --- MAINTAINERS | 7 + Makefile | 1 + Makefile.objs| 2 ++ Makefile.target | 2 ++ include/qemu/authz.h | 89 util/Makefile.objs | 2 ++ util/aut

[Qemu-block] [PATCH v4 01/10] qdict: implement a qdict_crumple method for un-flattening a dict

2016-05-11 Thread Daniel P. Berrange
;.', then it must be escaped as '..'. ie a flat dict { 'foo..bar': 'wizz', 'bar.foo..bar': 'eek', 'bar.hello': 'world' } Will end up as { 'foo.bar': 'wizz', 'bar':

[Qemu-block] [PATCH v4 03/10] qom: support arbitrary non-scalar properties with -object

2016-05-11 Thread Daniel P. Berrange
HMP monitor with the same syntax. (hmp) object_add demo,id=demo0,\ foo.0.bar=one,foo.0.wizz=1,\ foo.1.bar=two,foo.1.wizz=2 NB indentation should not be used with HMP commands, this is just for convenient formatting in this commit message. Signed-off-by: Da

[Qemu-block] [PATCH v4 02/10] qapi: allow QmpInputVisitor to auto-cast types

2016-05-11 Thread Daniel P. Berrange
behaviour is turned on by requesting the 'autocast' flag in the constructor. This makes it possible to use QmpInputVisitor with a QDict produced from QemuOpts, where everything is in string format. Signed-off-by: Daniel P. Berrange --- include/qapi/qmp-input-visitor.h | 3 + qapi/opt

[Qemu-block] [PATCH v4 08/10] nbd: allow an ACL to be set with nbd-server-start QMP command

2016-05-11 Thread Daniel P. Berrange
arguments': { 'addr': { 'type': 'inet', 'host': '127.0.0.1', 'port': '9000' }, 'tls-creds': 'tls0', 'tls-acl': 'tlsacl0'

Re: [Qemu-block] [Qemu-devel] [PATCH v4 08/27] osdep: Add qemu_lock_fd and qemu_unlock_fd

2016-05-11 Thread Daniel P. Berrange
On Wed, May 11, 2016 at 08:48:18AM +0800, Fam Zheng wrote: > On Tue, 05/10 09:57, Daniel P. Berrange wrote: > > On Tue, May 10, 2016 at 10:50:40AM +0800, Fam Zheng wrote: > > > They are wrappers of POSIX fcntl file locking, with the additional > > > interception of op

Re: [Qemu-block] [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-11 Thread Daniel P. Berrange
On Wed, May 11, 2016 at 10:04:12AM +0200, Markus Armbruster wrote: > "Daniel P. Berrange" writes: > > > On Tue, May 10, 2016 at 01:11:30PM +0100, Richard W.M. Jones wrote: > >> At no point did I say that it was safe to use libguestfs on live VMs > >> or t

[Qemu-block] [PATCH v9 2/3] block: add support for encryption secrets in block I/O tests

2016-05-10 Thread Daniel P. Berrange
h a secret called 'keysec0' The _qemu_img_wrapper function isn't modified as that needs to cope with differing syntax for subcommands, so can't be made to use the image opts syntax unconditionally. Signed-off-by: Daniel P. Berrange --- tests/qemu-iotests/common| 1 + te

[Qemu-block] [PATCH v9 3/3] block: enable testing of LUKS driver with block I/O tests

2016-05-10 Thread Daniel P. Berrange
for luks - 145 - needs adapting to use correct -drive syntax for luks The vast majority of skipped tests are exercising code that is qcow2 specific, though a couple could probably be usefully enabled for luks too. Signed-off-by: Daniel P. Berrange --- tests/qemu-iotests/004 | 2 +- tests/q

[Qemu-block] [PATCH v9 1/3] block: add support for --image-opts in block I/O tests

2016-05-10 Thread Daniel P. Berrange
set to 'true', then qemu-img/qemu-io should use --image-opts. Signed-off-by: Daniel P. Berrange --- tests/qemu-iotests/039.out | 20 +++--- tests/qemu-iotests/061.out | 8 +++--- tests/qemu-iotests/137.out | 4 +-- tests/qemu-iotests/common| 7 -

[Qemu-block] [PATCH v9 0/3] Tests for LUKS driver

2016-05-10 Thread Daniel P. Berrange
lways set - Clarify why we don't change _qemu_img_wrapper in commit msg Changed in v7: - Avoid setting TEST_IMG_FILE when IMGPROTO=file in common.rc for traditional (not --image-opts) variable setup Daniel P. Berrange (3): block: add support for --image-opts in block I/O tests bloc

Re: [Qemu-block] [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-10 Thread Daniel P. Berrange
On Tue, May 10, 2016 at 01:11:30PM +0100, Richard W.M. Jones wrote: > At no point did I say that it was safe to use libguestfs on live VMs > or that you would always get consistent data out. > > But the fact that it can fail is understood, the chance of failure is > really tiny (it has literally o

Re: [Qemu-block] [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-10 Thread Daniel P. Berrange
On Tue, May 10, 2016 at 12:07:06PM +0200, Kevin Wolf wrote: > Am 10.05.2016 um 11:43 hat Daniel P. Berrange geschrieben: > > On Tue, May 10, 2016 at 11:35:14AM +0200, Kevin Wolf wrote: > > > Am 10.05.2016 um 11:23 hat Daniel P. Berrange geschrieben: > > > > On Tue, Ma

Re: [Qemu-block] [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-10 Thread Daniel P. Berrange
On Tue, May 10, 2016 at 11:35:14AM +0200, Kevin Wolf wrote: > Am 10.05.2016 um 11:23 hat Daniel P. Berrange geschrieben: > > On Tue, May 10, 2016 at 11:14:22AM +0200, Kevin Wolf wrote: > > > Am 10.05.2016 um 10:50 hat Daniel P. Berrange geschrieben: > > > > On Tue, Ma

Re: [Qemu-block] [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-10 Thread Daniel P. Berrange
On Tue, May 10, 2016 at 11:14:22AM +0200, Kevin Wolf wrote: > Am 10.05.2016 um 10:50 hat Daniel P. Berrange geschrieben: > > On Tue, May 10, 2016 at 09:43:04AM +0100, Richard W.M. Jones wrote: > > > On Tue, May 10, 2016 at 09:14:26AM +0100, Richard W.M. Jones wrote: > > &

Re: [Qemu-block] [PATCH v4 08/27] osdep: Add qemu_lock_fd and qemu_unlock_fd

2016-05-10 Thread Daniel P. Berrange
On Tue, May 10, 2016 at 10:06:35AM +0100, Richard W.M. Jones wrote: > On Tue, May 10, 2016 at 09:57:48AM +0100, Daniel P. Berrange wrote: > > On Tue, May 10, 2016 at 10:50:40AM +0800, Fam Zheng wrote: > > > They are wrappers of POSIX fcntl file locking, with the additional >

Re: [Qemu-block] [PATCH v4 08/27] osdep: Add qemu_lock_fd and qemu_unlock_fd

2016-05-10 Thread Daniel P. Berrange
On Tue, May 10, 2016 at 10:50:40AM +0800, Fam Zheng wrote: > They are wrappers of POSIX fcntl file locking, with the additional > interception of open/close (through qemu_open and qemu_close) to offer a > better semantics that preserves the locks across multiple life cycles of > different fds on th

Re: [Qemu-block] [Qemu-devel] [PATCH v4 00/27] block: Lock images when opening

2016-05-10 Thread Daniel P. Berrange
On Tue, May 10, 2016 at 09:43:04AM +0100, Richard W.M. Jones wrote: > On Tue, May 10, 2016 at 09:14:26AM +0100, Richard W.M. Jones wrote: > > However I didn't test the write-shareable case (the libvirt > > flag which should map to a shared lock -- is that right Dan?). > > To Dan (mainly): I think

Re: [Qemu-block] [PATCH v8 3/3] block: enable testing of LUKS driver with block I/O tests

2016-05-09 Thread Daniel P. Berrange
On Fri, May 06, 2016 at 03:32:15PM +0200, Max Reitz wrote: > On 18.04.2016 14:21, Daniel P. Berrange wrote: > > This adds support for testing the LUKS driver with the block > > I/O test framework. > > > >cd tests/qemu-io-tests > >./check -luks > > &

Re: [Qemu-block] [Qemu-devel] [PATCH v6 01/10] qom: add helpers for UserCreatable object types

2016-04-27 Thread Daniel P. Berrange
On Wed, Apr 27, 2016 at 06:43:43AM -0600, Eric Blake wrote: > On 04/27/2016 03:58 AM, Daniel P. Berrange wrote: > > On Wed, Apr 27, 2016 at 11:26:23AM +0200, Markus Armbruster wrote: > >> This commit regresses error message quality from > >> > >> $ qemu-sys

Re: [Qemu-block] [Qemu-devel] [PATCH v6 01/10] qom: add helpers for UserCreatable object types

2016-04-27 Thread Daniel P. Berrange
earlier patch ? > > For comparison, this is how it looks before the patch: > > (gdb) p cur_loc > $1 = (Location *) 0x7fffdc10 > (gdb) p *cur_loc > $2 = {kind = LOC_CMDLINE, num = 2, ptr = 0x7fffe018, prev = > 0x565d2770 } > > Report

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.6] block: add an 'iscsi-id' value to match -drive with -iscsi opts

2016-04-22 Thread Daniel P. Berrange
On Fri, Apr 22, 2016 at 01:10:40PM +0100, Peter Maydell wrote: > On 22 April 2016 at 12:55, Daniel P. Berrange wrote: > > On Fri, Apr 22, 2016 at 01:53:47PM +0200, Kevin Wolf wrote: > >> -iscsi is a weird thing anyway. We should do things the usual way, with > >> a

Re: [Qemu-block] [PATCH for-2.6] block: add an 'iscsi-id' value to match -drive with -iscsi opts

2016-04-22 Thread Daniel P. Berrange
On Fri, Apr 22, 2016 at 01:53:47PM +0200, Kevin Wolf wrote: > Am 22.04.2016 um 13:43 hat Daniel P. Berrange geschrieben: > > On Fri, Apr 22, 2016 at 01:13:42PM +0200, Peter Lieven wrote: > > > Am 22.04.2016 um 12:59 schrieb Kevin Wolf: > > > > Am 22.04.2016 u

Re: [Qemu-block] [PATCH for-2.6] block: add an 'iscsi-id' value to match -drive with -iscsi opts

2016-04-22 Thread Daniel P. Berrange
On Fri, Apr 22, 2016 at 01:13:42PM +0200, Peter Lieven wrote: > Am 22.04.2016 um 12:59 schrieb Kevin Wolf: > > Am 22.04.2016 um 12:24 hat Daniel P. Berrange geschrieben: > >> The iSCSI block driver has ability to lookup various options, in > >> particular authentica

[Qemu-block] [PATCH for-2.6] block: add an 'iscsi-id' value to match -drive with -iscsi opts

2016-04-22 Thread Daniel P. Berrange
scsi-id=my_initiator,file=iscsi://somehost/iqn/1 Signed-off-by: Daniel P. Berrange --- block/iscsi.c | 35 +++ qemu-doc.texi | 12 +--- qemu-options.hx | 4 ++-- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/block/iscsi.c b/block/i

[Qemu-block] [PATCH for-2.6] Fix association of -drive & -iscsi args

2016-04-22 Thread Daniel P. Berrange
that someone is using the current syntax. Daniel P. Berrange (1): block: add an 'iscsi-id' value to match -drive with -iscsi opts block/iscsi.c | 35 +++ qemu-doc.texi | 12 +--- qemu-options.hx | 4 ++-- 3 files changed, 34 insertions(+), 17 deletions(-) -- 2.5.5

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-19 Thread Daniel P. Berrange
On Tue, Apr 19, 2016 at 02:36:05PM +0100, Richard W.M. Jones wrote: > > I'd prefer some kind of no lock / ignore lock. There is a legitimate > case where you want to have the shared lock behaviour, but also a > legitimate one for turning it off. I'm not opposed to the idea -- > there are very re

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-19 Thread Daniel P. Berrange
On Mon, Apr 18, 2016 at 09:04:19AM +0100, Richard W.M. Jones wrote: > On Mon, Apr 18, 2016 at 09:10:36AM +0800, Fam Zheng wrote: > > On Sun, 04/17 20:27, Richard W.M. Jones wrote: > > > On Fri, Apr 15, 2016 at 11:27:55AM +0800, Fam Zheng wrote: > > > > virtlockd in libvirt locks the first byte, we

[Qemu-block] [PATCH v8 2/3] block: add support for encryption secrets in block I/O tests

2016-04-18 Thread Daniel P. Berrange
h a secret called 'keysec0' The _qemu_img_wrapper function isn't modified as that needs to cope with differing syntax for subcommands, so can't be made to use the image opts syntax unconditionally. Signed-off-by: Daniel P. Berrange --- tests/qemu-iotests/common| 1 + te

[Qemu-block] [PATCH v8 3/3] block: enable testing of LUKS driver with block I/O tests

2016-04-18 Thread Daniel P. Berrange
- 145 - needs adapting to use correct -drive syntax for luks The vast majority of skipped tests are exercising code that is qcow2 specific, though a couple could probably be usefully enabled for luks too. Signed-off-by: Daniel P. Berrange --- tests/qemu-iotests/004 | 2 +- tests/q

[Qemu-block] [PATCH v8 1/3] block: add support for --image-opts in block I/O tests

2016-04-18 Thread Daniel P. Berrange
set to 'true', then qemu-img/qemu-io should use --image-opts. Signed-off-by: Daniel P. Berrange --- tests/qemu-iotests/039.out | 20 +++--- tests/qemu-iotests/061.out | 8 +++--- tests/qemu-iotests/137.out | 4 +-- tests/qemu-iotests/common| 7 -

[Qemu-block] [PATCH v8 0/3] Tests for LUKS driver

2016-04-18 Thread Daniel P. Berrange
mage-opts) variable setup Daniel P. Berrange (3): block: add support for --image-opts in block I/O tests block: add support for encryption secrets in block I/O tests block: enable testing of LUKS driver with block I/O tests tests/qemu-iotests/004 | 2 +- tests/qemu-iotests/012

Re: [Qemu-block] [PATCH for-2.7 v2 00/17] block: Lock images when opening

2016-04-18 Thread Daniel P. Berrange
On Fri, Apr 15, 2016 at 11:27:50AM +0800, Fam Zheng wrote: > v2: Lock byte 1 in the image itself, no lock file. [Daniel] > Fix migration (image are not locked in bdrv_open_common if > BDRV_O_INACTIVE). [Denis] > Simplify test case fixes because of the above. > Add lock for RBD. >

Re: [Qemu-block] [PATCH for-2.7 v2 05/17] raw-posix: Implement .bdrv_lockf

2016-04-18 Thread Daniel P. Berrange
On Mon, Apr 18, 2016 at 09:12:44AM +0800, Fam Zheng wrote: > On Sat, 04/16 16:29, Denis V. Lunev wrote: > > On 04/15/2016 06:27 AM, Fam Zheng wrote: > > >virtlockd in libvirt locks the first byte, we lock byte 1 to avoid > > >the intervene. > > > &g

Re: [Qemu-block] [Qemu-devel] [PATCH v2 for-2.6] block: convert iscsi target to a valid ID for -iscsi arg lookup

2016-04-14 Thread Daniel P. Berrange
On Wed, Apr 13, 2016 at 09:41:54PM -0400, John Ferlan wrote: > > > On 04/13/2016 12:17 PM, Daniel P. Berrange wrote: > > The iSCSI block driver has a very strange approach whereby it > > does not accept options directly as part of the -drive arg, > > but instead t

[Qemu-block] [PATCH v2 for-2.6] block: convert iscsi target to a valid ID for -iscsi arg lookup

2016-04-13 Thread Daniel P. Berrange
nt a full collision-free escaping syntax for iSCSI target IDs. Signed-off-by: Daniel P. Berrange --- Note this problem was previously raised: http://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg06501.html and discussed the following month: http://lists.nongnu.org/archive/html/qemu-de

Re: [Qemu-block] [Qemu-devel] [PATCH] iSCSI: start moving options also for -drive

2016-04-13 Thread Daniel P. Berrange
On Tue, Apr 12, 2016 at 04:57:42PM +0200, Pino Toscano wrote: > Hi, > > to overcome the limitations of the options handling [1], I'm planning > to move more options for iSCSI also as block options, so it is possible > to specify them with -drive. > > The only patch in this series is for initiator

[Qemu-block] [PATCH for 2.6] block: convert iscsi target to a valid ID for -iscsi arg lookup

2016-04-13 Thread Daniel P. Berrange
nt a full collision-free escaping syntax for iSCSI target IDs. Signed-off-by: Daniel P. Berrange --- Note this problem was previously raised: http://lists.nongnu.org/archive/html/qemu-devel/2015-11/msg06501.html and discussed the following month: http://lists.nongnu.org/archive/html/qemu-dev

Re: [Qemu-block] [PATCH for-2.7 05/15] raw-posix: Implement .bdrv_lockf

2016-04-13 Thread Daniel P. Berrange
On Wed, Apr 13, 2016 at 05:09:54PM +0800, Fam Zheng wrote: > Because virtlockd in libvirt already uses the fcntl lock on the image file, we > have to workaround this by locking a digest-mapped temporary file. > > Signed-off-by: Fam Zheng > --- > block/raw-posix.c | 97 >

<    3   4   5   6   7   8   9   10   11   12   >