[Qemu-block] [PATCH 1/3] iotests/118: Test media change for scsi-cd

2019-07-31 Thread Kevin Wolf
The test covered only floppy and ide-cd. Add scsi-cd as well. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/118 | 20 tests/qemu-iotests/118.out | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118

[Qemu-block] [PATCH 0/3] iotests: More media change tests

2019-07-31 Thread Kevin Wolf
This series is motivated by the bug fixed in commit 7cef3d1290 ('scsi-cd: Fix inserting read-only media in empty drive'). After the series is applied, media change is tested for all combinations of floppy/ide-cd/scsi-cd with -drive/-blockdev and initially empty drive/inserted media. Kevin Wolf (3)

[Qemu-block] [PATCH 3/3] iotests/118: Add -blockdev based tests

2019-07-31 Thread Kevin Wolf
The code path for -device drive= or without a drive=... option for empty drives, which is supposed to be used with -blockdev differs enough from the -drive based path with a user-owned BlockBackend, so we want to test both paths at least for the basic tests implemented by TestInitiallyFilled and Te

[Qemu-block] [PATCH 2/3] iotests/118: Create test classes dynamically

2019-07-31 Thread Kevin Wolf
We're getting a ridiculous number of child classes of TestInitiallyFilled and TestInitiallyEmpty that differ only in a few attributes that we want to test in all combinations. Instead of explicitly writing down every combination, let's use a loop and create those classes dynamically. Signed-off-b

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] block/backup: refactor write_flags

2019-07-31 Thread Vladimir Sementsov-Ogievskiy
30.07.2019 21:28, John Snow wrote: > > > On 7/30/19 12:32 PM, Vladimir Sementsov-Ogievskiy wrote: >> write flags are constant, let's store it in BackupBlockJob instead of >> recalculating. It also makes two boolean fields to be unused, so, >> drop them. >> >> Signed-off-by: Vladimir Sementsov-Ogi

Re: [Qemu-block] [Qemu-devel] [PATCH v3 19/33] hw/sd/pl181.c & omap_mmc.c: remove device_legacy_reset call

2019-07-31 Thread Philippe Mathieu-Daudé
On 7/29/19 4:56 PM, Damien Hedde wrote: > Replace legacy's reset call by device_reset_warm. > > The new function propagates also the reset to the sub-buses tree but this has > no impact since SDState has no child bus. > > Signed-off-by: Damien Hedde > --- > hw/sd/omap_mmc.c | 2 +- > hw/sd/pl18

Re: [Qemu-block] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Andrey Shinkevich
On 31/07/2019 15:43, Christian Borntraeger wrote: > > > On 31.07.19 14:28, Christian Borntraeger wrote: >> >> >> On 31.07.19 14:04, Andrey Shinkevich wrote: >>> On 31/07/2019 10:24, Christian Borntraeger wrote: On 30.07.19 21:20, Paolo Bonzini wrote: > On 30/07/19 18:01, Andr

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Andrey Shinkevich
On 31/07/2019 15:32, Paolo Bonzini wrote: > On 31/07/19 11:05, Christophe de Dinechin wrote: >> >> Christian Borntraeger writes: >> >>> On 30.07.19 18:44, Philippe Mathieu-Daudé wrote: On 7/30/19 6:01 PM, Andrey Shinkevich wrote: > Not the whole structure is initialized before passing it

Re: [Qemu-block] [Qemu-devel] [PATCH 2/3] block/backup: disable copy_range for compressed backup

2019-07-31 Thread Vladimir Sementsov-Ogievskiy
30.07.2019 21:22, John Snow wrote: > > > On 7/30/19 12:32 PM, Vladimir Sementsov-Ogievskiy wrote: >> Enabled by default copy_range ignores compress option. It's definitely >> unexpected for user. >> >> It's broken since introduction of copy_range usage in backup in >> 9ded4a011496. >> >> Signed-o

Re: [Qemu-block] [Qemu-devel] [PATCH 0/3] backup fixes for 4.1?

2019-07-31 Thread John Snow
On 7/31/19 6:29 AM, Vladimir Sementsov-Ogievskiy wrote: > 30.07.2019 21:41, John Snow wrote: >> >> >> On 7/30/19 12:32 PM, Vladimir Sementsov-Ogievskiy wrote: >>> Hi all! >>> >>> Here are two small fixes. >>> >>> 01 is not a degradation at all, so it's OK for 4.2 >>> 02 is degradation of 3.0, so

Re: [Qemu-block] [Qemu-devel] [PATCH 1/3] block/backup: deal with zero detection

2019-07-31 Thread John Snow
On 7/31/19 6:01 AM, Vladimir Sementsov-Ogievskiy wrote: > 30.07.2019 21:40, John Snow wrote: >> >> >> On 7/30/19 12:32 PM, Vladimir Sementsov-Ogievskiy wrote: >>> We have detect_zeroes option, so at least for blockdev-backup user >>> should define it if zero-detection is needed. For drive-backup

Re: [Qemu-block] [Qemu-devel] [PATCH v3] blockjob: drain all job nodes in block_job_drain

2019-07-31 Thread John Snow
On 7/31/19 6:28 AM, Vladimir Sementsov-Ogievskiy wrote: > 30.07.2019 22:11, John Snow wrote: >> >> >> On 7/24/19 5:40 AM, Vladimir Sementsov-Ogievskiy wrote: >>> Instead of draining additional nodes in each job code, let's do it in >>> common block_job_drain, draining just all job's children. >>

Re: [Qemu-block] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Paolo Bonzini
On 31/07/19 14:43, Christian Borntraeger wrote: >> if (has_xsave) { >> env->xsave_buf = qemu_memalign(4096, sizeof(struct kvm_xsave)); >> +memset(env->xsave_buf, 0, sizeof(struct kvm_xsave)); > This is memsetting 4k? > Yet another variant would be to use the RUN

Re: [Qemu-block] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Christian Borntraeger
On 31.07.19 14:28, Christian Borntraeger wrote: > > > On 31.07.19 14:04, Andrey Shinkevich wrote: >> On 31/07/2019 10:24, Christian Borntraeger wrote: >>> >>> >>> On 30.07.19 21:20, Paolo Bonzini wrote: On 30/07/19 18:01, Andrey Shinkevich wrote: > Not the whole structure is initializ

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Paolo Bonzini
On 31/07/19 11:05, Christophe de Dinechin wrote: > > Christian Borntraeger writes: > >> On 30.07.19 18:44, Philippe Mathieu-Daudé wrote: >>> On 7/30/19 6:01 PM, Andrey Shinkevich wrote: Not the whole structure is initialized before passing it to the KVM. Reduce the number of Valgrind re

Re: [Qemu-block] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Christian Borntraeger
On 31.07.19 14:04, Andrey Shinkevich wrote: > On 31/07/2019 10:24, Christian Borntraeger wrote: >> >> >> On 30.07.19 21:20, Paolo Bonzini wrote: >>> On 30/07/19 18:01, Andrey Shinkevich wrote: Not the whole structure is initialized before passing it to the KVM. Reduce the number of Val

Re: [Qemu-block] [Qemu-devel] [PATCH v5 2/5] hw/block/pflash_cfi01: Use the correct READ_ARRAY value

2019-07-31 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Hi Markus. > > On 7/16/19 5:12 PM, Markus Armbruster wrote: >> "Dr. David Alan Gilbert" writes: >> >>> * Markus Armbruster (arm...@redhat.com) wrote: Philippe asked me to have a look at this one, so here goes. > > Thanks a lot for your careful analysis. > >

Re: [Qemu-block] [PATCH v3 1/9] block: add .bdrv_need_rw_file_child_during_reopen_rw handler

2019-07-31 Thread Max Reitz
On 25.07.19 11:18, Vladimir Sementsov-Ogievskiy wrote: > On reopen to rw parent may need rw access to child in .prepare, for > example qcow2 needs to write IN_USE flags into stored bitmaps > (currently it is done in a hacky way after commit and don't work). > So, let's introduce such logic. > > Th

Re: [Qemu-block] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Andrey Shinkevich
On 31/07/2019 10:24, Christian Borntraeger wrote: > > > On 30.07.19 21:20, Paolo Bonzini wrote: >> On 30/07/19 18:01, Andrey Shinkevich wrote: >>> Not the whole structure is initialized before passing it to the KVM. >>> Reduce the number of Valgrind reports. >>> >>> Signed-off-by: Andrey Shinkevi

Re: [Qemu-block] [Qemu-devel] [PATCH v3 05/33] Switch to new api in qdev/bus

2019-07-31 Thread Philippe Mathieu-Daudé
On 7/31/19 11:29 AM, Damien Hedde wrote: > On 7/31/19 8:05 AM, David Gibson wrote: >> On Mon, Jul 29, 2019 at 04:56:26PM +0200, Damien Hedde wrote: >>> Deprecate old reset apis and make them use the new one while they >>> are still used somewhere. >>> >>> Signed-off-by: Damien Hedde >>> --- >>> h

Re: [Qemu-block] [PATCH v3 06/33] add the vmstate description for device reset state

2019-07-31 Thread Damien Hedde
On 7/31/19 8:08 AM, David Gibson wrote: > On Mon, Jul 29, 2019 at 04:56:27PM +0200, Damien Hedde wrote: >> It contains the resetting counter and cold flag status. >> >> At this point, migration of bus reset related state (counter and cold/warm >> flag) is handled by parent device. This done usin

Re: [Qemu-block] [Qemu-devel] [PATCH 0/3] backup fixes for 4.1?

2019-07-31 Thread Vladimir Sementsov-Ogievskiy
30.07.2019 21:41, John Snow wrote: > > > On 7/30/19 12:32 PM, Vladimir Sementsov-Ogievskiy wrote: >> Hi all! >> >> Here are two small fixes. >> >> 01 is not a degradation at all, so it's OK for 4.2 >> 02 is degradation of 3.0, so it's possibly OK for 4.2 too, >> but it seems to be real bug an

Re: [Qemu-block] [Qemu-devel] [PATCH v3] blockjob: drain all job nodes in block_job_drain

2019-07-31 Thread Vladimir Sementsov-Ogievskiy
30.07.2019 22:11, John Snow wrote: > > > On 7/24/19 5:40 AM, Vladimir Sementsov-Ogievskiy wrote: >> Instead of draining additional nodes in each job code, let's do it in >> common block_job_drain, draining just all job's children. >> BlockJobDriver.drain becomes unused, so, drop it at all. >> >>

Re: [Qemu-block] [PATCH v8 16/16] block/io_uring: adds fd registration

2019-07-31 Thread Stefan Hajnoczi
On Tue, Jul 30, 2019 at 11:04:41PM +0530, Aarushi Mehta wrote: I'm concerned about file descriptor leaks. fd_array[] keeps file descriptors basically forever, even after the file is no longer in use by the rest of QEMU. There needs to be a call to unregister whenever a file is closed elsewhere i

Re: [Qemu-block] [Qemu-devel] [PATCH v3 01/33] Create Resettable QOM interface

2019-07-31 Thread Christophe de Dinechin
Peter Maydell writes: > On Tue, 30 Jul 2019 at 14:56, Cornelia Huck wrote: >> >> On Tue, 30 Jul 2019 14:44:21 +0100 >> Peter Maydell wrote: >> >> > On Tue, 30 Jul 2019 at 14:42, Cornelia Huck wrote: >> > > I'm having a hard time figuring out what a 'cold' or a 'warm' reset is >> > > supposed

Re: [Qemu-block] [PATCH v3 08/33] Add function to control reset with gpio inputs

2019-07-31 Thread Damien Hedde
On 7/31/19 8:11 AM, David Gibson wrote: > On Mon, Jul 29, 2019 at 04:56:29PM +0200, Damien Hedde wrote: >> It adds the possibility to add 2 gpios to control the warm and cold reset. >> With theses ios, the reset can be maintained during some time. >> Each io is associated with a state to detect

Re: [Qemu-block] [PATCH v3 09/33] add doc about Resettable interface

2019-07-31 Thread Damien Hedde
On 7/31/19 8:30 AM, David Gibson wrote: > On Mon, Jul 29, 2019 at 04:56:30PM +0200, Damien Hedde wrote: >> Signed-off-by: Damien Hedde >> --- >> docs/devel/reset.txt | 165 +++ >> 1 file changed, 165 insertions(+) >> create mode 100644 docs/devel/reset.

Re: [Qemu-block] [Qemu-devel] [PATCH 1/3] block/backup: deal with zero detection

2019-07-31 Thread Vladimir Sementsov-Ogievskiy
30.07.2019 21:40, John Snow wrote: > > > On 7/30/19 12:32 PM, Vladimir Sementsov-Ogievskiy wrote: >> We have detect_zeroes option, so at least for blockdev-backup user >> should define it if zero-detection is needed. For drive-backup leave >> detection enabled by default but do it through existin

Re: [Qemu-block] [PATCH for-4.2 13/13] iotests: Test qcow2's snapshot table handling

2019-07-31 Thread Max Reitz
On 30.07.19 21:56, Eric Blake wrote: > On 7/30/19 12:25 PM, Max Reitz wrote: >> Add a test how our qcow2 driver handles extra data in snapshot table >> entries, and how it repairs overly long snapshot tables. > > May need tweaking if we drop 9 and 10. > >> >> Signed-off-by: Max Reitz >> --- >>

Re: [Qemu-block] [PATCH v3 05/33] Switch to new api in qdev/bus

2019-07-31 Thread Damien Hedde
On 7/31/19 8:05 AM, David Gibson wrote: > On Mon, Jul 29, 2019 at 04:56:26PM +0200, Damien Hedde wrote: >> Deprecate old reset apis and make them use the new one while they >> are still used somewhere. >> >> Signed-off-by: Damien Hedde >> --- >> hw/core/qdev.c | 22 +++-

Re: [Qemu-block] [PATCH for-4.2 12/13] iotests: Add peek_file* functions

2019-07-31 Thread Max Reitz
On 30.07.19 21:22, Eric Blake wrote: > On 7/30/19 12:25 PM, Max Reitz wrote: >> Signed-off-by: Max Reitz >> --- >> tests/qemu-iotests/common.rc | 20 >> 1 file changed, 20 insertions(+) >> >> diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc >> index 55

Re: [Qemu-block] [PATCH for-4.2 10/13] qcow2: Repair snapshot table with too many entries

2019-07-31 Thread Max Reitz
On 30.07.19 21:10, Eric Blake wrote: > On 7/30/19 12:25 PM, Max Reitz wrote: >> Signed-off-by: Max Reitz >> --- >> block/qcow2-snapshot.c | 14 ++ >> 1 file changed, 14 insertions(+) >> > > Same problem as for 9/13 - should we really be throwing away the user's > data like this? (9/

Re: [Qemu-block] [PATCH for-4.2 09/13] qcow2: Fix overly long snapshot tables

2019-07-31 Thread Max Reitz
On 30.07.19 21:08, Eric Blake wrote: > On 7/30/19 12:25 PM, Max Reitz wrote: >> We currently refuse to open qcow2 images with overly long snapshot >> tables. This patch makes qemu-img check -r all drop all offending >> entries past what we deem acceptable. >> >> Signed-off-by: Max Reitz >> --- >>

Re: [Qemu-block] [PATCH v3 04/33] make Device and Bus Resettable

2019-07-31 Thread Damien Hedde
On 7/31/19 7:56 AM, David Gibson wrote: > On Mon, Jul 29, 2019 at 04:56:25PM +0200, Damien Hedde wrote: >> This add Resettable interface implementation for both Bus and Device. >> >> *resetting* counter and *reset_is_cold* flag are added in DeviceState >> and BusState. >> >> Compatibility with e

Re: [Qemu-block] [PATCH for-4.2 08/13] qcow2: Fix broken snapshot table entries

2019-07-31 Thread Max Reitz
On 30.07.19 21:02, Eric Blake wrote: > On 7/30/19 12:25 PM, Max Reitz wrote: >> The only case where we currently reject snapshot table entries is when >> they have too much extra data. Fix them with qemu-img check -r all by >> counting it as a corruption, reducing their extra_data_size, and then >

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Christophe de Dinechin
Christian Borntraeger writes: > On 30.07.19 18:44, Philippe Mathieu-Daudé wrote: >> On 7/30/19 6:01 PM, Andrey Shinkevich wrote: >>> Not the whole structure is initialized before passing it to the KVM. >>> Reduce the number of Valgrind reports. >>> >>> Signed-off-by: Andrey Shinkevich >>> --- >

Re: [Qemu-block] [PATCH for-4.2 06/13] qcow2: Separate qcow2_check_read_snapshot_table()

2019-07-31 Thread Max Reitz
On 30.07.19 20:53, Eric Blake wrote: > On 7/30/19 12:25 PM, Max Reitz wrote: >> Reading the snapshot table can fail. That is a problem when we want to >> repair the image. >> >> Therefore, stop reading the snapshot table in qcow2_do_open() in check >> mode. Instead, add a new function qcow2_check

Re: [Qemu-block] [PATCH for-4.2 05/13] qcow2: Write v3-compliant snapshot list on upgrade

2019-07-31 Thread Max Reitz
On 30.07.19 20:10, Eric Blake wrote: > On 7/30/19 12:25 PM, Max Reitz wrote: >> qcow2 v3 requires every snapshot table entry to have two extra data >> fields: The 64-bit VM state size, and the virtual disk size. Both are >> optional for v2 images, so they may not be present. >> >> qcow2_upgrade()

Re: [Qemu-block] [PATCH for-4.2 02/13] qcow2: Keep unknown extra snapshot data

2019-07-31 Thread Max Reitz
On 30.07.19 19:56, Eric Blake wrote: > On 7/30/19 12:24 PM, Max Reitz wrote: >> The qcow2 specification says to ignore unknown extra data fields in >> snapshot table entries. Currently, we discard it whenever we update the >> image, which is a bit different from "ignore". >> >> This patch makes th

Re: [Qemu-block] [PATCH 3/3] i386/kvm: initialize struct at full before ioctl call

2019-07-31 Thread Christian Borntraeger
On 30.07.19 21:20, Paolo Bonzini wrote: > On 30/07/19 18:01, Andrey Shinkevich wrote: >> Not the whole structure is initialized before passing it to the KVM. >> Reduce the number of Valgrind reports. >> >> Signed-off-by: Andrey Shinkevich > > Christian, is this the right fix? It's not expensi