[RFC PATCH v2 18/26] qcow2: Add subcluster support to expand_zero_clusters_in_l1()

2019-10-26 Thread Alberto Garcia
Two changes are needed in order to add subcluster support to this function: deallocated clusters must have their bitmaps cleared, and expanded clusters must have all the "subcluster allocated" bits set. Signed-off-by: Alberto Garcia --- block/qcow2-cluster.c | 2 ++ 1 file changed, 2 insertions(

[RFC PATCH v2 11/26] qcow2: Add qcow2_get_subcluster_type()

2019-10-26 Thread Alberto Garcia
This function returns the type of an individual subcluster. If an image does not have subclusters then this returns the exact same value as qcow2_get_cluster_type(). The information in standard and extended L2 entries is encoded in a slightly different way, but all existing QCow2ClusterType values

[RFC PATCH v2 09/26] qcow2: Add l2_entry_size()

2019-10-26 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 function

[RFC PATCH v2 17/26] qcow2: Add subcluster support to check_refcounts_l2()

2019-10-26 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 --- block/qcow2-refcount.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/block/qcow2-refc

[RFC PATCH v2 04/26] qcow2: Add get_l2_entry() and set_l2_entry()

2019-10-26 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 get_l2_entr

Re: [RFC 1/3] WIP virtiofsd: import Linux header file

2019-10-26 Thread Michael S. Tsirkin
On Fri, Oct 25, 2019 at 12:01:50PM +0200, Stefan Hajnoczi wrote: > tests/vhost-user-fs-test.c needs fuse.h. The private copy that > virtiofsd has can be replaced with a properly imported file using > update-linux-headers.sh. > > TODO rerun update-linux-headers.sh with upstream kernel tree! > > S

[PULL 17/25] libqos: access VIRTIO 1.0 vring in little-endian

2019-10-26 Thread Michael S. Tsirkin
From: Stefan Hajnoczi VIRTIO 1.0 uses little-endian for the vring. Legacy VIRTIO uses guest endianness. Adjust the code to handle both. Note that qvirtio_readq() is not defined because it has no users. All the other accessors are really needed. Signed-off-by: Stefan Hajnoczi Reviewed-by: Th

[RFC PATCH v2 10/26] qcow2: Update get/set_l2_entry() and add get/set_l2_bitmap()

2019-10-26 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 th

[PULL 18/25] libqos: add iteration support to qpci_find_capability()

2019-10-26 Thread Michael S. Tsirkin
From: Stefan Hajnoczi VIRTIO 1.0 PCI devices have multiple PCI_CAP_ID_VNDR capabilities so we need a way to iterate over them. Extend qpci_find_capability() to take the last address. Signed-off-by: Stefan Hajnoczi Reviewed-by: Thomas Huth -- v3: * Document qpci_find_capability() Message-Id:

[RFC PATCH v2 01/26] qcow2: Add calculate_l2_meta()

2019-10-26 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 --- block/qcow2-cluster.c | 76 +++

[Bug 1850000] [NEW] 4.1.0 bogus QCOW2 corruption reported after compress

2019-10-26 Thread Toolybird
Public bug reported: Creating a compressed image then running `qemu-img check <..>.qcow2' on said image seems to report bogus corruption in some (but not all) cases: Step 1. # qemu-img info win7-base.qcow2 image: win7-base.qcow2 file format: qcow2 virtual size: 20 GiB (21474836480 bytes) disk si

[RFC PATCH v2 12/26] qcow2: Handle QCOW2_CLUSTER_UNALLOCATED_SUBCLUSTER

2019-10-26 Thread Alberto Garcia
In the previous patch we added a new QCow2ClusterType named QCOW2_CLUSTER_UNALLOCATED_SUBCLUSTER. There is a couple of places where this new value needs to be handled, and that is what this patch does. Signed-off-by: Alberto Garcia --- block/qcow2.c | 13 + 1 file changed, 9 insertio

[RFC PATCH v2 07/26] qcow2: Add subcluster-related fields to BDRVQcow2State

2019-10-26 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

[RFC PATCH v2 23/26] qcow2: Restrict qcow2_co_pwrite_zeroes() to full clusters only

2019-10-26 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 --- block/qcow2.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/block/qcow2.c b/block/qcow2.c index 01322ca449..537569ce88 100644 ---

[RFC PATCH v2 00/26] Add subcluster allocation to qcow2

2019-10-26 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 This version includes a few tests, but I'm

[PULL 16/25] libqos: implement VIRTIO 1.0 FEATURES_OK step

2019-10-26 Thread Michael S. Tsirkin
From: Stefan Hajnoczi Device initialization has an extra step in VIRTIO 1.0. The FEATURES_OK status bit is set to indicate that feature negotiation has completed. The driver then reads the status register again to check that the device agrees with the final features. Implement this step as part

[PULL 21/25] libqos: expose common virtqueue setup/cleanup functions

2019-10-26 Thread Michael S. Tsirkin
From: Stefan Hajnoczi The VIRTIO 1.0 code will need to perform additional steps but it will reuse the common virtqueue setup/cleanup code. Make these functions public. Make sure to invoke callbacks via QVirtioBus instead of directly calling the virtio-pci Legacy versions of these functions. Si

[PULL 22/25] libqos: make the virtio-pci BAR index configurable

2019-10-26 Thread Michael S. Tsirkin
From: Stefan Hajnoczi The Legacy virtio-pci interface always uses BAR 0. VIRTIO 1.0 may need to use a different BAR index, so make it configurable. Signed-off-by: Stefan Hajnoczi Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20191023100425.12168-15-stefa...@redhat

[PULL 23/25] libqos: extract Legacy virtio-pci.c code

2019-10-26 Thread Michael S. Tsirkin
From: Stefan Hajnoczi The current libqos virtio-pci.c code implements the VIRTIO Legacy interface. Extract existing code in preparation for VIRTIO 1.0 support. Signed-off-by: Stefan Hajnoczi Reviewed-by: Sergio Lopez Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-Id: <

[PULL 24/25] libqos: add VIRTIO PCI 1.0 support

2019-10-26 Thread Michael S. Tsirkin
From: Stefan Hajnoczi Implement the VIRTIO 1.0 virtio-pci interface. The main change here is that the register layout is no longer a fixed layout in BAR 0. Instead we have to iterate of PCI Capabilities to find descriptions of where various registers are located. The vring registers are also m

Re: [PATCH v15 00/11] hw/m68k: add Apple Machintosh Quadra 800 machine

2019-10-26 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20191026164546.30020-1-laur...@vivier.eu/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [PATCH v15 00/11] hw/m68k: add Apple Machintosh Quadra 800 machine Type: series Message-id: 20191026164546.3

[Bug 1850000] Re: 4.1.0 bogus QCOW2 corruption reported after compress

2019-10-26 Thread Toolybird
Current trunk still displays the problem. A git bisection between 4.0.0 and 4.1.0 revealed: b6c246942b14d3e0dec46a6c5868ed84e7dbea19 is the first bad commit commit b6c246942b14d3e0dec46a6c5868ed84e7dbea19 Author: Alberto Garcia Date: Fri May 10 19:22:54 2019 +0300 qcow2: Define and use QC

qemu-img still misbehaving on Windows

2019-10-26 Thread Adam Baxter
Hi, I've attached some example files to https://bugs.launchpad.net/qemu/+bug/1759522 - the bug still exists in qemu 4.1.0. Thanks, Adam

[Bug 1759522] Re: windows qemu-img create vpc/vhdx error

2019-10-26 Thread Adam Baxter
Can confirm this is still an issue with 4.1.0. ?field.comment=Can confirm this is still an issue with 4.1.0. ** Attachment added: "Files created on Windows and Debian" https://bugs.launchpad.net/qemu/+bug/1759522/+attachment/5300530/+files/vhdx_comparison.7z -- You received this bug notifi

<    1   2