Re: [Qemu-block] [Qemu-devel] New iotest repros failures on virtio external snapshot with iothread

2017-03-29 Thread Eric Blake
On 03/29/2017 09:01 PM, Ed Swierk via Qemu-devel wrote: > Parts of qemu's block code have changed a lot in recent months but are > not well exercised by current tests. > > Subtle bugs have crept in causing assertion failures, hangs and other > crashes in a variety of situations: immediately on

Re: [Qemu-block] [PATCH v6 02/10] iotests: Improve image-clear tests on non-aligned image

2017-03-29 Thread Eric Blake
On 03/13/2017 05:00 PM, Max Reitz wrote: > On 08.03.2017 03:54, Eric Blake wrote: >> Tweak 097 and 176 to operate on an image that is not cluster-aligned, >> to give further coverage of clearing out an entire image. >> >> Signed-off-by: Eric Blake >> >> --- >> v6: new patch >>

[Qemu-block] New iotest repros failures on virtio external snapshot with iothread

2017-03-29 Thread Ed Swierk
Parts of qemu's block code have changed a lot in recent months but are not well exercised by current tests. Subtle bugs have crept in causing assertion failures, hangs and other crashes in a variety of situations: immediately on start, on first guest activity, on external snapshot create or

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10 13/16] block/qcow2: qcow2_calc_size_usage() for truncate

2017-03-29 Thread Max Reitz
On 20.03.2017 16:14, Max Reitz wrote: > On 20.03.2017 12:26, Stefan Hajnoczi wrote: >> On Mon, Mar 13, 2017 at 10:41:14PM +0100, Max Reitz wrote: >>> This patch extends qcow2_calc_size_usage() so it can calculate the >>> additional space needed for preallocating image growth. >>> >>>

Re: [Qemu-block] [PATCH v3 1/1] block: pass the right options for BlockDriver.bdrv_open()

2017-03-29 Thread Max Reitz
On 29.03.2017 03:16, Dong Jia Shi wrote: > raw_open() expects the caller always passing in the right actual > @options parameter. But when trying to applying snapshot on a RBD > image, bdrv_snapshot_goto() calls raw_open() (by calling the > bdrv_open callback on the BlockDriver) with a NULL

Re: [Qemu-block] [for-2.9 8/8] sheepdog: Fix blockdev-add

2017-03-29 Thread Max Reitz
On 29.03.2017 22:32, Eric Blake wrote: > On 03/29/2017 02:59 PM, Max Reitz wrote: >> On 29.03.2017 18:45, Markus Armbruster wrote: >>> Commit 831acdc "sheepdog: Implement bdrv_parse_filename()" and commit >>> d282f34 "sheepdog: Support blockdev-add" have different ideas on how >>> the QemuOpts

Re: [Qemu-block] [for-2.9 8/8] sheepdog: Fix blockdev-add

2017-03-29 Thread Eric Blake
On 03/29/2017 02:59 PM, Max Reitz wrote: > On 29.03.2017 18:45, Markus Armbruster wrote: >> Commit 831acdc "sheepdog: Implement bdrv_parse_filename()" and commit >> d282f34 "sheepdog: Support blockdev-add" have different ideas on how >> the QemuOpts parameters for the server address are named.

Re: [Qemu-block] [for-2.9 7/8] nbd: Tidy up blockdev-add interface

2017-03-29 Thread Eric Blake
On 03/29/2017 11:45 AM, Markus Armbruster wrote: > SocketAddress is a simple union, and simple unions are awkward: they > have their variant members wrapped in a "data" object on the wire, and > require additional indirections in C. I intend to limit its use to > existing external interfaces, and

Re: [Qemu-block] [for-2.9 5/8] gluster: Prepare for SocketAddressFlat extension

2017-03-29 Thread Jeff Cody
On Wed, Mar 29, 2017 at 06:45:17PM +0200, Markus Armbruster wrote: > qemu_gluster_glfs_init() and qemu_gluster_parse_json() rely on the > fact that SocketAddressFlatType has only two members > SOCKET_ADDRESS_FLAT_TYPE_INET and SOCKET_ADDRESS_FLAT_TYPE_UNIX. > Correct, but won't stay correct. Make

Re: [Qemu-block] [for-2.9 6/8] qapi-schema: SocketAddressFlat variants 'vsock' and 'fd'

2017-03-29 Thread Eric Blake
On 03/29/2017 11:45 AM, Markus Armbruster wrote: > Note that the new variants are impossible in qemu_gluster_glfs_init(), > because the gconf->server can only come from qemu_gluster_parse_uri() > or qemu_gluster_parse_json(), and neither can create anything but > 'tcp' or 'unix'. > >

Re: [Qemu-block] [for-2.9 8/8] sheepdog: Fix blockdev-add

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > Commit 831acdc "sheepdog: Implement bdrv_parse_filename()" and commit > d282f34 "sheepdog: Support blockdev-add" have different ideas on how > the QemuOpts parameters for the server address are named. Fix that. > While there, rename

Re: [Qemu-block] [for-2.9 1/8] nbd sockets vnc: Mark problematic address family tests TODO

2017-03-29 Thread Eric Blake
On 03/29/2017 11:45 AM, Markus Armbruster wrote: > Certain features make sense only with certain address families. For > instance, passing file descriptors requires AF_UNIX. Testing > SocketAddress's saddr->type == SOCKET_ADDRESS_KIND_UNIX is obvious, > but problematic: it can't recognize

Re: [Qemu-block] [for-2.9 7/8] nbd: Tidy up blockdev-add interface

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > SocketAddress is a simple union, and simple unions are awkward: they > have their variant members wrapped in a "data" object on the wire, and > require additional indirections in C. I intend to limit its use to > existing external interfaces, and

Re: [Qemu-block] [for-2.9 6/8] qapi-schema: SocketAddressFlat variants 'vsock' and 'fd'

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > Note that the new variants are impossible in qemu_gluster_glfs_init(), > because the gconf->server can only come from qemu_gluster_parse_uri() > or qemu_gluster_parse_json(), and neither can create anything but > 'tcp' or 'unix'. s/tcp/inet/ >

Re: [Qemu-block] [for-2.9 5/8] gluster: Prepare for SocketAddressFlat extension

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > qemu_gluster_glfs_init() and qemu_gluster_parse_json() rely on the > fact that SocketAddressFlatType has only two members > SOCKET_ADDRESS_FLAT_TYPE_INET and SOCKET_ADDRESS_FLAT_TYPE_UNIX. > Correct, but won't stay correct. Make them more robust. >

Re: [Qemu-block] [for-2.9 4/8] block: Document -drive problematic code and bugs

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > -blockdev and blockdev_add convert their arguments via QObject to > BlockdevOptions for qmp_blockdev_add(), which converts them back to > QObject, then to a flattened QDict. The QDict's members are typed > according to the QAPI schema. > > -drive

Re: [Qemu-block] [for-2.9 3/8] io vnc sockets: Clean up SocketAddressKind switches

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > We have quite a few switches over SocketAddressKind. Some have case > labels for all enumeration values, others rely on a default label. > Some abort when the value isn't a valid SocketAddressKind, others > report an error then. > > Unify as

Re: [Qemu-block] [for-2.9 2/8] char: Fix socket with "type": "vsock" address

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > Watch this: > > $ qemu-system-x86_64 -nodefaults -S -display none -qmp stdio > {"QMP": {"version": {"qemu": {"micro": 91, "minor": 8, "major": 2}, > "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}} > { "execute":

Re: [Qemu-block] [for-2.9 1/8] nbd sockets vnc: Mark problematic address family tests TODO

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > Certain features make sense only with certain address families. For > instance, passing file descriptors requires AF_UNIX. Testing > SocketAddress's saddr->type == SOCKET_ADDRESS_KIND_UNIX is obvious, > but problematic: it can't recognize AF_UNIX

Re: [Qemu-block] [for-2.9 2/8] char: Fix socket with "type": "vsock" address

2017-03-29 Thread Stefan Hajnoczi
On Wed, Mar 29, 2017 at 06:45:14PM +0200, Markus Armbruster wrote: > Watch this: > > $ qemu-system-x86_64 -nodefaults -S -display none -qmp stdio > {"QMP": {"version": {"qemu": {"micro": 91, "minor": 8, "major": 2}, > "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}} >

Re: [Qemu-block] [for-2.9 2/8] char: Fix socket with "type": "vsock" address

2017-03-29 Thread Marc-André Lureau
Hi - Original Message - > Watch this: > > $ qemu-system-x86_64 -nodefaults -S -display none -qmp stdio > {"QMP": {"version": {"qemu": {"micro": 91, "minor": 8, "major": 2}, > "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}} > { "execute":

Re: [Qemu-block] [for-2.9 2/8] char: Fix socket with "type": "vsock" address

2017-03-29 Thread Marc-André Lureau
- Original Message - > > Hi > > - Original Message - > > Watch this: > > > > $ qemu-system-x86_64 -nodefaults -S -display none -qmp stdio > > {"QMP": {"version": {"qemu": {"micro": 91, "minor": 8, "major": 2}, > > "package": " (v2.8.0-1195-gf84141e-dirty)"},

Re: [Qemu-block] [for-2.9 7/8] nbd: Tidy up blockdev-add interface

2017-03-29 Thread Paolo Bonzini
On 29/03/2017 18:45, Markus Armbruster wrote: > Unfortunately, SocketAddress is also visible in -drive since 2.8. Add > still more gunk to nbd_process_legacy_socket_options(). You can now > shorten > > -drive >

[Qemu-block] [for-2.9 2/8] char: Fix socket with "type": "vsock" address

2017-03-29 Thread Markus Armbruster
Watch this: $ qemu-system-x86_64 -nodefaults -S -display none -qmp stdio {"QMP": {"version": {"qemu": {"micro": 91, "minor": 8, "major": 2}, "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}} { "execute": "qmp_capabilities" } {"return": {}} { "execute":

[Qemu-block] [for-2.9 4/8] block: Document -drive problematic code and bugs

2017-03-29 Thread Markus Armbruster
-blockdev and blockdev_add convert their arguments via QObject to BlockdevOptions for qmp_blockdev_add(), which converts them back to QObject, then to a flattened QDict. The QDict's members are typed according to the QAPI schema. -drive converts its argument via QemuOpts to a (flat) QDict. This

[Qemu-block] [for-2.9 7/8] nbd: Tidy up blockdev-add interface

2017-03-29 Thread Markus Armbruster
SocketAddress is a simple union, and simple unions are awkward: they have their variant members wrapped in a "data" object on the wire, and require additional indirections in C. I intend to limit its use to existing external interfaces, and convert all internal interfaces to SocketAddressFlat.

[Qemu-block] [for-2.9 1/8] nbd sockets vnc: Mark problematic address family tests TODO

2017-03-29 Thread Markus Armbruster
Certain features make sense only with certain address families. For instance, passing file descriptors requires AF_UNIX. Testing SocketAddress's saddr->type == SOCKET_ADDRESS_KIND_UNIX is obvious, but problematic: it can't recognize AF_UNIX when type == SOCKET_ADDRESS_KIND_FD. Mark such tests

[Qemu-block] [for-2.9 6/8] qapi-schema: SocketAddressFlat variants 'vsock' and 'fd'

2017-03-29 Thread Markus Armbruster
Note that the new variants are impossible in qemu_gluster_glfs_init(), because the gconf->server can only come from qemu_gluster_parse_uri() or qemu_gluster_parse_json(), and neither can create anything but 'tcp' or 'unix'. Signed-off-by: Markus Armbruster --- block/gluster.c

[Qemu-block] [for-2.9 5/8] gluster: Prepare for SocketAddressFlat extension

2017-03-29 Thread Markus Armbruster
qemu_gluster_glfs_init() and qemu_gluster_parse_json() rely on the fact that SocketAddressFlatType has only two members SOCKET_ADDRESS_FLAT_TYPE_INET and SOCKET_ADDRESS_FLAT_TYPE_UNIX. Correct, but won't stay correct. Make them more robust. Signed-off-by: Markus Armbruster

[Qemu-block] [for-2.9 8/8] sheepdog: Fix blockdev-add

2017-03-29 Thread Markus Armbruster
Commit 831acdc "sheepdog: Implement bdrv_parse_filename()" and commit d282f34 "sheepdog: Support blockdev-add" have different ideas on how the QemuOpts parameters for the server address are named. Fix that. While there, rename BlockdevOptionsSheepdog member addr to server, for consistency with

[Qemu-block] [for-2.9 3/8] io vnc sockets: Clean up SocketAddressKind switches

2017-03-29 Thread Markus Armbruster
We have quite a few switches over SocketAddressKind. Some have case labels for all enumeration values, others rely on a default label. Some abort when the value isn't a valid SocketAddressKind, others report an error then. Unify as follows. Always provide case labels for all enumeration values,

[Qemu-block] [for-2.9 0/8] Fixes and cleanups around SocketAddress

2017-03-29 Thread Markus Armbruster
What makes this 2.9 material is the crash bug fixed in PATCH 2 and the QAPI/QMP interface cleanups in PATCH 7+8. Sheepdog tests still in progress (with Kashyap's help), but I'm sending this out now in the hope of getting a head start on review. Markus Armbruster (8): nbd sockets vnc: Mark

Re: [Qemu-block] [RFC] migration/block:limit the time used for block migration

2017-03-29 Thread Juan Quintela
858585 jemmy wrote: > On Tue, Mar 28, 2017 at 5:47 PM, Juan Quintela wrote: >> Lidong Chen wrote: >>> when migration with quick speed, mig_save_device_bulk invoke >>> bdrv_is_allocated too frequently, and cause vnc reponse

Re: [Qemu-block] [PATCH 3/4] savevm: fix savevm after migration

2017-03-29 Thread Paolo Bonzini
On 29/03/2017 17:29, Dr. David Alan Gilbert wrote: >>> 'abort' is not very good too I think. migration is completed, nothing to >>> abort.. (may be successful migration to file for suspend, some kind of >>> vm cloning, etc) >> There is already migrate_cancel. Does it make sense to make it >>

Re: [Qemu-block] [PATCH 3/4] savevm: fix savevm after migration

2017-03-29 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > > > On 28/03/2017 15:16, Vladimir Sementsov-Ogievskiy wrote: > > 28.03.2017 15:09, Kevin Wolf wrote: > >> Am 28.03.2017 um 13:13 hat Dr. David Alan Gilbert geschrieben: > >>> * Kevin Wolf (kw...@redhat.com) wrote: > Am 28.03.2017 um 12:55 hat

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] parallels: wrong call to bdrv_truncate

2017-03-29 Thread Denis V. Lunev
On 03/29/2017 05:11 PM, Kevin Wolf wrote: > Am 29.03.2017 um 15:53 hat Denis V. Lunev geschrieben: >> On 03/29/2017 01:41 PM, Kevin Wolf wrote: >>> Am 28.03.2017 um 19:12 hat Denis V. Lunev geschrieben: On 03/28/2017 07:26 PM, Kevin Wolf wrote: > [ Cc: qemu-block ] > > Am

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] parallels: wrong call to bdrv_truncate

2017-03-29 Thread Kevin Wolf
Am 29.03.2017 um 16:18 hat Denis V. Lunev geschrieben: > On 03/29/2017 05:11 PM, Kevin Wolf wrote: > > Am 29.03.2017 um 15:53 hat Denis V. Lunev geschrieben: > >> On 03/29/2017 01:41 PM, Kevin Wolf wrote: > >>> The question is what the contract of bdrv_truncate() is. I think "you > >>> can only

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] parallels: wrong call to bdrv_truncate

2017-03-29 Thread Denis V. Lunev
On 03/29/2017 01:41 PM, Kevin Wolf wrote: > Am 28.03.2017 um 19:12 hat Denis V. Lunev geschrieben: >> On 03/28/2017 07:26 PM, Kevin Wolf wrote: >>> [ Cc: qemu-block ] >>> >>> Am 27.03.2017 um 16:38 hat Denis V. Lunev geschrieben: Parallels driver should not call bdrv_truncate if the image was

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] parallels: wrong call to bdrv_truncate

2017-03-29 Thread Kevin Wolf
Am 29.03.2017 um 15:53 hat Denis V. Lunev geschrieben: > On 03/29/2017 01:41 PM, Kevin Wolf wrote: > > Am 28.03.2017 um 19:12 hat Denis V. Lunev geschrieben: > >> On 03/28/2017 07:26 PM, Kevin Wolf wrote: > >>> [ Cc: qemu-block ] > >>> > >>> Am 27.03.2017 um 16:38 hat Denis V. Lunev geschrieben: >

Re: [Qemu-block] [RFC] migration/block:limit the time used for block migration

2017-03-29 Thread 858585 jemmy
On Tue, Mar 28, 2017 at 5:47 PM, Juan Quintela wrote: > Lidong Chen wrote: >> when migration with quick speed, mig_save_device_bulk invoke >> bdrv_is_allocated too frequently, and cause vnc reponse slowly. >> this patch limit the time used for

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] parallels: wrong call to bdrv_truncate

2017-03-29 Thread Kevin Wolf
Am 28.03.2017 um 19:12 hat Denis V. Lunev geschrieben: > On 03/28/2017 07:26 PM, Kevin Wolf wrote: > > [ Cc: qemu-block ] > > > > Am 27.03.2017 um 16:38 hat Denis V. Lunev geschrieben: > >> Parallels driver should not call bdrv_truncate if the image was opened > >> in the read-only mode. Without

Re: [Qemu-block] [PATCH 3/4] savevm: fix savevm after migration

2017-03-29 Thread Denis V. Lunev
On 03/28/2017 01:55 PM, Dr. David Alan Gilbert wrote: > * Kevin Wolf (kw...@redhat.com) wrote: >> Am 25.02.2017 um 20:31 hat Vladimir Sementsov-Ogievskiy geschrieben: >>> After migration all drives are inactive and savevm will fail with >>> >>> qemu-kvm: block/io.c:1406: bdrv_co_do_pwritev: >>>