The function will be moved to common QOM code, as it is not
specific to TYPE_DEVICE anymore.
Reviewed-by: Stefan Berger
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Rename to object_field_prop_ptr() instead of object_static_prop_ptr()
---
Cc: Stefan Berger
Cc: Stefano Stabellini
Cc:
Every single qdev property setter function manually checks
dev->realized. We can just check dev->realized inside
qdev_property_set() instead.
The check is being added as a separate function
(qdev_prop_allow_set()) because it will become a callback later.
Reviewed-by: Stefan Berger
Make the code more generic and not specific to TYPE_DEVICE.
Reviewed-by: Marc-André Lureau
Reviewed-by: Cornelia Huck #s390 parts
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
- Fix build error with CONFIG_XEN
I took the liberty of keeping the Reviewed-by line from
Marc-André as the
11.12.2020 20:11, Markus Armbruster wrote:
QString supports modifying its string, but it's quite limited: you can
only append. Just one caller remains:
bdrv_parse_filename_strip_prefix() uses it just for building an
initial string.
Change it to do build the initial string with GString. This
We are generally moving to int64_t for both offset and bytes parameters
on all io paths.
Main motivation is realization of 64-bit write_zeroes operation for
fast zeroing large disk chunks, up to the whole disk.
We chose signed type, to be consistent with off_t (which is signed) and
with
We are generally moving to int64_t for both offset and bytes parameters
on all io paths.
Main motivation is realization of 64-bit write_zeroes operation for
fast zeroing large disk chunks, up to the whole disk.
We chose signed type, to be consistent with off_t (which is signed) and
with
We are generally moving to int64_t for both offset and bytes parameters
on all io paths.
Main motivation is realization of 64-bit write_zeroes operation for
fast zeroing large disk chunks, up to the whole disk.
We chose signed type, to be consistent with off_t (which is signed) and
with
Operations with qiov add more restrictions on bytes, let's cover it.
Signed-off-by: Vladimir Sementsov-Ogievskiy
---
block/io.c | 46 +++---
1 file changed, 39 insertions(+), 7 deletions(-)
diff --git a/block/io.c b/block/io.c
index
We are generally moving to int64_t for both offset and bytes parameters
on all io paths.
Main motivation is realization of 64-bit write_zeroes operation for
fast zeroing large disk chunks, up to the whole disk.
We chose signed type, to be consistent with off_t (which is signed) and
with
We are generally moving to int64_t for both offset and bytes parameters
on all io paths.
Main motivation is realization of 64-bit write_zeroes operation for
fast zeroing large disk chunks, up to the whole disk.
We chose signed type, to be consistent with off_t (which is signed) and
with
We are generally moving to int64_t for both offset and bytes parameters
on all io paths.
Main motivation is realization of 64-bit write_zeroes operation for
fast zeroing large disk chunks, up to the whole disk.
We chose signed type, to be consistent with off_t (which is signed) and
with
Make bdrv_pad_request() honest: return error if
qemu_iovec_init_extended() failed.
Update also bdrv_padding_destroy() to clean the structure for safety.
Signed-off-by: Vladimir Sementsov-Ogievskiy
---
block/io.c | 45 +++--
1 file changed, 31
We are generally moving to int64_t for both offset and bytes parameters
on all io paths.
Main motivation is realization of 64-bit write_zeroes operation for
fast zeroing large disk chunks, up to the whole disk.
We chose signed type, to be consistent with off_t (which is signed) and
with
We are generally moving to int64_t for both offset and bytes parameters
on all io paths.
Main motivation is realization of 64-bit write_zeroes operation for
fast zeroing large disk chunks, up to the whole disk.
We chose signed type, to be consistent with off_t (which is signed) and
with
We are generally moving to int64_t for both offset and bytes parameters
on all io paths.
Main motivation is realization of 64-bit write_zeroes operation for
fast zeroing large disk chunks, up to the whole disk.
We chose signed type, to be consistent with off_t (which is signed) and
with
The function is called from 64bit io handlers, and bytes is just passed
to throttle_account() which is 64bit too (unsigned though). So, let's
convert intermediate argument to 64bit too.
This patch is a first in the 64-bit-blocklayer series, so we are
generally moving to int64_t for both offset
Actually, we can't extend the io vector in all cases. Handle possible
MAX_IOV and size_t overflows.
For now add assertion to callers (actually they rely on success anyway)
and fix them in the following patch.
Add also some additional good assertions to qemu_iovec_init_slice()
while being here.
Calculation of sum may theoretically overflow, so use 64bit type and
add some good assertions.
Use int64_t constantly.
Signed-off-by: Vladimir Sementsov-Ogievskiy
---
block/io.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/block/io.c b/block/io.c
index
Prepare to the following patch when bdrv_pad_request() will be able to
fail. Update the comments.
Signed-off-by: Vladimir Sementsov-Ogievskiy
---
block/io.c | 25 +++--
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/block/io.c b/block/io.c
index
11.12.2020 20:11, Markus Armbruster wrote:
I'm about to remove qobject_get_try_str(). Use qstring_get_str()
instead. Safe because the argument is known to be a QString here.
Cc: Kevin Wolf
Cc: Max Reitz
Cc:qemu-block@nongnu.org
Signed-off-by: Markus Armbruster
Reviewed-by: Vladimir
Hi all!
We want 64bit write-zeroes, and for this, convert all io functions to
64bit.
We chose signed type, to be consistent with off_t (which is signed) and
with possibility for signed return type (where negative value means
error).
Please refer to initial cover-letter
It's better to pass _abort than just assert that result is 0: on
crash, we'll immediately see the reason in the backtrace.
Signed-off-by: Vladimir Sementsov-Ogievskiy
---
include/block/block_int.h| 2 +-
block/file-posix.c | 2 +-
block/io.c | 29
11.12.2020 20:21, Max Reitz wrote:
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
From: Andrey Shinkevich
This patch completes the series with the COR-filter applied to
block-stream operations.
Adding the filter makes it possible in future implement discarding
copied regions in
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
From: Andrey Shinkevich
This patch completes the series with the COR-filter applied to
block-stream operations.
Adding the filter makes it possible in future implement discarding
copied regions in backing files during the block-stream
I'm about to remove qobject_get_try_str(). Use qstring_get_str()
instead. Safe because the argument is known to be a QString here.
Cc: Kevin Wolf
Cc: Max Reitz
Cc: qemu-block@nongnu.org
Signed-off-by: Markus Armbruster
---
block.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
QString supports modifying its string, but it's quite limited: you can
only append. Just one caller remains:
bdrv_parse_filename_strip_prefix() uses it just for building an
initial string.
Change it to do build the initial string with GString. This is
another step towards making QString
On 11.12.20 18:42, Vladimir Sementsov-Ogievskiy wrote:
11.12.2020 20:24, Max Reitz wrote:
On 11.12.20 17:50, Vladimir Sementsov-Ogievskiy wrote:
11.12.2020 19:05, Max Reitz wrote:
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
The code already don't freeze base node and we try to
11.12.2020 20:24, Max Reitz wrote:
On 11.12.20 17:50, Vladimir Sementsov-Ogievskiy wrote:
11.12.2020 19:05, Max Reitz wrote:
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
The code already don't freeze base node and we try to make it prepared
for the situation when base node is
The drain functions assume that we hold the AioContext lock of the
drained block node. Make sure to actually take the lock.
Cc: qemu-sta...@nongnu.org
Fixes: eb94b81a94bce112e6b206df846c1551aaf6cab6
Signed-off-by: Kevin Wolf
Message-Id: <20201203172311.68232-3-kw...@redhat.com>
Reviewed-by:
On 11.12.20 17:50, Vladimir Sementsov-Ogievskiy wrote:
11.12.2020 19:05, Max Reitz wrote:
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
The code already don't freeze base node and we try to make it prepared
for the situation when base node is changed during the operation. In
other
From: Vladimir Sementsov-Ogievskiy
We should not set overlap_bytes:
1. Don't worry: it is calculated by bdrv_mark_request_serialising() and
will be equal to or greater than bytes anyway.
2. If the request was already aligned up to some greater alignment,
than we may break things: we
From: Max Reitz
Signed-off-by: Max Reitz
Message-Id: <20201027190600.192171-18-mre...@redhat.com>
Signed-off-by: Kevin Wolf
---
tests/qemu-iotests/check | 11 +++
tests/qemu-iotests/common.rc | 17 +
2 files changed, 28 insertions(+)
diff --git
From: Li Feng
The scenario is that when accessing a volume on an NFS filesystem
without supporting the file lock, Qemu will complain "Failed to lock
byte 100", even when setting the file.locking = off.
We should do file lock related operations only when the file.locking is
enabled, otherwise,
The only thing that happens after the 'out:' label is blk_unref(blk).
However, blk = NULL in all of the error cases, so instead of jumping to
'out:', we can just return directly.
Cc: qemu-sta...@nongnu.org
Signed-off-by: Kevin Wolf
Message-Id: <20201203172311.68232-2-kw...@redhat.com>
From: Max Reitz
Otherwise, exports and block devices are not properly shut down and
closed, unless the users explicitly issues blockdev-del and
block-export-del commands for each of them.
Signed-off-by: Max Reitz
Reviewed-by: Kevin Wolf
Message-Id: <20201027190600.192171-17-mre...@redhat.com>
If bdrv_co_yield_to_drain() is called for draining a block node that
runs in a different AioContext, it keeps that AioContext locked while it
yields and schedules a BH in the AioContext to do the actual drain.
As long as executing the BH is the very next thing that the event loop
of the node's
From: Vladimir Sementsov-Ogievskiy
This simplifies following commit.
Signed-off-by: Vladimir Sementsov-Ogievskiy
Message-Id: <20201203222713.13507-3-vsement...@virtuozzo.com>
Reviewed-by: Alberto Garcia
Signed-off-by: Kevin Wolf
---
block/io.c | 7 +++
1 file changed, 3 insertions(+), 4
From: Max Reitz
See the new comment for why this should be done.
I do not have a reproducer on master, but when using FUSE block exports,
this test breaks depending on the underlying filesystem (for me, it
works on tmpfs, but fails on xfs, because the block allocated by
file-posix has 16 kB
From: Max Reitz
We have good coverage of the normal I/O paths now, but what remains is a
test that tests some more special cases: Exporting an image on itself
(thus turning a formatted image into a raw one), some error cases, and
non-writable and non-growable exports.
Signed-off-by: Max Reitz
From: Max Reitz
When most iotests want to create a test image that is named differently
from the default $TEST_IMG, they do something like this:
TEST_IMG="$TEST_IMG.base" _make_test_img $options
This works fine with the "file" protocol, but not so much for anything
else: _make_test_img
From: Max Reitz
Avoid creating images with custom filenames in $TEST_DIR, because
non-file protocols may want to keep $TEST_IMG (and all other test
images) in some other directory.
Signed-off-by: Max Reitz
Reviewed-by: Kevin Wolf
Message-Id: <20201027190600.192171-12-mre...@redhat.com>
From: Max Reitz
This generally does not work on non-file protocols. It is better to
create the image with the final name from the start, and most tests do
this already. Let 046 follow suit.
Signed-off-by: Max Reitz
Reviewed-by: Kevin Wolf
Message-Id:
From: Max Reitz
qemu-img convert (without -n) can often be replaced by a combination of
_make_test_img + qemu-img convert -n. Doing so allows converting to
protocols that do not allow direct file creation, such as FUSE exports.
The only problem is that for formats other than qcow2 and qed
Based-on: <20201210161452.2813491-1-arm...@redhat.com>
Cc: Daniel P. Berrangé
Cc: Dr. David Alan Gilbert
Cc: Eduardo Habkost
Cc: Juan Quintela
Cc: Kevin Wolf
Cc: Marcel Apfelbaum
Cc: Max Reitz
Cc: Paolo Bonzini
Cc: Yuval Shaia
Cc: qemu-block@nongnu.org
Markus Armbruster (20):
hmp:
From: Max Reitz
Many tests (that do not support generic protocols) can run just fine
with FUSE-exported images, so allow them to. Note that this is no
attempt at being definitely complete. There are some tests that might
be modified to run on FUSE, but this patch still skips them. This patch
From: Max Reitz
In most cases, _make_test_img does not need a _filter_imgfmt on top. It
does that by itself.
(The exception is when IMGFMT has been overwritten but TEST_IMG has not.
In such cases, we do need a _filter_imgfmt on top to filter the test's
original IMGFMT from TEST_IMG.)
From: Max Reitz
This is a relatively new feature in libfuse (available since 3.8.0,
which was released in November 2019), so we have to add a dedicated
check whether it is available before making use of it.
Signed-off-by: Max Reitz
Message-Id: <20201027190600.192171-7-mre...@redhat.com>
From: Max Reitz
This allows allocating areas after the (old) EOF as part of a growing
resize, writing zeroes, and discarding.
Signed-off-by: Max Reitz
Message-Id: <20201027190600.192171-6-mre...@redhat.com>
Signed-off-by: Kevin Wolf
---
block/export/fuse.c | 84
From: Max Reitz
287 creates an image in a subshell (thanks to the pipe) to see whether
that is possible with compression_type=zstd. If _make_test_img were to
modify any global state, this global state would then be lost before we
could cleanup the image.
When using FUSE as the test protocol,
From: Max Reitz
This pretends FUSE exports are a kind of protocol. As such, they are
always tested under the format node. This is probably the best way to
test them, actually, because this will generate more I/O load and more
varied patterns.
Signed-off-by: Max Reitz
Message-Id:
From: Max Reitz
Signed-off-by: Max Reitz
Message-Id: <20201027190600.192171-2-mre...@redhat.com>
Signed-off-by: Kevin Wolf
---
meson_options.txt | 2 ++
configure | 7 +++
meson.build | 6 ++
3 files changed, 15 insertions(+)
diff --git a/meson_options.txt
From: Vladimir Sementsov-Ogievskiy
Move bdrv_is_inserted() calls into callers.
We are going to make bdrv_check_byte_request() a clean thing.
bdrv_is_inserted() is not about checking the request, it's about
checking the bs. So, it should be separate.
With this patch we probably change error
From: Vladimir Sementsov-Ogievskiy
We are going to modify block layer to work with 64bit requests. And
first step is moving to int64_t type for both offset and bytes
arguments in all block request related functions.
It's mostly safe (when widening signed or unsigned int to int64_t), but
Providing the 'if' property, but not 'canbus' segfaults like this:
#0 0x55b0f14d in can_bus_insert_client (bus=0x0,
client=0x56aa9af0) at ../net/can/can_core.c:88
#1 0x559c3803 in can_host_connect (ch=0x56aa9ac0,
errp=0x7fffd568) at ../net/can/can_host.c:62
#2
From: Max Reitz
If the test environment has some other child processes running (like a
storage daemon that provides a FUSE export), then "wait" will never
finish. Use wait=yes _cleanup_qemu instead.
(We need to discard the output so there is no change to the reference
output.)
Signed-off-by:
From: Gan Qixin
Replace manual lock()/unlock() calls with lock guard macros
(QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/curl.
Signed-off-by: Gan Qixin
Reviewed-by: Paolo Bonzini
Message-Id: <20201203075055.127773-3-ganqi...@huawei.com>
Signed-off-by: Kevin Wolf
---
block/curl.c | 28
From: Max Reitz
These will behave more like normal files in that writes beyond the EOF
will automatically grow the export size.
As an optimization, keep the RESIZE permission for growable exports so
we do not have to take it for every post-EOF write. (This permission is
not released when the
From: Gan Qixin
Replace manual lock()/unlock() calls with lock guard macros
(QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/throttle-groups.
Signed-off-by: Gan Qixin
Message-Id: <20201203075055.127773-4-ganqi...@huawei.com>
Signed-off-by: Kevin Wolf
---
block/throttle-groups.c | 48
From: Gan Qixin
Replace manual lock()/unlock() calls with lock guard macros
(QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/iscsi.
Signed-off-by: Gan Qixin
Message-Id: <20201203075055.127773-5-ganqi...@huawei.com>
Signed-off-by: Kevin Wolf
---
block/iscsi.c | 50
From: Gan Qixin
Replace manual lock()/unlock() calls with lock guard macros
(QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/accounting.
Signed-off-by: Gan Qixin
Reviewed-by: Paolo Bonzini
Message-Id: <20201203075055.127773-2-ganqi...@huawei.com>
Signed-off-by: Kevin Wolf
---
From: Max Reitz
Most Python tests are restricted to the file protocol (without
explicitly saying so), but these are the ones that would break
./check -fuse -qcow2.
Signed-off-by: Max Reitz
Reviewed-by: Kevin Wolf
Message-Id: <20201027190600.192171-14-mre...@redhat.com>
Signed-off-by: Kevin
From: Max Reitz
Executing _make_test_img as part of a pipe will undo all variable
changes it has done. As such, this could not work with FUSE (because
we want to remember all of our exports and their qemu instances).
Replace the pipe by a temporary file in 071 and 174 (the two tests that
can
From: Max Reitz
This makes the export actually useful instead of only producing errors
whenever it is accessed.
Signed-off-by: Max Reitz
Message-Id: <20201027190600.192171-4-mre...@redhat.com>
Signed-off-by: Kevin Wolf
---
block/export/fuse.c | 242
From: Max Reitz
block-export-add type=fuse allows mounting block graph nodes via FUSE on
some existing regular file. That file should then appears like a raw
disk image, and accesses to it result in accesses to the exported BDS.
Right now, we only implement the necessary block export functions
The following changes since commit b785d25e91718a660546a6550f64b3c543af7754:
Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into
staging (2020-12-11 13:50:35 +)
are available in the Git repository at:
git://repo.or.cz/qemu/kevin.git tags/for-upstream
for you
11.12.2020 19:05, Max Reitz wrote:
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
The code already don't freeze base node and we try to make it prepared
for the situation when base node is changed during the operation. In
other words, block-stream doesn't own base node.
Let's introduce
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
Add a direct link to target bs for convenience and to simplify
following commit which will insert COR filter above target bs.
This is a part of original commit written by Andrey.
Signed-off-by: Vladimir Sementsov-Ogievskiy
---
Hello Bin,
On [2020 Dec 11] Fri 23:29:16, Bin Meng wrote:
> Hi Francisco,
>
> On Fri, Dec 11, 2020 at 11:16 PM Francisco Iglesias
> wrote:
> >
> > Hello Bin,
> >
> > On [2020 Dec 11] Fri 14:07:21, Bin Meng wrote:
> > > Hi Francisco,
> > >
> > > On Fri, Dec 4, 2020 at 7:28 PM Francisco Iglesias
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
test_stream_parallel run parallel stream jobs, intersecting so that top
of one is base of another. It's OK now, but it would be a problem if
insert the filter, as one job will want to use another job's filter as
above_base node.
Correct
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
The code already don't freeze base node and we try to make it prepared
for the situation when base node is changed during the operation. In
other words, block-stream doesn't own base node.
Let's introduce a new interface which should
Hi Francisco,
On Fri, Dec 11, 2020 at 11:16 PM Francisco Iglesias
wrote:
>
> Hello Bin,
>
> On [2020 Dec 11] Fri 14:07:21, Bin Meng wrote:
> > Hi Francisco,
> >
> > On Fri, Dec 4, 2020 at 7:28 PM Francisco Iglesias
> > wrote:
> > >
> > > Hello Bin,
> > >
> > > On [2020 Dec 04] Fri 18:52:50, Bin
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
From: Andrey Shinkevich
Avoid writing a filter JSON file name and a filter format name to QCOW2
image when the backing file is being changed after the block stream
job. It can occur due to a concurrent commit job on the same backing
chain.
Hello Bin,
On [2020 Dec 11] Fri 14:07:21, Bin Meng wrote:
> Hi Francisco,
>
> On Fri, Dec 4, 2020 at 7:28 PM Francisco Iglesias
> wrote:
> >
> > Hello Bin,
> >
> > On [2020 Dec 04] Fri 18:52:50, Bin Meng wrote:
> > > Hi Francisco,
> > >
> > > On Fri, Dec 4, 2020 at 6:46 PM Francisco Iglesias
>
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
From: Andrey Shinkevich
If the flag BDRV_REQ_PREFETCH was set, skip idling read/write
operations in COR-driver. It can be taken into account for the
COR-algorithms optimization. That check is being made during the
block stream job by the
11.12.2020 16:20, Max Reitz wrote:
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
From: Andrey Shinkevich
Add the new member supported_read_flags to the BlockDriverState
structure. It will control the flags set for copy-on-read operations.
Make the block generic layer evaluate
On 11.12.20 14:10, Vladimir Sementsov-Ogievskiy wrote:
11.12.2020 15:49, Max Reitz wrote:
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
From: Andrey Shinkevich
The test case #310 is similar to #216 by Max Reitz. The difference is
that the test #310 involves a bottom node to the COR
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
From: Andrey Shinkevich
Add the new member supported_read_flags to the BlockDriverState
structure. It will control the flags set for copy-on-read operations.
Make the block generic layer evaluate supported read flags before they
go to a
11.12.2020 15:49, Max Reitz wrote:
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
From: Andrey Shinkevich
The test case #310 is similar to #216 by Max Reitz. The difference is
that the test #310 involves a bottom node to the COR filter driver.
Signed-off-by: Andrey Shinkevich
On 04.12.20 23:07, Vladimir Sementsov-Ogievskiy wrote:
From: Andrey Shinkevich
The test case #310 is similar to #216 by Max Reitz. The difference is
that the test #310 involves a bottom node to the COR filter driver.
Signed-off-by: Andrey Shinkevich
Reviewed-by: Vladimir Sementsov-Ogievskiy
11.12.2020 12:44, Peter Krempa wrote:
On Thu, Dec 10, 2020 at 17:26:52 +0300, Vladimir Sementsov-Ogievskiy wrote:
Hi all!
Hi,
I have an idea, that not storing backing filename in qcow2 image at all may be
a good thing. I'll give some reasons and want to know what do you think about
it.
11.12.2020 11:54, Max Reitz wrote:
On 10.12.20 19:30, Vladimir Sementsov-Ogievskiy wrote:
10.12.2020 20:43, Max Reitz wrote:
I don’t like this patch’s subject very much, because I find the implementation
of the @bottom option to be more noteworthy than the addition of the QAPI
structure.
On Thu, Dec 10, 2020 at 17:26:52 +0300, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
Hi,
>
> I have an idea, that not storing backing filename in qcow2 image at all may
> be a good thing. I'll give some reasons and want to know what do you think
> about it.
>
> 1. Libvirt has to manage and
On 10.12.20 19:30, Vladimir Sementsov-Ogievskiy wrote:
10.12.2020 20:43, Max Reitz wrote:
I don’t like this patch’s subject very much, because I find the
implementation of the @bottom option to be more noteworthy than the
addition of the QAPI structure.
On 04.12.20 23:07, Vladimir
83 matches
Mail list logo