Re: [Qemu-block] [Qemu-devel] [PATCH] fdc: remove sparc sun4m mutations

2015-03-16 Thread Hervé Poussineau
Hi, Le 16/03/2015 22:48, John Snow a écrit : On 03/14/2015 12:50 PM, Hervé Poussineau wrote: They were introduced in 6f7e9aec5eb5bdfa57a9e458e391b785c283a007 and 82407d1a4035e5bfefb53ffdcb270872f813b34c and lots of bug fixes were done after that. This fixes (at least) the detection of the flo

Re: [Qemu-block] [Qemu-devel] [PATCH] fdc: remove sparc sun4m mutations

2015-03-16 Thread John Snow
On 03/14/2015 12:50 PM, Hervé Poussineau wrote: They were introduced in 6f7e9aec5eb5bdfa57a9e458e391b785c283a007 and 82407d1a4035e5bfefb53ffdcb270872f813b34c and lots of bug fixes were done after that. This fixes (at least) the detection of the floppy controller on Debian 4.0r9/SPARC, and SS

Re: [Qemu-block] [2.4 PATCH v3 11/19] qmp: add block-dirty-bitmap-clear

2015-03-16 Thread John Snow
On 03/16/2015 04:57 PM, Max Reitz wrote: On 2015-03-13 at 14:30, John Snow wrote: Add bdrv_clear_dirty_bitmap and a matching QMP command, qmp_block_dirty_bitmap_clear that enables a user to reset the bitmap attached to a drive. This allows us to reset a bitmap in the event of a full drive bac

Re: [Qemu-block] [2.4 PATCH v3 11/19] qmp: add block-dirty-bitmap-clear

2015-03-16 Thread Max Reitz
On 2015-03-13 at 14:30, John Snow wrote: Add bdrv_clear_dirty_bitmap and a matching QMP command, qmp_block_dirty_bitmap_clear that enables a user to reset the bitmap attached to a drive. This allows us to reset a bitmap in the event of a full drive backup. Signed-off-by: John Snow --- block.

Re: [Qemu-block] [2.4 PATCH v3 12/19] qmp: Add dirty bitmap status field in query-block

2015-03-16 Thread Max Reitz
On 2015-03-13 at 14:30, John Snow wrote: Add the "frozen" status booleans, to inform clients when a bitmap is occupied doing a task. Signed-off-by: Fam Zheng Signed-off-by: John Snow --- block.c | 1 + qapi/block-core.json | 5 - 2 files changed, 5 insertions(+), 1 deletio

Re: [Qemu-block] [Qemu-devel] [2.4 PATCH v3 04/19] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove

2015-03-16 Thread Max Reitz
On 2015-03-16 at 16:53, John Snow wrote: On 03/16/2015 04:44 PM, Max Reitz wrote: On 2015-03-13 at 14:30, John Snow wrote: The new command pair is added to manage a user created dirty bitmap. The dirty bitmap's name is mandatory and must be unique for the same device, but different devices

Re: [Qemu-block] [2.4 PATCH v3 07/19] hbitmap: add hbitmap_merge

2015-03-16 Thread Max Reitz
On 2015-03-13 at 14:30, John Snow wrote: We add a bitmap merge operation to assist in error cases where we wish to combine two bitmaps together. This is algorithmically O(bits) provided HBITMAP_LEVELS remains constant. For a full bitmap on a 64bit machine: sum(bits/64^k, k, 0, HBITMAP_LEVELS) ~=

Re: [Qemu-block] [2.4 PATCH v3 06/19] hbitmap: cache array lengths

2015-03-16 Thread Max Reitz
On 2015-03-13 at 14:30, John Snow wrote: As a convenience: between incremental backups, bitmap migrations and bitmap persistence we seem to need to recalculate these a lot. Because the lengths are a little bit-twiddly, let's just solidly cache them and be done with it. Signed-off-by: John Snow

Re: [Qemu-block] [Qemu-devel] [2.4 PATCH v3 04/19] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove

2015-03-16 Thread John Snow
On 03/16/2015 04:44 PM, Max Reitz wrote: On 2015-03-13 at 14:30, John Snow wrote: The new command pair is added to manage a user created dirty bitmap. The dirty bitmap's name is mandatory and must be unique for the same device, but different devices can have bitmaps with the same names. The g

Re: [Qemu-block] [2.4 PATCH v3 04/19] qmp: Add block-dirty-bitmap-add and block-dirty-bitmap-remove

2015-03-16 Thread Max Reitz
On 2015-03-13 at 14:30, John Snow wrote: The new command pair is added to manage a user created dirty bitmap. The dirty bitmap's name is mandatory and must be unique for the same device, but different devices can have bitmaps with the same names. The granularity is an optional field. If it is no

Re: [Qemu-block] [2.4 PATCH v3 01/19] docs: incremental backup documentation

2015-03-16 Thread Max Reitz
On 2015-03-13 at 14:30, John Snow wrote: Signed-off-by: John Snow --- docs/bitmaps.md | 311 1 file changed, 311 insertions(+) create mode 100644 docs/bitmaps.md Reviewed-by: Max Reitz

[Qemu-block] [PULL 15/17] block/vpc: make calculate_geometry spec conform

2015-03-16 Thread Kevin Wolf
From: Peter Lieven The VHD spec [1] allows for total_sectors of 65535 x 16 x 255 (~127GB) represented by a CHS geometry. If total_sectors is greater than 65535 x 16 x 255 this geometry is set as a maximum. Qemu, Hyper-V and disk2vhd use this special geometry as an indicator to use the image curr

[Qemu-block] [PULL 14/17] vpc: Ignore geometry for large images

2015-03-16 Thread Kevin Wolf
The CHS calculation as done per the VHD spec imposes a maximum image size of ~127 GB. Real VHD images exist that are larger than that. Apparently there are two separate non-standard ways to achieve this: You could use more heads than the spec does - this is the option that qemu-img create chooses.

[Qemu-block] [PULL 11/17] blockdev: Convert bdrv_find to blk_by_name

2015-03-16 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Message-id: 1425296209-1476-4-git-send-email-f...@redhat.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- blockdev.c | 92 -- 1 file changed, 59 insertions(+), 33 deletions(-) diff --g

[Qemu-block] [PULL 13/17] block/vpc: optimize vpc_co_get_block_status

2015-03-16 Thread Kevin Wolf
From: Peter Lieven *pnum can't be greater than s->block_size / BDRV_SECTOR_SIZE for allocated sectors since there is always a bitmap in between. Signed-off-by: Peter Lieven Reviewed-by: Max Reitz Message-id: 1425379316-19639-2-git-send-email...@kamp.de Signed-off-by: Max Reitz --- block/vpc.

[Qemu-block] [PULL 09/17] monitor: Convert bdrv_find to blk_by_name

2015-03-16 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Message-id: 1425296209-1476-2-git-send-email-f...@redhat.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- monitor.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/monitor.c b/monitor.c index c86a89e..8b703f9 100644

[Qemu-block] [PULL 06/17] qcow2: Respect new_block in alloc_refcount_block()

2015-03-16 Thread Kevin Wolf
From: Max Reitz When choosing a new place for the refcount table, alloc_refcount_block() tries to infer the number of clusters used so far from its argument cluster_index (which comes from the idea that if any cluster with an index greater than cluster_index was in use, the refcount table would h

[Qemu-block] [PULL 12/17] block: Drop bdrv_find

2015-03-16 Thread Kevin Wolf
From: Fam Zheng All callers are converted, so drop it. Signed-off-by: Fam Zheng Message-id: 1425296209-1476-5-git-send-email-f...@redhat.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- block.c | 9 - include/block/block.h | 1 - 2 files changed, 10 deletions(-)

[Qemu-block] [PULL 17/17] block/vpc: remove disabled code from get_sector_offset

2015-03-16 Thread Kevin Wolf
From: Peter Lieven The code to check the bitmap for the allocation status of each sector has been "disabled by reason" ever since the vpc driver existed. The reason might be that we might end up reading sector by sector in vpc_read if we really used it. This would be a performance desaster. The

[Qemu-block] [PULL 10/17] migration: Convert bdrv_find to blk_by_name

2015-03-16 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Message-id: 1425296209-1476-3-git-send-email-f...@redhat.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- migration/block.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/block.c b/migration/block.c index 0c

[Qemu-block] [PULL 08/17] iotests: Test non-self-referential qcow2 refblocks

2015-03-16 Thread Kevin Wolf
From: Max Reitz It is easy to create only self-referential refblocks, but there are cases where that is impossible. This adds a test for two of those cases (combined in a single test case). Suggested-by: Eric Blake Signed-off-by: Max Reitz Message-id: 1417798412-15330-1-git-send-email-mre...@r

[Qemu-block] [PULL 07/17] iotests: Add tests for refcount table growth

2015-03-16 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Message-id: 1423598552-24301-3-git-send-email-mre...@redhat.com Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Max Reitz --- tests/qemu-iotests/121 | 102 + tests/qemu-iotests/121.out |

[Qemu-block] [PULL 05/17] qemu-img: Avoid qerror_report_err() outside QMP handlers, again

2015-03-16 Thread Kevin Wolf
From: Markus Armbruster qerror_report_err() is a transitional interface to help with converting existing monitor commands to QMP. It should not be used elsewhere. Replace by error_report_err(). Commit 6936f29 cleaned that up in qemu-img.c, but two calls have crept in since. Take care of them

[Qemu-block] [PULL 16/17] block/vpc: rename footer->size -> footer->current_size

2015-03-16 Thread Kevin Wolf
From: Peter Lieven the field is named current size in the spec. Name it accordingly. Signed-off-by: Peter Lieven Reviewed-by: Max Reitz Message-id: 1425379316-19639-5-git-send-email...@kamp.de Signed-off-by: Max Reitz --- block/vpc.c | 9 + 1 file changed, 5 insertions(+), 4 deletion

[Qemu-block] [PULL 01/17] iotests: Update 051's reference output

2015-03-16 Thread Kevin Wolf
From: Markus Armbruster Commit c4bacaf improved error reporting, but neglected to update 051.out. Commit 2726958 tried to redress, but didn't get it quite right (punctuation difference), and shortly after commit ae071cc..master improved error reporting some more, neglecting 051.out some more. S

[Qemu-block] [PULL 03/17] block: Deprecate QCOW/QCOW2 encryption

2015-03-16 Thread Kevin Wolf
From: Markus Armbruster We've steered users away from QCOW/QCOW2 encryption for a while, because it's a flawed design (commit 136cd19 Describe flaws in qcow/qcow2 encryption in the docs). In addition to flawed crypto, we have comically bad usability, and plain old bugs. Let me show you. = Exam

[Qemu-block] [PULL 02/17] qemu-img: Fix convert, amend error messages for unknown options

2015-03-16 Thread Kevin Wolf
From: Markus Armbruster Message quality regressed in commit dc523cd. Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- qemu-img.c | 6 ++ tests/qemu-iotests/061.out | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/qemu-img.c b/qemu-img.c i

[Qemu-block] [PULL 04/17] block: Fix block-set-write-threshold not to use funky error class

2015-03-16 Thread Kevin Wolf
From: Markus Armbruster Error classes are a leftover from the days of "rich" error objects. New code should always use ERROR_CLASS_GENERIC_ERROR. Commit e246211 added a use of ERROR_CLASS_DEVICE_NOT_FOUND. Replace it. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Ke

[Qemu-block] [PULL 00/17] Block patches for 2.3.0-rc0

2015-03-16 Thread Kevin Wolf
The following changes since commit dcf848c478dd8765bd4f746fc4e80eaad44cf87d: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20150316' into staging (2015-03-16 13:56:10 +) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/fo

Re: [Qemu-block] CDROM Eject behaviour

2015-03-16 Thread John Snow
On 03/16/2015 10:08 AM, Max Reitz wrote: On 2015-03-13 at 07:09, Kevin Wolf wrote: Am 13.03.2015 um 11:46 hat Peter Lieven geschrieben: Hi, I just stumbled across an old ticket where a user complains that an ejected CD is visible again after a reset. It seems that the behaviour of qemu chang

Re: [Qemu-block] [PATCH] qemu-img: Avoid qerror_report_err() outside QMP handlers, again

2015-03-16 Thread Kevin Wolf
Am 12.03.2015 um 16:08 hat Markus Armbruster geschrieben: > qerror_report_err() is a transitional interface to help with > converting existing monitor commands to QMP. It should not be used > elsewhere. Replace by error_report_err(). > > Commit 6936f29 cleaned that up in qemu-img.c, but two call

Re: [Qemu-block] [PATCH] block: Fix block-set-write-threshold not to use funky error class

2015-03-16 Thread Kevin Wolf
Am 13.03.2015 um 18:51 hat Markus Armbruster geschrieben: > Error classes are a leftover from the days of "rich" error objects. > New code should always use ERROR_CLASS_GENERIC_ERROR. Commit e246211 > added a use of ERROR_CLASS_DEVICE_NOT_FOUND. Replace it. > > Signed-off-by: Markus Armbruster

Re: [Qemu-block] [PATCH 20/25] block/nbd: Comment on discard/flush silently failing

2015-03-16 Thread Max Reitz
On 2015-03-16 at 10:51, Paolo Bonzini wrote: On 16/03/2015 15:49, Max Reitz wrote: Right, but a better model than block.c should be for example block/raw-posix.c, which returns ENOTSUP (I checked now...). Maybe we should catch ENOTSUP in bdrv_co_discard() and override it? That's what it does:

Re: [Qemu-block] [PATCH 05/25] nbd: Avoid generic -EINVAL

2015-03-16 Thread Paolo Bonzini
On 16/03/2015 15:48, Max Reitz wrote: > On 2015-03-16 at 10:42, Paolo Bonzini wrote: >> >> On 16/03/2015 14:51, Max Reitz wrote: Propagating the return value from write_sync is uglier, but it is even better in terms of returned value. >>> We can only return -errno values, but write_sync

Re: [Qemu-block] [PATCH 20/25] block/nbd: Comment on discard/flush silently failing

2015-03-16 Thread Paolo Bonzini
On 16/03/2015 15:49, Max Reitz wrote: >>> >> Right, but a better model than block.c should be for example >> block/raw-posix.c, which returns ENOTSUP (I checked now...). > > Maybe we should catch ENOTSUP in bdrv_co_discard() and override it? That's what it does: if (ret && ret != -ENOT

Re: [Qemu-block] [PATCH 20/25] block/nbd: Comment on discard/flush silently failing

2015-03-16 Thread Max Reitz
On 2015-03-16 at 10:44, Paolo Bonzini wrote: On 16/03/2015 14:58, Max Reitz wrote: diff --git a/block/nbd-client.c b/block/nbd-client.c index be6803d..ab13607 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -315,6 +315,7 @@ int nbd_client_co_flush(BlockDriverState *bs) ssize_

Re: [Qemu-block] [PATCH 05/25] nbd: Avoid generic -EINVAL

2015-03-16 Thread Max Reitz
On 2015-03-16 at 10:42, Paolo Bonzini wrote: On 16/03/2015 14:51, Max Reitz wrote: Propagating the return value from write_sync is uglier, but it is even better in terms of returned value. We can only return -errno values, but write_sync() may do partial writes so it may return non-negative va

Re: [Qemu-block] [PATCH 20/25] block/nbd: Comment on discard/flush silently failing

2015-03-16 Thread Paolo Bonzini
On 16/03/2015 14:58, Max Reitz wrote: >>> >>> diff --git a/block/nbd-client.c b/block/nbd-client.c >>> index be6803d..ab13607 100644 >>> --- a/block/nbd-client.c >>> +++ b/block/nbd-client.c >>> @@ -315,6 +315,7 @@ int nbd_client_co_flush(BlockDriverState *bs) >>> ssize_t ret; >>> i

Re: [Qemu-block] [PATCH 05/25] nbd: Avoid generic -EINVAL

2015-03-16 Thread Paolo Bonzini
On 16/03/2015 14:51, Max Reitz wrote: >>> >> Propagating the return value from write_sync is uglier, but it is even >> better in terms of returned value. > > We can only return -errno values, but write_sync() may do partial writes > so it may return non-negative values which still indicate an er

Re: [Qemu-block] CDROM Eject behaviour

2015-03-16 Thread Max Reitz
On 2015-03-13 at 07:09, Kevin Wolf wrote: Am 13.03.2015 um 11:46 hat Peter Lieven geschrieben: Hi, I just stumbled across an old ticket where a user complains that an ejected CD is visible again after a reset. It seems that the behaviour of qemu changed somewhen in the past (maybe years ago).

Re: [Qemu-block] [PATCH 20/25] block/nbd: Comment on discard/flush silently failing

2015-03-16 Thread Max Reitz
On 2015-03-11 at 07:31, Paolo Bonzini wrote: On 25/02/2015 19:08, Max Reitz wrote: If some operation cannot be performed by a block driver, it is normally supposed to return an error. In these cases, however, it is fine to pretend the operations were carried out successfully because if the NBD

Re: [Qemu-block] [PATCH 07/25] nbd: Add "failed to open export" error message

2015-03-16 Thread Max Reitz
On 2015-03-11 at 07:24, Paolo Bonzini wrote: On 25/02/2015 19:08, Max Reitz wrote: In case the connection is closed before the export length can be read, and an export name had been specified, this generally indicates that for some reason the export could not be opened (e.g. there is no export

Re: [Qemu-block] [PATCH 11/25] qemu-nbd: Fix and improve input verification

2015-03-16 Thread Max Reitz
On 2015-03-11 at 07:30, Paolo Bonzini wrote: On 25/02/2015 19:08, Max Reitz wrote: This patch makes sure the result of strtol() does not overflow (by storing it in long integers instead of plain integers, and by checking errno), allows the user to specify "--discard on" and "--detect-zeroes unm

Re: [Qemu-block] [PATCH 05/25] nbd: Avoid generic -EINVAL

2015-03-16 Thread Max Reitz
On 2015-03-11 at 07:22, Paolo Bonzini wrote: On 25/02/2015 19:08, Max Reitz wrote: Just returning -EINVAL for everything is bad. -EIO is often better, and sometimes there is an even more fitting value. Propagating the return value from write_sync is uglier, but it is even better in terms of re

Re: [Qemu-block] [PATCH] block: Deprecate QCOW/QCOW2 encryption

2015-03-16 Thread Kevin Wolf
Am 13.03.2015 um 21:09 hat Markus Armbruster geschrieben: > We've steered users away from QCOW/QCOW2 encryption for a while, > because it's a flawed design (commit 136cd19 Describe flaws in > qcow/qcow2 encryption in the docs). > > In addition to flawed crypto, we have comically bad usability, and

Re: [Qemu-block] [PATCH 0/2] Unbreak qemu-img error messages and iotests

2015-03-16 Thread Kevin Wolf
Am 14.03.2015 um 10:23 hat Markus Armbruster geschrieben: > "check -T -qcow2" now passes again. Sorry for the mess I made. > > Markus Armbruster (2): > iotests: Update 051's reference output > qemu-img: Fix convert, amend error messages for unknown options Thanks, applied to the block branch

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Deprecate QCOW/QCOW2 encryption

2015-03-16 Thread Daniel P. Berrange
On Fri, Mar 13, 2015 at 09:09:40PM +0100, Markus Armbruster wrote: > We've steered users away from QCOW/QCOW2 encryption for a while, > because it's a flawed design (commit 136cd19 Describe flaws in > qcow/qcow2 encryption in the docs). > > In addition to flawed crypto, we have comically bad usabi