Re: [RFC v2] nbd/proto: introduce extended request and 64bit commands

2020-03-17 Thread Vladimir Sementsov-Ogievskiy
18.03.2020 8:33, Wouter Verhelst wrote: On Tue, Mar 17, 2020 at 09:10:32PM +0300, Vladimir Sementsov-Ogievskiy wrote: 17.03.2020 19:18, Wouter Verhelst wrote: Hi Vladimir, Sorry for the delay; I got married late last month (yay!), so obviously I was a little preoccupied ;-)

Re: [RFC v2] nbd/proto: introduce extended request and 64bit commands

2020-03-17 Thread Wouter Verhelst
On Tue, Mar 17, 2020 at 09:10:32PM +0300, Vladimir Sementsov-Ogievskiy wrote: > 17.03.2020 19:18, Wouter Verhelst wrote: > > Hi Vladimir, > > > > Sorry for the delay; I got married late last month (yay!), so obviously > > I was a little preoccupied ;-) > > Congratulations!! Be happy! > > > > >

Re: [PATCH RESEND v2] block/nvme: introduce PMR support from NVMe 1.4 spec

2020-03-17 Thread Andrzej Jakowski
On 3/17/20 4:23 AM, Stefan Hajnoczi wrote: >> Code is posted here >> https://github.com/AndrzejJakowski/qemu/commit/3a7762a1d13ff1543d1da430748eb24e38faab6f >> >> QEMU command line: >> >> # below are just relevant pieces of configuration, other stuff omitted >> # tried different setting (e.g.

[PULL 16/20] hw/ide: Remove now unneded #include "hw/pci/pci.h" from hw/ide.h

2020-03-17 Thread John Snow
From: BALATON Zoltan After previous patches we don't need hw/pci/pci.h any more in hw/ide.h. Some files depended on implicit inclusion by this header which are also fixed up here. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by:

[PULL 15/20] hw/ide: Get rid of piix4_init function

2020-03-17 Thread John Snow
From: BALATON Zoltan This removes pci_piix4_ide_init() function similar to clean up done to other ide devices. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Markus Armbruster Message-id: fe46b6536abbae77695f6d1c711a04a3f4b5481d.1584457537.git.bala...@eik.bme.hu

[PULL 14/20] hw/isa/piix4.c: Introduce variable to store devfn

2020-03-17 Thread John Snow
From: BALATON Zoltan To avoid any problem with reassigning pci variable store devfn in a variable instead of acessing it from the PCIDevice. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Message-id:

[PULL 17/20] hw/ide/pci.c: Coding style update to fix checkpatch errors

2020-03-17 Thread John Snow
From: BALATON Zoltan Spaces are required around a + operator and if statements should have braces even for single line. Also make it simpler by reversing the condition instead of breaking the loop. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé

[PULL 20/20] hw/ide: Remove unneeded inclusion of hw/ide.h

2020-03-17 Thread John Snow
From: BALATON Zoltan After previous clean ups we can drop direct inclusion of hw/ide.h from several places. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Markus Armbruster Message-id: a3f72b663e537701c63cec5fc9cb8ed4f4249f28.1584457537.git.bala...@eik.bme.hu

[PULL 19/20] hw/ide: Move MAX_IDE_DEVS define to hw/ide/internal.h

2020-03-17 Thread John Snow
From: BALATON Zoltan We can move this define now that less files use it to internal.h to further reduce dependency on hw/ide.h. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Markus Armbruster Message-id:

[PULL 18/20] hw/ide: Do ide_drive_get() within pci_ide_create_devs()

2020-03-17 Thread John Snow
From: BALATON Zoltan The pci_ide_create_devs() function takes a hd_table parameter but all callers just pass what ide_drive_get() returns so we can do it locally simplifying callers and removing hd_table parameter. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by:

[PULL 12/20] hd-geo-test: Clean up use of buf[] in create_qcow2_with_mbr()

2020-03-17 Thread John Snow
From: Markus Armbruster valgrind reports write unitialized bytes from buf[]. Clear them. ASan reports we store to misaligned address in buf[]. Use stl_le_p() for that. Cc: Sam Eiderman Cc: John Snow Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Message-id:

[PULL 13/20] hw/ide: Get rid of piix3_init functions

2020-03-17 Thread John Snow
From: BALATON Zoltan This removes pci_piix3_ide_init() and pci_piix3_xen_ide_init() functions similar to clean up done to other ide devices. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster Message-id:

[PULL 11/20] via-ide: always use legacy IRQ 14/15 routing

2020-03-17 Thread John Snow
From: Mark Cave-Ayland The existing code uses fixed PCI IRQ routing on IRQ 14 rather than legacy IRQ 14/15 routing as documented in the datasheet. With the changes in this patchset guest OSs now correctly detect and configure the VIA controller in legacy IRQ routing mode, allowing the incorrect

[PULL 10/20] via-ide: allow guests to write to PCI_CLASS_PROG

2020-03-17 Thread John Snow
From: Mark Cave-Ayland MorphOS writes to PCI_CLASS_PROG during IDE initialisation to place the controller in native mode, but thinks the initialisation has failed because the native mode bits aren't set when reading the register back. Signed-off-by: Mark Cave-Ayland Tested-by: BALATON Zoltan

[PULL 06/20] ide/via: Get rid of via_ide_init()

2020-03-17 Thread John Snow
From: BALATON Zoltan Follow example of CMD646 and remove via_ide_init function and do it directly in board code instead. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Tested-by: BALATON Zoltan Signed-off-by: Mark Cave-Ayland Message-id:

[PULL 08/20] via-ide: ensure that PCI_INTERRUPT_LINE is hard-wired to its default value

2020-03-17 Thread John Snow
From: Mark Cave-Ayland Some firmwares accidentally write to PCI_INTERRUPT_LINE on startup which has no effect on real hardware since it is hard-wired to its default value, but causes the guest OS to become confused trying to initialise IDE devices when running under QEMU. Signed-off-by: Mark

[PULL 09/20] via-ide: initialise IDE controller in legacy mode

2020-03-17 Thread John Snow
From: Mark Cave-Ayland According to both the VT82C686B and VT8231 datasheets the VIA Southbridge IDE controller is initialised in legacy mode. This allows Linux to correctly determine that legacy rather than PCI IRQ routing should be used since the boot console text in the fulong2e test image

[PULL 05/20] via-ide: move registration of VMStateDescription to DeviceClass

2020-03-17 Thread John Snow
From: Mark Cave-Ayland Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Tested-by: BALATON Zoltan Message-id: 20200313082444.2439-2-mark.cave-ayl...@ilande.co.uk Signed-off-by: John Snow --- hw/ide/via.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PULL 04/20] cmd646: remove unused pci_cmd646_ide_init() function

2020-03-17 Thread John Snow
From: Mark Cave-Ayland Signed-off-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20200307091313.24190-3-mark.cave-ayl...@ilande.co.uk Signed-off-by: John Snow --- include/hw/ide.h | 2 -- hw/ide/cmd646.c | 12 2 files

[PULL 07/20] pci: Honour wmask when resetting PCI_INTERRUPT_LINE

2020-03-17 Thread John Snow
From: BALATON Zoltan The pci_do_device_reset() function (called from pci_device_reset) clears the PCI_INTERRUPT_LINE config reg of devices on the bus but did this without taking wmask into account. We'll have a device model now that needs to set a constant value for this reg and this patch

[PULL 03/20] dp264: use pci_create_simple() to initialise the cmd646 device

2020-03-17 Thread John Snow
From: Mark Cave-Ayland Remove the call to pci_cmd646_ide_init() since global device init functions are deprecated in preference of using qdev directly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id:

[PULL 02/20] cmd646: register vmstate_ide_pci VMStateDescription in DeviceClass

2020-03-17 Thread John Snow
From: Mark Cave-Ayland Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-id: 20200307151536.32709-3-mark.cave-ayl...@ilande.co.uk Signed-off-by: John Snow --- hw/ide/cmd646.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/ide/cmd646.c

[PULL 00/20] Ide patches

2020-03-17 Thread John Snow
The following changes since commit 373c7068dd610e97f0b551b5a6d0a27cd6da4506: qemu.nsi: Install Sphinx documentation (2020-03-09 16:45:00 +) are available in the Git repository at: https://github.com/jnsnow/qemu.git tags/ide-pull-request for you to fetch changes up to

[PULL 01/20] cmd646: register cmd646_reset() function in DeviceClass

2020-03-17 Thread John Snow
From: Mark Cave-Ayland Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-id: 20200307151536.32709-2-mark.cave-ayl...@ilande.co.uk Signed-off-by: John Snow --- hw/ide/cmd646.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ide/cmd646.c

Re: [PATCH v3 0/8] Misc hw/ide legacy clean up

2020-03-17 Thread John Snow
On 3/17/20 11:05 AM, BALATON Zoltan wrote: > Avoid problems from reassigning variable in piix4_create and fix > compilation problem with mips_r4k > > BALATON Zoltan (8): > hw/ide: Get rid of piix3_init functions > hw/isa/piix4.c: Introduce variable to store devfn > hw/ide: Get rid of

Re: [PATCH 3/3] xen-block: Use one Error * variable instead of two

2020-03-17 Thread Vladimir Sementsov-Ogievskiy
17.03.2020 22:03, Markus Armbruster wrote: Uh, I failed to actually send this. It's in my pull request now. Vladimir Sementsov-Ogievskiy writes: 13.03.2020 20:05, Markus Armbruster wrote: Signed-off-by: Markus Armbruster --- hw/block/xen-block.c | 5 + 1 file changed, 1

Re: [PATCH v3 0/8] Misc hw/ide legacy clean up

2020-03-17 Thread John Snow
On 3/17/20 2:34 PM, BALATON Zoltan wrote: > On Tue, 17 Mar 2020, John Snow wrote: >> On 3/17/20 11:05 AM, BALATON Zoltan wrote: >>> Avoid problems from reassigning variable in piix4_create and fix >>> compilation problem with mips_r4k >>> >>> BALATON Zoltan (8): >>>   hw/ide: Get rid of

Re: [PATCH 3/3] xen-block: Use one Error * variable instead of two

2020-03-17 Thread Markus Armbruster
Uh, I failed to actually send this. It's in my pull request now. Vladimir Sementsov-Ogievskiy writes: > 13.03.2020 20:05, Markus Armbruster wrote: >> Signed-off-by: Markus Armbruster >> --- >> hw/block/xen-block.c | 5 + >> 1 file changed, 1 insertion(+), 4 deletions(-) >> >> diff

[PATCH v4 28/30] qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit

2020-03-17 Thread Alberto Garcia
Now that the implementation of subclusters is complete we can finally add the necessary options to create and read images with this feature, which we call "extended L2 entries". Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- qapi/block-core.json | 7 +++ block/qcow2.h

[PATCH v4 13/30] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type()

2020-03-17 Thread Alberto Garcia
This patch adds QCow2SubclusterType, which is the subcluster-level version of QCow2ClusterType. All QCOW2_SUBCLUSTER_* values have the the same meaning as their QCOW2_CLUSTER_* equivalents (when they exist). See below for details and caveats. In images without extended L2 entries clusters are

[PATCH v4 27/30] qcow2: Assert that expand_zero_clusters_in_l1() does not support subclusters

2020-03-17 Thread Alberto Garcia
This function is only used by qcow2_expand_zero_clusters() to downgrade a qcow2 image to a previous version. It is however not possible to downgrade an image with extended L2 entries because older versions of qcow2 do not have this feature. Signed-off-by: Alberto Garcia ---

[PATCH v4 14/30] qcow2: Add cluster type parameter to qcow2_get_host_offset()

2020-03-17 Thread Alberto Garcia
This function returns an integer that can be either an error code or a cluster type (a value from the QCow2ClusterType enum). We are going to start using subcluster types instead of cluster types in some functions so it's better to use the exact data types instead of integers for clarity and in

[PATCH v4 00/30] Add subcluster allocation to qcow2

2020-03-17 Thread Alberto Garcia
Hi, here's the new version of the patches to add subcluster allocation support to qcow2. Please refer to the cover letter of the first version for a full description of the patches: https://lists.gnu.org/archive/html/qemu-block/2019-10/msg00983.html I think that this version fixes all the

Re: [PATCH 0/2] Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()

2020-03-17 Thread Alberto Garcia
On Thu 27 Feb 2020 07:34:24 PM CET, Alberto Garcia wrote: > Hi, > > this is something I did while working on the subcluster series but > it's independent from it so I thought to send it already. I included this patches in v4 of the main series so you can ignore this thread. Berto

[PATCH v4 09/30] qcow2: Add subcluster-related fields to BDRVQcow2State

2020-03-17 Thread Alberto Garcia
This patch adds the following new fields to BDRVQcow2State: - subclusters_per_cluster: Number of subclusters in a cluster - subcluster_size: The size of each subcluster, in bytes - subcluster_bits: No. of bits so 1 << subcluster_bits = subcluster_size Images without subclusters are treated as if

[PATCH v4 24/30] qcow2: Clear the L2 bitmap when allocating a compressed cluster

2020-03-17 Thread Alberto Garcia
Compressed clusters always have the bitmap part of the extended L2 entry set to 0. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-cluster.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index dfd8b66958..1f471db98c

[PATCH v4 25/30] qcow2: Add subcluster support to handle_alloc_space()

2020-03-17 Thread Alberto Garcia
The bdrv_co_pwrite_zeroes() call here fills complete clusters with zeroes, but it can happen that some subclusters are not part of the write request or the copy-on-write. This patch makes sure that only the affected subclusters are overwritten. A potential improvement would be to also fill with

[PATCH v4 26/30] qcow2: Restrict qcow2_co_pwrite_zeroes() to full clusters only

2020-03-17 Thread Alberto Garcia
Ideally it should be possible to zero individual subclusters using this function, but this is currently not implemented. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c

[PATCH v4 19/30] qcow2: Add subcluster support to zero_in_l2_slice()

2020-03-17 Thread Alberto Garcia
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an image has subclusters. Instead, the individual 'all zeroes' bits must be used. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-cluster.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-)

Re: [PATCH v3 0/8] Misc hw/ide legacy clean up

2020-03-17 Thread BALATON Zoltan
On Tue, 17 Mar 2020, John Snow wrote: On 3/17/20 11:05 AM, BALATON Zoltan wrote: Avoid problems from reassigning variable in piix4_create and fix compilation problem with mips_r4k BALATON Zoltan (8): hw/ide: Get rid of piix3_init functions hw/isa/piix4.c: Introduce variable to store devfn

[PATCH v4 30/30] iotests: Add tests for qcow2 images with extended L2 entries

2020-03-17 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- tests/qemu-iotests/271 | 359 + tests/qemu-iotests/271.out | 244 + tests/qemu-iotests/group | 1 + 3 files changed, 604 insertions(+) create mode 100755 tests/qemu-iotests/271 create mode

Re: [PULL 0/1] Block patches

2020-03-17 Thread Peter Maydell
On Tue, 17 Mar 2020 at 15:18, Stefan Hajnoczi wrote: > > The following changes since commit 61c265f0660ee476985808c8aa7915617c44fd53: > > Merge remote-tracking branch > 'remotes/dgilbert/tags/pull-migration-20200313a' into staging (2020-03-13 > 10:33:04 +) > > are available in the Git

[PATCH v4 01/30] qcow2: Make Qcow2AioTask store the full host offset

2020-03-17 Thread Alberto Garcia
The file_cluster_offset field of Qcow2AioTask stores a cluster-aligned host offset. In practice this is not very useful because all users(*) of this structure need the final host offset into the cluster, which they calculate using host_offset = file_cluster_offset + offset_into_cluster(s,

[PATCH v4 17/30] qcow2: Add subcluster support to calculate_l2_meta()

2020-03-17 Thread Alberto Garcia
If an image has subclusters then there are more copy-on-write scenarios that we need to consider. Let's say we have a write request from the middle of subcluster #3 until the end of the cluster: - If the cluster is new, then subclusters #0 to #3 from the old cluster must be copied into

[PATCH v4 07/30] qcow2: Document the Extended L2 Entries feature

2020-03-17 Thread Alberto Garcia
Subcluster allocation in qcow2 is implemented by extending the existing L2 table entries and adding additional information to indicate the allocation status of each subcluster. This patch documents the changes to the qcow2 format and how they affect the calculation of the L2 cache size.

[PATCH v4 20/30] qcow2: Add subcluster support to discard_in_l2_slice()

2020-03-17 Thread Alberto Garcia
Two changes are needed in this function: 1) A full discard deallocates a cluster so we can skip the operation if it is already unallocated. With extended L2 entries however if any of the subclusters has the 'all zeroes' bit set then we have to clear it. 2) Setting the QCOW_OFLAG_ZERO

[PATCH v4 06/30] qcow2: Add get_l2_entry() and set_l2_entry()

2020-03-17 Thread Alberto Garcia
The size of an L2 entry is 64 bits, but if we want to have subclusters we need extended L2 entries. This means that we have to access L2 tables and slices differently depending on whether an image has extended L2 entries or not. This patch replaces all l2_slice[] accesses with calls to

[PATCH v4 03/30] qcow2: Add calculate_l2_meta()

2020-03-17 Thread Alberto Garcia
handle_alloc() creates a QCowL2Meta structure in order to update the image metadata and perform the necessary copy-on-write operations. This patch moves that code to a separate function so it can be used from other places. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz ---

[PATCH v4 15/30] qcow2: Replace QCOW2_CLUSTER_* with QCOW2_SUBCLUSTER_*

2020-03-17 Thread Alberto Garcia
In order to support extended L2 entries some functions of the qcow2 driver need to start dealing with subclusters instead of clusters. qcow2_get_host_offset() is modified to return the subcluster type instead of the cluster type, and all callers are updated to replace all values of

[PATCH v4 21/30] qcow2: Add subcluster support to check_refcounts_l2()

2020-03-17 Thread Alberto Garcia
Setting the QCOW_OFLAG_ZERO bit of the L2 entry is forbidden if an image has subclusters. Instead, the individual 'all zeroes' bits must be used. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-refcount.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff

[PATCH v4 22/30] qcow2: Fix offset calculation in handle_dependencies()

2020-03-17 Thread Alberto Garcia
l2meta_cow_start() and l2meta_cow_end() are not necessarily cluster-aligned if the image has subclusters, so update the calculation of old_start and old_end to guarantee that no two requests try to write on the same cluster. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz ---

[PATCH v4 02/30] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset()

2020-03-17 Thread Alberto Garcia
qcow2_get_cluster_offset() takes an (unaligned) guest offset and returns the (aligned) offset of the corresponding cluster in the qcow2 image. In practice none of the callers need to know where the cluster starts so this patch makes the function calculate and return the final host offset

[PATCH v4 11/30] qcow2: Add l2_entry_size()

2020-03-17 Thread Alberto Garcia
qcow2 images with subclusters have 128-bit L2 entries. The first 64 bits contain the same information as traditional images and the last 64 bits form a bitmap with the status of each individual subcluster. Because of that we cannot assume that L2 entries are sizeof(uint64_t) anymore. This

[PATCH v4 23/30] qcow2: Update L2 bitmap in qcow2_alloc_cluster_link_l2()

2020-03-17 Thread Alberto Garcia
The L2 bitmap needs to be updated after each write to indicate what new subclusters are now allocated. This needs to happen even if the cluster was already allocated and the L2 entry was otherwise valid. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-cluster.c | 17

[PATCH v4 04/30] qcow2: Split cluster_needs_cow() out of count_cow_clusters()

2020-03-17 Thread Alberto Garcia
We are going to need it in other places. Signed-off-by: Alberto Garcia Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/qcow2-cluster.c | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/block/qcow2-cluster.c

[PATCH v4 16/30] qcow2: Handle QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC

2020-03-17 Thread Alberto Garcia
When dealing with subcluster types there is a new value called QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC that has no equivalent in QCow2ClusterType. This patch handles that value in all places where subcluster types are processed. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz ---

[PATCH v4 18/30] qcow2: Add subcluster support to qcow2_get_host_offset()

2020-03-17 Thread Alberto Garcia
The logic of this function remains pretty much the same, except that it uses count_contiguous_subclusters(), which combines the logic of count_contiguous_clusters() / count_contiguous_clusters_unallocated() and checks individual subclusters. Signed-off-by: Alberto Garcia --- block/qcow2.h

[PATCH v4 08/30] qcow2: Add dummy has_subclusters() function

2020-03-17 Thread Alberto Garcia
This function will be used by the qcow2 code to check if an image has subclusters or not. At the moment this simply returns false. Once all patches needed for subcluster support are ready then QEMU will be able to create and read images with subclusters and this function will return the actual

[PATCH v4 10/30] qcow2: Add offset_to_sc_index()

2020-03-17 Thread Alberto Garcia
For a given offset, return the subcluster number within its cluster (i.e. with 32 subclusters per cluster it returns a number between 0 and 31). Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2.h | 5 + 1 file changed, 5 insertions(+) diff --git a/block/qcow2.h

[PATCH v4 29/30] qcow2: Add subcluster support to qcow2_measure()

2020-03-17 Thread Alberto Garcia
Extended L2 entries are bigger than normal L2 entries so this has an impact on the amount of metadata needed for a qcow2 file. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git

[PATCH v4 12/30] qcow2: Update get/set_l2_entry() and add get/set_l2_bitmap()

2020-03-17 Thread Alberto Garcia
Extended L2 entries are 128-bit wide: 64 bits for the entry itself and 64 bits for the subcluster allocation bitmap. In order to support them correctly get/set_l2_entry() need to be updated so they take the entry width into account in order to calculate the correct offset. This patch also adds

[PATCH v4 05/30] qcow2: Process QCOW2_CLUSTER_ZERO_ALLOC clusters in handle_copied()

2020-03-17 Thread Alberto Garcia
When writing to a qcow2 file there are two functions that take a virtual offset and return a host offset, possibly allocating new clusters if necessary: - handle_copied() looks for normal data clusters that are already allocated and have a reference count of 1. In those clusters we

Re: [RFC v2] nbd/proto: introduce extended request and 64bit commands

2020-03-17 Thread Vladimir Sementsov-Ogievskiy
17.03.2020 19:18, Wouter Verhelst wrote: Hi Vladimir, Sorry for the delay; I got married late last month (yay!), so obviously I was a little preoccupied ;-) Congratulations!! Be happy! On Fri, Feb 28, 2020 at 01:22:43PM +0300, Vladimir Sementsov-Ogievskiy wrote: ping 06.02.2020 18:15,

Re: [PATCH v3 0/8] Misc hw/ide legacy clean up

2020-03-17 Thread John Snow
On 3/17/20 11:05 AM, BALATON Zoltan wrote: > Avoid problems from reassigning variable in piix4_create and fix > compilation problem with mips_r4k > > BALATON Zoltan (8): > hw/ide: Get rid of piix3_init functions > hw/isa/piix4.c: Introduce variable to store devfn > hw/ide: Get rid of

Re: [PULL 06/15] configure: Enable test and libs for zstd

2020-03-17 Thread Juan Quintela
Peter Maydell wrote: > On Fri, 28 Feb 2020 at 09:28, Juan Quintela wrote: >> >> Add it to several build systems to make testing good. >> >> Signed-off-by: Juan Quintela >> Reviewed-by: Dr. David Alan Gilbert >> --- >> .gitlab-ci.yml| 1 + >> .travis.yml

Re: [PULL 06/15] configure: Enable test and libs for zstd

2020-03-17 Thread Peter Maydell
On Fri, 28 Feb 2020 at 09:28, Juan Quintela wrote: > > Add it to several build systems to make testing good. > > Signed-off-by: Juan Quintela > Reviewed-by: Dr. David Alan Gilbert > --- > .gitlab-ci.yml| 1 + > .travis.yml | 1

Re: [PATCH 0/3] Minor error handling cleanups

2020-03-17 Thread Markus Armbruster
Queued, including Vladimir's PATCH 4/3. Thanks!

Re: [PATCH v4 7/7] qemu-img: Deprecate use of -b without -F

2020-03-17 Thread Kashyap Chamarthy
On Thu, Mar 12, 2020 at 02:28:22PM -0500, Eric Blake wrote: > Creating an image that requires format probing of the backing image is > inherently unsafe (we've had several CVEs over the years based on > probes leaking information to the guest on a subsequent boot, although > these days tools like

Re: [RFC v2] nbd/proto: introduce extended request and 64bit commands

2020-03-17 Thread Wouter Verhelst
Hi Vladimir, Sorry for the delay; I got married late last month (yay!), so obviously I was a little preoccupied ;-) On Fri, Feb 28, 2020 at 01:22:43PM +0300, Vladimir Sementsov-Ogievskiy wrote: > ping > > 06.02.2020 18:15, Vladimir Sementsov-Ogievskiy wrote: [...] > > +The extended request

Re: [PULL 00/10] Bitmaps patches

2020-03-17 Thread Eric Blake
On 3/17/20 10:11 AM, Daniel P. Berrangé wrote: On Tue, Mar 17, 2020 at 03:07:34PM +, Peter Maydell wrote: On Tue, 17 Mar 2020 at 15:05, Daniel P. Berrangé wrote: On Tue, Mar 17, 2020 at 03:00:48PM +, Peter Maydell wrote: On Tue, 17 Mar 2020 at 14:57, Daniel P. Berrangé wrote: I

[PATCH v10 9/9] xen: introduce ERRP_AUTO_PROPAGATE

2020-03-17 Thread Vladimir Sementsov-Ogievskiy
If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == _fatal (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. If we want to

Re: [PATCH v10 4/3] hw/sd/ssi-sd: fix error handling in ssi_sd_realize

2020-03-17 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > It's wrong to use same err object as errp parameter for several > function calls without intermediate checking for error: we'll crash if > try to set err object twice. Fix that. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > > Forgive me for

[PULL 1/1] block/io: fix bdrv_co_do_copy_on_readv

2020-03-17 Thread Stefan Hajnoczi
From: Vladimir Sementsov-Ogievskiy Prior to 1143ec5ebf4 it was OK to qemu_iovec_from_buf() from aligned-up buffer to original qiov, as qemu_iovec_from_buf() will stop at qiov end anyway. But after 1143ec5ebf4 we assume that bdrv_co_do_copy_on_readv works on part of original qiov, defined by

Re: [PATCH v3 2/8] hw/isa/piix4.c: Introduce variable to store devfn

2020-03-17 Thread Philippe Mathieu-Daudé
On 3/17/20 4:05 PM, BALATON Zoltan wrote: To avoid any problem with reassigning pci variable store devfn in a variable instead of acessing it from the PCIDevice. Signed-off-by: BALATON Zoltan --- hw/isa/piix4.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git

[PATCH v10 2/9] scripts: Coccinelle script to use ERRP_AUTO_PROPAGATE()

2020-03-17 Thread Vladimir Sementsov-Ogievskiy
Script adds ERRP_AUTO_PROPAGATE macro invocation where appropriate and does corresponding changes in code (look for details in include/qapi/error.h) Usage example: spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \ --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff \

[PATCH v10 1/9] error: auto propagated local_err

2020-03-17 Thread Vladimir Sementsov-Ogievskiy
Introduce a new ERRP_AUTO_PROPAGATE macro, to be used at start of functions with an errp OUT parameter. It has three goals: 1. Fix issue with error_fatal and error_prepend/error_append_hint: user can't see this additional information, because exit() happens in error_setg earlier than information

[PULL 0/1] Block patches

2020-03-17 Thread Stefan Hajnoczi
The following changes since commit 61c265f0660ee476985808c8aa7915617c44fd53: Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20200313a' into staging (2020-03-13 10:33:04 +) are available in the Git repository at: https://github.com/stefanha/qemu.git

[PATCH v10 8/9] nbd: introduce ERRP_AUTO_PROPAGATE

2020-03-17 Thread Vladimir Sementsov-Ogievskiy
If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == _fatal (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. If we want to

[PATCH v10 0/9] error: auto propagated local_err part I

2020-03-17 Thread Vladimir Sementsov-Ogievskiy
v10: (based-on "[PATCH 0/3] Minor error handling cleanups" including my 4/3 in it) 02: Change some comments. Do not chain check1 and check2 rules to rule1 to cover move unusual cases to warn about. Add positions to check1 rule. Move check1 and check2 above rule1, otherwise our ___

[PATCH v10 4/9] pflash: introduce ERRP_AUTO_PROPAGATE

2020-03-17 Thread Vladimir Sementsov-Ogievskiy
If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == _fatal (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. If we want to

[PATCH v3 6/8] hw/ide: Do ide_drive_get() within pci_ide_create_devs()

2020-03-17 Thread BALATON Zoltan
The pci_ide_create_devs() function takes a hd_table parameter but all callers just pass what ide_drive_get() returns so we can do it locally simplifying callers and removing hd_table parameter. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Markus Armbruster ---

[PATCH v3 4/8] hw/ide: Remove now unneded #include "hw/pci/pci.h" from hw/ide.h

2020-03-17 Thread BALATON Zoltan
After previous patches we don't need hw/pci/pci.h any more in hw/ide.h. Some files depended on implicit inclusion by this header which are also fixed up here. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster ---

[PATCH v3 3/8] hw/ide: Get rid of piix4_init function

2020-03-17 Thread BALATON Zoltan
This removes pci_piix4_ide_init() function similar to clean up done to other ide devices. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Markus Armbruster --- hw/ide/piix.c| 12 +--- hw/isa/piix4.c | 4 +++- include/hw/ide.h | 1 - 3 files changed, 4

[PATCH v3 7/8] hw/ide: Move MAX_IDE_DEVS define to hw/ide/internal.h

2020-03-17 Thread BALATON Zoltan
We can move this define now that less files use it to internal.h to further reduce dependency on hw/ide.h. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Markus Armbruster --- hw/mips/mips_r4k.c| 1 + include/hw/ide.h | 2 --

[PATCH v3 8/8] hw/ide: Remove unneeded inclusion of hw/ide.h

2020-03-17 Thread BALATON Zoltan
After previous clean ups we can drop direct inclusion of hw/ide.h from several places. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Markus Armbruster --- hw/hppa/hppa_sys.h | 1 - hw/hppa/machine.c | 1 - hw/i386/pc_piix.c | 1 - hw/isa/piix4.c

[PATCH v3 1/8] hw/ide: Get rid of piix3_init functions

2020-03-17 Thread BALATON Zoltan
This removes pci_piix3_ide_init() and pci_piix3_xen_ide_init() functions similar to clean up done to other ide devices. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster --- hw/i386/pc_piix.c | 10 +-

[PATCH v3 2/8] hw/isa/piix4.c: Introduce variable to store devfn

2020-03-17 Thread BALATON Zoltan
To avoid any problem with reassigning pci variable store devfn in a variable instead of acessing it from the PCIDevice. Signed-off-by: BALATON Zoltan --- hw/isa/piix4.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index

[PATCH v3 5/8] hw/ide/pci.c: Coding style update to fix checkpatch errors

2020-03-17 Thread BALATON Zoltan
Spaces are required around a + operator and if statements should have braces even for single line. Also make it simpler by reversing the condition instead of breaking the loop. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus

[PATCH v3 0/8] Misc hw/ide legacy clean up

2020-03-17 Thread BALATON Zoltan
Avoid problems from reassigning variable in piix4_create and fix compilation problem with mips_r4k BALATON Zoltan (8): hw/ide: Get rid of piix3_init functions hw/isa/piix4.c: Introduce variable to store devfn hw/ide: Get rid of piix4_init function hw/ide: Remove now unneded #include

Re: [PULL 00/10] Bitmaps patches

2020-03-17 Thread Daniel P . Berrangé
On Tue, Mar 17, 2020 at 03:07:34PM +, Peter Maydell wrote: > On Tue, 17 Mar 2020 at 15:05, Daniel P. Berrangé wrote: > > > > On Tue, Mar 17, 2020 at 03:00:48PM +, Peter Maydell wrote: > > > On Tue, 17 Mar 2020 at 14:57, Daniel P. Berrangé > > > wrote: > > > > I don't feel like

Re: [PATCH v10 4/3] hw/sd/ssi-sd: fix error handling in ssi_sd_realize

2020-03-17 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > It's wrong to use same err object as errp parameter for several > function calls without intermediate checking for error: we'll crash if > try to set err object twice. Fix that. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > > Forgive me for

Re: [PULL 00/10] Bitmaps patches

2020-03-17 Thread Peter Maydell
On Tue, 17 Mar 2020 at 15:05, Daniel P. Berrangé wrote: > > On Tue, Mar 17, 2020 at 03:00:48PM +, Peter Maydell wrote: > > On Tue, 17 Mar 2020 at 14:57, Daniel P. Berrangé > > wrote: > > > I don't feel like -Wno-unused-function looses anything significant, as > > > the GCC builds will still

Re: [PULL 00/10] Bitmaps patches

2020-03-17 Thread Peter Maydell
On Tue, 17 Mar 2020 at 14:57, Daniel P. Berrangé wrote: > I don't feel like -Wno-unused-function looses anything significant, as > the GCC builds will still be reporting unused functions which will > catch majority of cases. The most interesting difference is that clang will catch unused static

Re: [PATCH v3 1/4] scripts/simplebench: add simplebench.py

2020-03-17 Thread Vladimir Sementsov-Ogievskiy
17.03.2020 17:40, Aleksandar Markovic wrote: On Mon, Mar 2, 2020 at 10:05 PM Aleksandar Markovic wrote: + + +def ascii_one(result): +"""Return ASCII representation of bench_one() returned dict.""" +if 'average' in result: +s = '{:.2f} +- {:.2f}'.format(result['average'],

Re: [PULL 00/10] Bitmaps patches

2020-03-17 Thread Daniel P . Berrangé
On Tue, Mar 17, 2020 at 09:40:00AM -0500, Eric Blake wrote: > On 3/17/20 9:00 AM, Peter Maydell wrote: > > On Tue, 17 Mar 2020 at 04:38, John Snow wrote: > > > > > > >block/qcow2-bitmap: use bdrv_dirty_bitmap_next_dirty (2020-03-12 > > > 16:36:46 -0400) > > > > > >

Re: [PATCH v2 2/7] hw/ide: Get rid of piix4_init function

2020-03-17 Thread Mark Cave-Ayland
On 17/03/2020 14:07, BALATON Zoltan wrote: > On Tue, 17 Mar 2020, Philippe Mathieu-Daudé wrote: >> On 3/17/20 2:50 PM, John Snow wrote: >>> On 3/17/20 6:49 AM, Philippe Mathieu-Daudé wrote: On 3/17/20 11:41 AM, Philippe Mathieu-Daudé wrote: > On 3/17/20 10:39 AM, BALATON Zoltan wrote:

Re: [PATCH v3 1/4] scripts/simplebench: add simplebench.py

2020-03-17 Thread Aleksandar Markovic
On Mon, Mar 2, 2020 at 10:05 PM Aleksandar Markovic wrote: > > > > > > >> + > > >> + > > >> +def ascii_one(result): > > >> +"""Return ASCII representation of bench_one() returned dict.""" > > >> +if 'average' in result: > > >> +s = '{:.2f} +- {:.2f}'.format(result['average'], > >

Re: [PULL 00/10] Bitmaps patches

2020-03-17 Thread Eric Blake
On 3/17/20 9:00 AM, Peter Maydell wrote: On Tue, 17 Mar 2020 at 04:38, John Snow wrote: block/qcow2-bitmap: use bdrv_dirty_bitmap_next_dirty (2020-03-12 16:36:46 -0400) Pull request

Re: [PATCH v2 6/7] hw/ide: Move MAX_IDE_DEVS define to hw/ide/internal.h

2020-03-17 Thread John Snow
On 3/17/20 10:24 AM, BALATON Zoltan wrote: > On Tue, 17 Mar 2020, John Snow wrote: >> On 3/17/20 5:39 AM, BALATON Zoltan wrote: >>> We can move this define now that less files use it to internal.h to >>> further reduce dependency on hw/ide.h. >>> >>> Signed-off-by: BALATON Zoltan >>>

Re: [PATCH v2 6/7] hw/ide: Move MAX_IDE_DEVS define to hw/ide/internal.h

2020-03-17 Thread BALATON Zoltan
On Tue, 17 Mar 2020, John Snow wrote: On 3/17/20 5:39 AM, BALATON Zoltan wrote: We can move this define now that less files use it to internal.h to further reduce dependency on hw/ide.h. Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Reviewed-by: Markus Armbruster ---

  1   2   >