[PULL 02/51] iotests/229: Use blkdebug to inject an error

2020-05-15 Thread Kevin Wolf
229 relies on the mirror running into an I/O error when the target is smaller than the source. After changing mirror to catch this condition while starting the job, this test case won't get a job that is paused for an I/O error any more. Use blkdebug instead to inject an error. Signed-off-by:

[PULL 01/51] iotests/109: Don't mirror with mismatched size

2020-05-15 Thread Kevin Wolf
This patch makes the raw image the same size as the file in a different format that is mirrored as raw to it to avoid errors when mirror starts to enforce that source and target are the same size. We check only that the first 512 bytes are zeroed (instead of 64k) because some image formats create

[PULL 03/51] mirror: Make sure that source and target size match

2020-05-15 Thread Kevin Wolf
If the target is shorter than the source, mirror would copy data until it reaches the end of the target and then fail with an I/O error when trying to write past the end. If the target is longer than the source, the mirror job would complete successfully, but the target wouldn't actually be an

[PULL 00/51] Block layer patches

2020-05-15 Thread Kevin Wolf
The following changes since commit 013a18edbbc59cdad019100c7d03c0494642b74c: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200514' into staging (2020-05-14 16:17:55 +0100) are available in the Git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for

[PULL 29/51] block: Pull out bdrv_default_perms_for_storage()

2020-05-15 Thread Kevin Wolf
From: Max Reitz Right now, bdrv_format_default_perms() is used by format parents (generally). We want to switch to a model where most parents use a single BdrvChildClass, which then decides the permissions based on the child role. To do so, we have to split bdrv_format_default_perms() into

[PULL 25/51] block: Unify bdrv_child_cb_detach()

2020-05-15 Thread Kevin Wolf
From: Max Reitz Make bdrv_child_cb_detach() call bdrv_backing_detach() for children with a COW role (and drop the reverse call from bdrv_backing_detach()), so it can be used for any child (with a proper role set). Because so far no child has a proper role set, we need a temporary new callback

[PULL 21/51] block: Rename bdrv_inherited_options()

2020-05-15 Thread Kevin Wolf
From: Max Reitz The other two .inherit_options implementations specify exactly for what case they are used in their name, so do it for this one as well. (The actual intention behind this patch is to follow it up with a generic bdrv_inherited_options() that works for all three cases.)

[PULL 51/51] iotests/030: Reduce run time by unthrottling job earlier

2020-05-15 Thread Kevin Wolf
test_overlapping_3() throttles its active commit job so it can be sure the job is still busy when it checks that you can't start a conflicting streaming job. However, it only sets the commit job back to full speed when it is ready, which takes a few seconds while it's throttled. We can already

[PULL 26/51] block: Add child_of_bds

2020-05-15 Thread Kevin Wolf
From: Max Reitz Any current user of child_file, child_format, and child_backing can and should use this generic BdrvChildClass instead, as it can handle all of these cases. However, to be able to do so, the users must pass the appropriate BdrvChildRole when the child is created/attached. (The

Re: [PULL 00/51] Block layer patches

2020-05-15 Thread Peter Maydell
On Fri, 15 May 2020 at 13:45, Kevin Wolf wrote: > > The following changes since commit 013a18edbbc59cdad019100c7d03c0494642b74c: > > Merge remote-tracking branch > 'remotes/pmaydell/tags/pull-target-arm-20200514' into staging (2020-05-14 > 16:17:55 +0100) > > are available in the Git

[PATCH v3 4/7] migration/block-dirty-bitmap: fix bitmaps pre-blockdev migration during mirror job

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
Important thing for bitmap migration is to select destination block node to obtain the migrated bitmap. Prepatch, on source we use bdrv_get_device_or_node_name() to identify the node, and on target we do bdrv_lookup_bs. bdrv_get_device_or_node_name() returns blk name only for direct children of

[PATCH v3 2/7] migration/block-dirty-bitmap: refactor init_dirty_bitmap_migration

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
Split out handling one bs, it is needed for the following commit, which will handle BlockBackends separately. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- migration/block-dirty-bitmap.c | 89 +++--- 1 file changed, 49 insertions(+), 40

[PULL 35/51] block: Make backing files child_of_bds children

2020-05-15 Thread Kevin Wolf
From: Max Reitz Make all parents of backing files pass the appropriate BdrvChildRole. By doing so, we can switch their BdrvChildClass over to the generic child_of_bds, which will do the right thing when given a correct BdrvChildRole. Signed-off-by: Max Reitz Message-Id:

[PULL 20/51] block: Pass parent_is_format to .inherit_options()

2020-05-15 Thread Kevin Wolf
From: Max Reitz We plan to unify the generic .inherit_options() functions. The resulting common function will need to decide whether to force-enable format probing, force-disable it, or leave it as-is. To make this decision, it will need to know whether the parent node is a format node or not

[PULL 41/51] block: Use bdrv_default_perms()

2020-05-15 Thread Kevin Wolf
From: Max Reitz bdrv_default_perms() can decide which permission profile to use based on the BdrvChildRole, so block drivers do not need to select it explicitly. The blkverify driver now no longer shares the WRITE permission for the image to verify. We thus have to adjust two places in

[PULL 37/51] block: Make format drivers use child_of_bds

2020-05-15 Thread Kevin Wolf
From: Max Reitz Commonly, they need to pass the BDRV_CHILD_IMAGE set as the BdrvChildRole; but there are exceptions for drivers with external data files (qcow2 and vmdk). Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-Id: <20200513110544.176672-26-mre...@redhat.com> Signed-off-by:

[PULL 49/51] iotests: log messages from notrun()

2020-05-15 Thread Kevin Wolf
From: John Snow Shift the logging initialization up to occur prior to validation checks, so that notrun() messages still get printed to console. (Also, remove the "debugging messages active" message, because we don't need to see that hundreds of times per iotest suite run.) Signed-off-by: John

[PULL 11/51] replication: Avoid blk_make_empty() on read-only child

2020-05-15 Thread Kevin Wolf
This is just a bandaid to keep tests/test-replication working after bdrv_make_empty() starts to assert that we're not trying to call it on a read-only child. For the real solution in the future, replication should not steal the BdrvChild from its backing file (this is never correct to do!), but

[PULL 30/51] block: Relax *perms_for_storage for data children

2020-05-15 Thread Kevin Wolf
From: Max Reitz We can be less restrictive about pure data children than those with metadata on them, so let bdrv_default_perms_for_storage() handle metadata children differently from pure data children. As explained in the code, the restrictions on metadata children are strictly stricter than

[PULL 31/51] block: Add bdrv_default_perms()

2020-05-15 Thread Kevin Wolf
From: Max Reitz This callback can be used by BDSs that use child_of_bds with the appropriate BdrvChildRole for their children. Also, make bdrv_format_default_perms() use it for child_of_bds children (just a temporary solution until we can drop bdrv_format_default_perms() altogether).

[PULL 27/51] block: Distinguish paths in *_format_default_perms

2020-05-15 Thread Kevin Wolf
From: Max Reitz bdrv_format_default_perms() has one code path for backing files, and one for storage files. We want to pull them out into their own functions, so make sure they are completely distinct before so the next patches will be a bit cleaner. Signed-off-by: Max Reitz Reviewed-by: Eric

[PULL 07/51] iotests: Run pylint and mypy in a testcase

2020-05-15 Thread Kevin Wolf
We made sure that iotests.py passes pylint. It would be a shame if we allowed new patches in that break this again, so let's just add a meta-test case that runs pylint on it. While we don't pass mypy --strict yet, we can already run it with a few options that would be part of --strict to make

[PULL 12/51] block: Use bdrv_make_empty() where possible

2020-05-15 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Message-Id: <20200429141126.85159-3-mre...@redhat.com> Signed-off-by: Kevin Wolf --- block/replication.c | 3 +-- block/vvfat.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff

[PULL 13/51] block: Mark commit, mirror, blkreplay as filters

2020-05-15 Thread Kevin Wolf
From: Max Reitz The commit, mirror, and blkreplay block nodes are filters, so they should be marked as such. Signed-off-by: Max Reitz Message-Id: <20200513110544.176672-2-mre...@redhat.com> Signed-off-by: Kevin Wolf --- block/blkreplay.c | 1 + block/commit.c| 2 ++ block/mirror.c| 2

[PULL 14/51] block: Add BlockDriver.is_format

2020-05-15 Thread Kevin Wolf
From: Max Reitz We want to unify child_format and child_file at some point. One of the important things that set format drivers apart from other drivers is that they do not expect other format nodes under them (except in the backing chain), i.e. we must not probe formats inside of formats.

[PULL 10/51] block: Use blk_make_empty() after commits

2020-05-15 Thread Kevin Wolf
From: Max Reitz bdrv_commit() already has a BlockBackend pointing to the BDS that we want to empty, it just has the wrong permissions. qemu-img commit has no BlockBackend pointing to the old backing file yet, but introducing one is simple. After this commit, bdrv_make_empty() is the only

[PULL 32/51] raw-format: Split raw_read_options()

2020-05-15 Thread Kevin Wolf
From: Max Reitz Split raw_read_options() into one function that actually just reads the options, and another that applies them. This will allow us to detect whether the user has specified any options before attaching the file child (so we can decide on its role based on the options).

[PULL 28/51] block: Pull out bdrv_default_perms_for_cow()

2020-05-15 Thread Kevin Wolf
From: Max Reitz Right now, bdrv_format_default_perms() is used by format parents (generally). We want to switch to a model where most parents use a single BdrvChildClass, which then decides the permissions based on the child role. To do so, we have to split bdrv_format_default_perms() into

[PATCH v3 1/7] block: Mark commit, mirror, blkreplay as filters

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
From: Max Reitz The commit, mirror, and blkreplay block nodes are filters, so they should be marked as such. Signed-off-by: Max Reitz --- block/blkreplay.c | 1 + block/commit.c| 2 ++ block/mirror.c| 2 ++ 3 files changed, 5 insertions(+) diff --git a/block/blkreplay.c

[PATCH v3 0/7] fix migration with bitmaps and mirror

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
v3: 01: updated, just taken from Kevin's block-tree 02: fix grammar, add Eric's r-b 03: add Eric's and Andrey's r-bs (Andrey's one comes from downstrem) 04: update commit message a bit 06-07: new Max Reitz (1): block: Mark commit, mirror, blkreplay as filters Vladimir Sementsov-Ogievskiy (6):

[PATCH v3 7/7] migration/block-dirty-bitmap: forbid migration by generated node-name

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
It actually never worked with libvirt, as auto-generated names are different on source and destination. It's unsafe and useless to migrate by auto-generated node-names, so let's forbid it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich ---

[PULL 09/51] block: Add blk_make_empty()

2020-05-15 Thread Kevin Wolf
From: Max Reitz Two callers of BlockDriver.bdrv_make_empty() remain that should not call this method directly. Both do not have access to a BdrvChild, but they can use a BlockBackend, so we add this function that lets them use it. Signed-off-by: Max Reitz Message-Id:

[PULL 47/51] block/block-copy: Fix uninitialized variable in block_copy_task_entry

2020-05-15 Thread Kevin Wolf
From: Philippe Mathieu-Daudé Fix when building with -Os: CC block/block-copy.o block/block-copy.c: In function ‘block_copy_task_entry’: block/block-copy.c:428:38: error: ‘error_is_read’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 428 |

[PULL 46/51] block: Drop @child_class from bdrv_child_perm()

2020-05-15 Thread Kevin Wolf
From: Max Reitz Implementations should decide the necessary permissions based on @role. Signed-off-by: Max Reitz Message-Id: <20200513110544.176672-35-mre...@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- include/block/block_int.h | 4 +--- block.c

[PULL 45/51] block: Pass BdrvChildRole in remaining cases

2020-05-15 Thread Kevin Wolf
From: Max Reitz These calls have no real use for the child role yet, but it will not harm to give one. Notably, the bdrv_root_attach_child() call in blockjob.c is left unmodified because there is not much the generic BlockJob object wants from its children. Signed-off-by: Max Reitz

[PULL 40/51] tests: Use child_of_bds instead of child_file

2020-05-15 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-Id: <20200513110544.176672-29-mre...@redhat.com> Signed-off-by: Kevin Wolf --- tests/test-bdrv-drain.c | 29 + tests/test-bdrv-graph-mod.c | 6 -- 2 files changed, 21 insertions(+),

[PULL 24/51] block: Unify bdrv_child_cb_attach()

2020-05-15 Thread Kevin Wolf
From: Max Reitz Make bdrv_child_cb_attach() call bdrv_backing_attach() for children with a COW role (and drop the reverse call from bdrv_backing_attach()), so it can be used for any child (with a proper role set). Because so far no child has a proper role set, we need a temporary new callback

[PULL 44/51] block: Drop child_file

2020-05-15 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Message-Id: <20200513110544.176672-33-mre...@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- include/block/block_int.h | 1 - block.c | 39 ++- tests/test-bdrv-drain.c | 8

Re: [PATCH 3/5] block/nbd.c: Add yank feature

2020-05-15 Thread Lukas Straub
On Fri, 15 May 2020 11:26:13 +0100 Daniel P. Berrangé wrote: > On Fri, May 15, 2020 at 12:14:47PM +0200, Lukas Straub wrote: > > On Fri, 15 May 2020 11:04:13 +0100 > > Daniel P. Berrangé wrote: > > > > > On Fri, May 15, 2020 at 11:48:18AM +0200, Lukas Straub wrote: > > > > On Tue, 12 May

[PATCH v3 5/7] iotests: 194: test also migration of dirty bitmap

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
Test that dirty bitmap migration works when we deal with mirror. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/194 | 14 ++ tests/qemu-iotests/194.out | 6 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/194

[PATCH v3 3/7] block/dirty-bitmap: add bdrv_has_named_bitmaps helper

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
To be used for bitmap migration in further commit. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich Reviewed-by: Eric Blake --- include/block/dirty-bitmap.h | 1 + block/dirty-bitmap.c | 13 + 2 files changed, 14 insertions(+) diff --git

[PATCH v3 6/7] migration/block-dirty-bitmap: add_bitmaps_to_list: check disk name once

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Andrey Shinkevich --- migration/block-dirty-bitmap.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 5d3a7d2b07..e0e081ce60

[PULL 18/51] block: Pass BdrvChildRole to bdrv_child_perm()

2020-05-15 Thread Kevin Wolf
From: Max Reitz For now, all callers pass 0 and no callee evaluates this value. Later patches will change both. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-Id: <20200513110544.176672-7-mre...@redhat.com> Signed-off-by: Kevin Wolf --- include/block/block_int.h | 5 -

Re: [PATCH 3/5] block/nbd.c: Add yank feature

2020-05-15 Thread Daniel P . Berrangé
On Fri, May 15, 2020 at 03:03:30PM +0200, Lukas Straub wrote: > On Fri, 15 May 2020 11:26:13 +0100 > Daniel P. Berrangé wrote: > > > On Fri, May 15, 2020 at 12:14:47PM +0200, Lukas Straub wrote: > > > On Fri, 15 May 2020 11:04:13 +0100 > > > Daniel P. Berrangé wrote: > > > > > > > On Fri,

[PATCH] replication: Avoid blk_make_empty() on read-only child

2020-05-15 Thread Kevin Wolf
This is just a bandaid to keep tests/test-replication working after bdrv_make_empty() starts to assert that we're not trying to call it on a read-only child. For the real solution in the future, replication should not steal the BdrvChild from its backing file (this is never correct to do!), but

Re: [PATCH] replication: Avoid blk_make_empty() on read-only child

2020-05-15 Thread Kevin Wolf
Am 15.05.2020 um 14:03 hat Kevin Wolf geschrieben: > This is just a bandaid to keep tests/test-replication working after > bdrv_make_empty() starts to assert that we're not trying to call it on a > read-only child. > > For the real solution in the future, replication should not steal the >

[PULL 16/51] block: Add BdrvChildRole and BdrvChildRoleBits

2020-05-15 Thread Kevin Wolf
From: Max Reitz This mask will supplement BdrvChildClass when it comes to what role (or combination of roles) a child takes for its parent. It consists of BdrvChildRoleBits values (which is an enum). Because empty enums are not allowed, let us just start with it filled. Signed-off-by: Max

[PULL 19/51] block: Pass BdrvChildRole to .inherit_options()

2020-05-15 Thread Kevin Wolf
From: Max Reitz For now, all callers (effectively) pass 0 and no callee evaluates thie value. Later patches will change both. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-Id: <20200513110544.176672-8-mre...@redhat.com> Signed-off-by: Kevin Wolf --- include/block/block_int.h |

[PULL 22/51] block: Add generic bdrv_inherited_options()

2020-05-15 Thread Kevin Wolf
From: Max Reitz After the series this patch belongs to, we want to have a common BdrvChildClass that encompasses all of child_file, child_format, and child_backing. Such a single class needs a single .inherit_options() implementation, and this patch introduces it. The next patch will show how

[PULL 23/51] block: Use bdrv_inherited_options()

2020-05-15 Thread Kevin Wolf
From: Max Reitz Let child_file's, child_format's, and child_backing's .inherit_options() implementations fall back to bdrv_inherited_options() to show that it would really work for all of these cases, if only the parents passed the appropriate BdrvChildRole and parent_is_format values. (Also,

[PULL 34/51] block: Drop child_format

2020-05-15 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-Id: <20200513110544.176672-23-mre...@redhat.com> Signed-off-by: Kevin Wolf --- include/block/block_int.h | 1 - block.c | 29 - 2 files changed, 30 deletions(-) diff --git

[PULL 38/51] block: Make filter drivers use child_of_bds

2020-05-15 Thread Kevin Wolf
From: Max Reitz Note that some filters have secondary children, namely blkverify (the image to be verified) and blklogwrites (the log). This patch does not touch those children. Note that for blkverify, the filtered child should not be format-probed. While there is nothing enforcing this here,

[PULL 43/51] block: Drop bdrv_format_default_perms()

2020-05-15 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-Id: <20200513110544.176672-32-mre...@redhat.com> Signed-off-by: Kevin Wolf --- include/block/block_int.h | 11 --- block.c | 19 --- 2 files changed, 30 deletions(-) diff --git

[PULL 33/51] block: Switch child_format users to child_of_bds

2020-05-15 Thread Kevin Wolf
From: Max Reitz Both users (quorum and blkverify) use child_format for not-really-filtered children, so the appropriate BdrvChildRole in both cases is DATA. (Note that this will cause bdrv_inherited_options() to force-allow format probing.) Signed-off-by: Max Reitz Reviewed-by: Eric Blake

[PULL 36/51] block: Drop child_backing

2020-05-15 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Message-Id: <20200513110544.176672-25-mre...@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- include/block/block_int.h | 1 - block.c | 60 ++- 2 files changed, 3 insertions(+),

[PULL 42/51] block: Make bdrv_filter_default_perms() static

2020-05-15 Thread Kevin Wolf
From: Max Reitz Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-Id: <20200513110544.176672-31-mre...@redhat.com> Signed-off-by: Kevin Wolf --- include/block/block_int.h | 10 -- block.c | 17 +++-- 2 files changed, 11 insertions(+), 16

[PULL 39/51] block: Use child_of_bds in remaining places

2020-05-15 Thread Kevin Wolf
From: Max Reitz Replace child_file by child_of_bds in all remaining places (excluding tests). Signed-off-by: Max Reitz Message-Id: <20200513110544.176672-28-mre...@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- block.c | 3 ++- block/backup-top.c | 4 ++--

Re: [PATCH v5 08/15] acpi: move aml builder code for floppy device

2020-05-15 Thread Gerd Hoffmann
> > +#include "hw/i386/pc.h" > > I'd rather not see this target-specific header used in the generic device > model... The culprit seems cmos_get_fd_drive_type(). Is the value really PC > specific? Given that the same value is used in acpi tables probably not really. cmos_get_fd_drive_type()

Re: [PATCH v2 0/5] fix migration with bitmaps and mirror

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
15.05.2020 08:52, Vladimir Sementsov-Ogievskiy wrote: 14.05.2020 21:29, Eric Blake wrote: reviving this thread... On 4/3/20 6:23 AM, Peter Krempa wrote: On Fri, Apr 03, 2020 at 14:02:47 +0300, Vladimir Sementsov-Ogievskiy wrote: 19.12.2019 13:36, Peter Krempa wrote: On Thu, Dec 19, 2019 at

[PULL 04/51] iotests: Mirror with different source/target size

2020-05-15 Thread Kevin Wolf
This tests that the mirror job catches situations where the target node has a different size than the source node. It must also forbid resize operations when the job is already running. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Message-Id: <20200511135825.219437-5-kw...@redhat.com>

[PULL 05/51] block/replication.c: Avoid cancelling the job twice

2020-05-15 Thread Kevin Wolf
From: Lukas Straub If qemu in colo secondary mode is stopped, it crashes because s->backup_job is canceled twice: First with job_cancel_sync_all() in qemu_cleanup() and then in replication_stop(). Fix this by assigning NULL to s->backup_job when the job completes so replication_stop() and

[PULL 08/51] block: Add bdrv_make_empty()

2020-05-15 Thread Kevin Wolf
From: Max Reitz Right now, all users of bdrv_make_empty() call the BlockDriver method directly. That is not only bad style, it is also wrong, unless the caller has a BdrvChild with a WRITE or WRITE_UNCHANGED permission. (WRITE_UNCHANGED suffices, because callers generally use this function to

[PULL 06/51] iotests: Fix incomplete type declarations

2020-05-15 Thread Kevin Wolf
We need to fix only a few places so that iotests.py can pass mypy --disallow-incomplete-defs, which seems to be a desirable option to have enabled in the long run. Signed-off-by: Kevin Wolf Message-Id: <20200511163529.349329-2-kw...@redhat.com> Reviewed-by: Max Reitz Reviewed-by: John Snow

[PULL 15/51] block: Rename BdrvChildRole to BdrvChildClass

2020-05-15 Thread Kevin Wolf
From: Max Reitz This structure nearly only contains parent callbacks for child state changes. It cannot really reflect a child's role, because different roles may overlap (as we will see when real roles are introduced), and because parents can have custom callbacks even when the child fulfills

[PULL 17/51] block: Add BdrvChildRole to BdrvChild

2020-05-15 Thread Kevin Wolf
From: Max Reitz For now, it is always set to 0. Later patches in this series will ensure that all callers pass an appropriate combination of flags. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-Id: <20200513110544.176672-6-mre...@redhat.com> Signed-off-by: Kevin Wolf ---

[PULL 48/51] block/block-copy: Simplify block_copy_do_copy()

2020-05-15 Thread Kevin Wolf
From: Philippe Mathieu-Daudé block_copy_do_copy() is static, only used in block_copy_task_entry with the error_is_read argument set. No need to check for it, simplify. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200507121129.29760-3-phi...@redhat.com> Reviewed-by: Eric Blake

[PULL 50/51] hw/ide/ahci: Log lost IRQs

2020-05-15 Thread Kevin Wolf
From: Philippe Mathieu-Daudé One might find interesting to look at AHCI IRQs. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200504094858.5975-1-f4...@amsat.org> Reviewed-by: John Snow Acked-by: John Snow Signed-off-by: Kevin Wolf --- hw/ide/ahci.c | 1 + 1 file changed, 1

[PATCH v6 10/16] floppy: move cmos_get_fd_drive_type() from pc

2020-05-15 Thread Gerd Hoffmann
--- include/hw/block/fdc.h | 1 + include/hw/i386/pc.h | 1 - hw/block/fdc.c | 26 +- hw/i386/pc.c | 25 - 4 files changed, 26 insertions(+), 27 deletions(-) diff --git a/include/hw/block/fdc.h b/include/hw/block/fdc.h index

[PATCH v6 03/16] acpi: rtc: use a single crs range

2020-05-15 Thread Gerd Hoffmann
Use a single io range for _CRS instead of two, following what real hardware does. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov --- hw/rtc/mc146818rtc.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index

[PATCH v6 05/16] acpi: move aml builder code for serial device

2020-05-15 Thread Gerd Hoffmann
The code uses the isa_serial_io array to figure what the device uid is. Side effect is that acpi antries are not limited to port 1+2 any more, we'll also get entries for ports 3+4. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé ---

[PATCH v6 04/16] acpi: serial: don't use _STA method

2020-05-15 Thread Gerd Hoffmann
The _STA method dates back to the days where we had a static DSDT. The device is listed in the DSDT table unconditionally and the _STA method checks a bit in the isa bridge pci config space to figure whenever a given is isa device is present or not, then evaluates to 0x0f (present) or 0x00

[PATCH v6 01/16] qtest: allow DSDT acpi table changes

2020-05-15 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- tests/qtest/bios-tables-test-allowed-diff.h | 17 + 1 file changed, 17 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8bf4..6a052c50447a 100644 ---

[PATCH v6 11/16] acpi: move aml builder code for i8042 (kbd+mouse) device

2020-05-15 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov --- hw/i386/acpi-build.c | 39 --- hw/input/pckbd.c | 31 +++ 2 files changed, 31 insertions(+), 39 deletions(-) diff --git

Re: [PATCH v2 0/5] fix migration with bitmaps and mirror

2020-05-15 Thread Eric Blake
On 5/15/20 6:15 AM, Vladimir Sementsov-Ogievskiy wrote: Max is trying to tackle the node-name issue: https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg03358.html And trying to apply that patch after staging this series hits a conflict in mnigration/block-dirty-bitmap.c.  Which one

[PATCH v6 13/16] acpi: simplify build_isa_devices_aml()

2020-05-15 Thread Gerd Hoffmann
x86 machines can have a single ISA bus only. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé --- hw/i386/acpi-build.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c

[PATCH v6 07/16] acpi: move aml builder code for parallel device

2020-05-15 Thread Gerd Hoffmann
Also adds support for multiple LPT devices. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé --- hw/char/parallel.c | 22 ++ hw/i386/acpi-build.c | 23 --- 2 files changed, 22 insertions(+), 23 deletions(-)

[PATCH v6 00/16] acpi: i386 tweaks

2020-05-15 Thread Gerd Hoffmann
First batch of microvm patches, some generic acpi stuff. Split the acpi-build.c monster, specifically split the pc and q35 and pci bits into a separate file which we can skip building at some point in the future. v2 changes: leave acpi-build.c largely as-is, move useful bits to other places to

Re: [PATCH v2 5/5] vhost: add device started check in migration set log

2020-05-15 Thread Dima Stepanov
On Thu, May 14, 2020 at 03:34:24PM +0800, Jason Wang wrote: > > On 2020/5/13 下午5:47, Dima Stepanov wrote: > >>> case CHR_EVENT_CLOSED: > >>> /* a close event may happen during a read/write, but vhost > >>> * code assumes the vhost_dev remains setup, so delay the > >>>

Re: [PATCH v2 4/5] sysemu/block-backend: Document blk_read()/blk_pwrite()

2020-05-15 Thread Eric Blake
On 5/15/20 4:19 AM, Philippe Mathieu-Daudé wrote: The blk_read()/blk_pwrite() return value is not obvious, s/read/pread/ here and in the subject document it. Signed-off-by: Philippe Mathieu-Daudé --- +/** + * blk_pread: + * + * @blk: the block backend where the buffer content is going

Re: [RFC v4 6/6] hmp: add x-debug-virtio commands

2020-05-15 Thread Laurent Vivier
On 15/05/2020 17:45, Dr. David Alan Gilbert wrote: > * Laurent Vivier (lviv...@redhat.com) wrote: >> On 13/05/2020 12:51, Dr. David Alan Gilbert wrote: >>> * Laurent Vivier (lviv...@redhat.com) wrote: This patch implements HMP version of the virtio QMP commands Signed-off-by:

Re: [PATCH v6 04/14] block/amend: separate amend and create options for qemu-img

2020-05-15 Thread Eric Blake
On 5/15/20 1:22 AM, Max Reitz wrote: +    QCOW_COMMON_OPTIONS, +    { /* end of list */ } ...the intended usage is to use the macro name followed by a comma, so including a trailing comma in the macro itself would lead to a syntax error. But why is that the indended usage? Is

[PATCH v6 15/16] acpi: drop build_piix4_pm()

2020-05-15 Thread Gerd Hoffmann
The _SB.PCI0.PX13.P13C opregion (holds isa device enable bits) is not used any more, remove it from DSDT. Signed-off-by: Gerd Hoffmann --- hw/i386/acpi-build.c | 16 1 file changed, 16 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index

Re: [RFC v3 4/6] qmp: add QMP command x-debug-virtio-queue-status

2020-05-15 Thread Laurent Vivier
On 08/05/2020 04:57, Jason Wang wrote: > > On 2020/5/7 下午7:49, Laurent Vivier wrote: >> This new command shows internal status of a VirtQueue. >> (vrings and indexes). >> >> Signed-off-by: Laurent Vivier > > > It looks to me that packed virtqueue is not supported. It's better to > add them in

Re: [PATCH v2 0/1] qemu-nbd: Close inherited stderr

2020-05-15 Thread Eric Blake
On 5/15/20 1:36 AM, Raphael Pour wrote: From e5749541494abcdcaa37d752172741e1bc38e984 Mon Sep 17 00:00:00 2001 From: Raphael Pour Date: Fri, 15 May 2020 08:30:50 +0200 Subject: [PATCH] qemu-nbd: Close inherited stderr Close inherited stderr of the parent if fork_process is false. Otherwise no

[PATCH v6 02/16] acpi: move aml builder code for rtc device

2020-05-15 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé --- hw/i386/acpi-build.c | 17 - hw/rtc/mc146818rtc.c | 22 ++ 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/hw/i386/acpi-build.c

[PATCH v6 09/16] floppy: make isa_fdc_get_drive_max_chs static

2020-05-15 Thread Gerd Hoffmann
acpi aml generator needs this, but it is in floppy code now so we can make the function static. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé Acked-by: John Snow --- include/hw/block/fdc.h | 2 -- hw/block/fdc.c | 4 ++-- 2 files changed,

Re: [RFC v4 6/6] hmp: add x-debug-virtio commands

2020-05-15 Thread Laurent Vivier
On 13/05/2020 12:51, Dr. David Alan Gilbert wrote: > * Laurent Vivier (lviv...@redhat.com) wrote: >> This patch implements HMP version of the virtio QMP commands >> >> Signed-off-by: Laurent Vivier > > Reviewed-by: Dr. David Alan Gilbert > > With a thought below > >> --- >> Makefile

[PATCH v6 06/16] acpi: parallel: don't use _STA method

2020-05-15 Thread Gerd Hoffmann
The _STA method dates back to the days where we had a static DSDT. The device is listed in the DSDT table unconditionally and the _STA method checks a bit in the isa bridge pci config space to figure whenever a given is isa device is present or not, then evaluates to 0x0f (present) or 0x00

[PATCH v6 12/16] acpi: factor out fw_cfg_add_acpi_dsdt()

2020-05-15 Thread Gerd Hoffmann
Add helper function to add fw_cfg device, also move code to hw/i386/fw_cfg.c. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov --- hw/i386/fw_cfg.h | 1 + hw/i386/acpi-build.c | 24 +--- hw/i386/fw_cfg.c | 28

[PATCH v6 14/16] acpi: drop serial/parallel enable bits from dsdt

2020-05-15 Thread Gerd Hoffmann
The _STA methods for COM+LPT used to reference them, but that isn't the case any more. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov --- hw/i386/acpi-build.c | 23 --- 1 file changed, 23 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index

[PATCH v6 08/16] acpi: move aml builder code for floppy device

2020-05-15 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov --- hw/block/fdc.c | 83 hw/i386/acpi-build.c | 83 stubs/cmos.c | 7 stubs/Makefile.objs | 1 + 4 files changed, 91

[PATCH v6 16/16] acpi: q35: drop _SB.PCI0.ISA.LPCD opregion.

2020-05-15 Thread Gerd Hoffmann
Seems to be unused. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov --- hw/i386/acpi-build.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index c1e63cce5e8e..1afb47b09ee9 100644 --- a/hw/i386/acpi-build.c +++

Re: [RFC v4 6/6] hmp: add x-debug-virtio commands

2020-05-15 Thread Dr. David Alan Gilbert
* Laurent Vivier (lviv...@redhat.com) wrote: > On 13/05/2020 12:51, Dr. David Alan Gilbert wrote: > > * Laurent Vivier (lviv...@redhat.com) wrote: > >> This patch implements HMP version of the virtio QMP commands > >> > >> Signed-off-by: Laurent Vivier > > > > Reviewed-by: Dr. David Alan Gilbert

Re: [PATCH v2 0/5] fix migration with bitmaps and mirror

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
15.05.2020 20:51, Eric Blake wrote: On 5/15/20 6:15 AM, Vladimir Sementsov-Ogievskiy wrote: Max is trying to tackle the node-name issue: https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg03358.html And trying to apply that patch after staging this series hits a conflict in

[PATCH v4 7/9] iotests: add testrunner.py

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
Add TestRunner class, which will run tests in a new python iotests running framework. There are some differences with current ./check behavior, most significant are: - Consider all tests self-executable, just run them, don't run python by hand. - Elapsed time is cached in json file - Elapsed

[PATCH v4 8/9] iotests: rewrite check into python

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
Just use classes introduced in previous three commits. Behavior difference is described in these three commits. Drop group file, as it becomes unused. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/check | 983 ++-

[PATCH v4 6/9] iotests: add testenv.py

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
Add TestEnv class, which will handle test environment in a new python iotests running framework. Difference with current ./check interface: - -v (verbose) option dropped, as it is unused - -xdiff option is dropped, until somebody complains that it is needed - same for -n option Signed-off-by:

[PATCH v4 2/9] iotests: fix some whitespaces in test output files

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
We are going to be stricter about comparing test result with .out files. So, fix some whitespaces now. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/175.out | 2 +- tests/qemu-iotests/267.out | 48 +++--- tests/qemu-iotests/287.out | 10

[PATCH v4 5/9] iotests: add findtests.py

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
Add python script with new logic of searching for tests: Current ./check behavior: - tests are named [0-9][0-9][0-9] - tests must be registered in group file (even if test doesn't belong to any group, like 142) Behavior of findtests.py: - group file is dropped - tests are all files in

[PATCH v4 9/9] iotests: rename and move 169 and 199 tests

2020-05-15 Thread Vladimir Sementsov-Ogievskiy
Rename bitmaps migration tests and move them to tests subdirectory to demonstrate new human-friendly test naming. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/{199 => tests/migrate-bitmaps-postcopy-test} | 0 .../{199.out => tests/migrate-bitmaps-postcopy-test.out}

  1   2   >