Re: [PATCH 2/2] core: replace getpagesize() with qemu_real_host_page_size

2019-10-14 Thread Wei Yang
On Mon, Oct 14, 2019 at 10:15:02AM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> There are three page size in qemu: >> >> real host page size >> host page size >> target page size >> >> All of them have dedicate variable to represent. For the

Re: [PATCH 0/2] cleanup on page size

2019-10-14 Thread Wei Yang
Hi, All, I got one page size related question, hope to get some hint. There is one comment in page_size_init(). /* NOTE: we can always suppose that qemu_host_page_size >= TARGET_PAGE_SIZE */ The final result is true, since we compare qemu_host_page_size with TARGET_PAGE_SIZE and if

Re: [PATCH 2/2] core: replace getpagesize() with qemu_real_host_page_size

2019-10-14 Thread Richard Henderson
On 10/14/19 2:36 PM, Wei Yang wrote: > On Mon, Oct 14, 2019 at 10:15:02AM +0100, Dr. David Alan Gilbert wrote: >> We also use sysconf(_SC_PAGESIZE) in a few places. > > You mean need to replace them too? I would say so, as a separate patch. r~

[PATCH 0/2] replace sysconf(_SC_PAGESIZE) with qemu_real_host_page_size

2019-10-14 Thread Wei Yang
This is a following up patch to cleanup page size, suggested by "Dr. David Alan Gilbert" . Patch 2 does the job, while during the cleanup I found test-mmap.c has quite a lot code style problem. To make the code looks good, patch 1 is introduced to make checkpatch.pl happy a little. Wei Yang (2):

Re: [PATCH v4 0/7] iotests: Selfish patches

2019-10-14 Thread Andrey Shinkevich
On 14/10/2019 17:59, Max Reitz wrote: > On 17.09.19 11:19, Max Reitz wrote: >> Hi, >> >> Again, let me start with a link to an actually explanatory cover letter: >> https://lists.nongnu.org/archive/html/qemu-block/2019-06/msg01102.html >> >> v3: >>

[PATCH 1/2] tests/tcg/multiarch: fix code style in function main of test-mmap.c

2019-10-14 Thread Wei Yang
This file uses quite a different code style and changing just one line would leads to some awkward appearance. This is a preparation for the following replacement of sysconf(_SC_PAGESIZE). BTW, to depress ERROR message from checkpatch.pl, this patch replaces strtoul with qemu_strtoul.

[PATCH 2/2] core: replace sysconf(_SC_PAGESIZE) with qemu_real_host_page_size

2019-10-14 Thread Wei Yang
Signed-off-by: Wei Yang Suggested-by: "Dr. David Alan Gilbert" CC: Richard Henderson --- block/file-posix.c | 2 +- net/l2tpv3.c| 2 +- tests/tcg/multiarch/test-mmap.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/block/file-posix.c

Re: [PATCH 4/4] qemu-nbd: Support help options for --object

2019-10-14 Thread Kevin Wolf
Am 11.10.2019 um 23:39 hat Eric Blake geschrieben: > On 10/11/19 3:55 PM, Kevin Wolf wrote: > > Instead of parsing help options as normal object properties and > > returning an error, provide the same help functionality as the system > > emulator in qemu-nbd, too. > > > > Signed-off-by: Kevin

Re: [PATCH v2] iotests/028: Fix for long $TEST_DIRs

2019-10-14 Thread Kevin Wolf
Am 11.10.2019 um 14:18 hat Max Reitz geschrieben: > For long test image paths, the order of the "Formatting" line and the > "(qemu)" prompt after a drive_backup HMP command may be reversed. In > fact, the interaction between the prompt and the line may lead to the > "Formatting" to being

Re: [PATCH] block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK

2019-10-14 Thread Vladimir Sementsov-Ogievskiy
13.10.2019 23:48, Alberto Garcia wrote: > The BDRV_REQ_NO_FALLBACK flag means that an operation should only be > performed if it can be offloaded or otherwise performed efficiently. As I know, BDRV_REQ_NO_FALLBACK is for write-zeros only, not about offloading.. > > However a misaligned write

Re: [PATCH] block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK

2019-10-14 Thread Alberto Garcia
On Mon 14 Oct 2019 12:11:52 PM CEST, Vladimir Sementsov-Ogievskiy wrote: > 13.10.2019 23:48, Alberto Garcia wrote: >> The BDRV_REQ_NO_FALLBACK flag means that an operation should only be >> performed if it can be offloaded or otherwise performed efficiently. > > As I know, BDRV_REQ_NO_FALLBACK is

Re: [PULL 1/1] test-bdrv-drain: fix iothread_join() hang

2019-10-14 Thread Paolo Bonzini
On 14/10/19 10:52, Stefan Hajnoczi wrote: > tests/test-bdrv-drain can hang in tests/iothread.c:iothread_run(): > > while (!atomic_read(>stopping)) { > aio_poll(iothread->ctx, true); > } > > The iothread_join() function works as follows: > > void iothread_join(IOThread *iothread) >

Re: [PATCH 4/5] iotests: Skip "make check-block" if QEMU does not support virtio-blk

2019-10-14 Thread Kevin Wolf
Am 11.10.2019 um 16:50 hat Thomas Huth geschrieben: > The next patch is going to add some python-based tests to the "auto" > group, and these tests require virtio-blk to work properly. Running > iotests without virtio-blk likely does not make too much sense anyway, > so instead of adding a check

[PATCH] tests: fix iothread_join() race condition

2019-10-14 Thread Paolo Bonzini
This is a similar race condition to the one fixed in commit 2362a28ea1 ("iothread: fix iothread_stop() race condition", 2017-12-19), which in this case was exposed as a failure in test-aio-multithread. Here, the iothread->stopping flag was set too soon, and the AioContext could be destroyed

Re: [PATCH 4/5] iotests: Skip "make check-block" if QEMU does not support virtio-blk

2019-10-14 Thread Thomas Huth
On 14/10/2019 13.21, Kevin Wolf wrote: > Am 11.10.2019 um 16:50 hat Thomas Huth geschrieben: >> The next patch is going to add some python-based tests to the "auto" >> group, and these tests require virtio-blk to work properly. Running >> iotests without virtio-blk likely does not make too much

Re: [PATCH 1/4] vl: Split off user_creatable_print_help()

2019-10-14 Thread Kevin Wolf
Am 11.10.2019 um 23:35 hat Eric Blake geschrieben: > On 10/11/19 3:55 PM, Kevin Wolf wrote: > > Printing help for --object is something that we don't only want in the > > s/don't/not/ Can someone send a fix for the English grammar? It's obviously broken and doesn't know what it wants. Actually,

Re: [PATCH] block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK

2019-10-14 Thread Vladimir Sementsov-Ogievskiy
14.10.2019 13:11, Vladimir Sementsov-Ogievskiy wrote: > 13.10.2019 23:48, Alberto Garcia wrote: >> The BDRV_REQ_NO_FALLBACK flag means that an operation should only be >> performed if it can be offloaded or otherwise performed efficiently. > > As I know, BDRV_REQ_NO_FALLBACK is for write-zeros

Re: [RFC v5 000/126] error: auto propagated local_err

2019-10-14 Thread Vladimir Sementsov-Ogievskiy
11.10.2019 20:02, Eric Blake wrote: > On 10/11/19 11:03 AM, Vladimir Sementsov-Ogievskiy wrote: >> Hi all! >> >> At the request of Markus: full version of errp propagation. Let's look >> at it. Cover as much as possible, except inserting macro invocation >> where it's not necessary. >> >> It's

Re: [PATCH 2/2] core: replace getpagesize() with qemu_real_host_page_size

2019-10-14 Thread Dr. David Alan Gilbert
* Wei Yang (richardw.y...@linux.intel.com) wrote: > There are three page size in qemu: > > real host page size > host page size > target page size > > All of them have dedicate variable to represent. For the last two, we > use the same form in the whole qemu project, while for the first

Re: [RFC v5 000/126] error: auto propagated local_err

2019-10-14 Thread Vladimir Sementsov-Ogievskiy
12.10.2019 5:10, no-re...@patchew.org wrote: > Patchew URL: > https://patchew.org/QEMU/20191011160552.22907-1-vsement...@virtuozzo.com/ > > > > Hi, > > This series failed the docker-quick@centos7 build test. Please find the > testing commands and > their output below. If you have Docker

[PULL 1/1] test-bdrv-drain: fix iothread_join() hang

2019-10-14 Thread Stefan Hajnoczi
tests/test-bdrv-drain can hang in tests/iothread.c:iothread_run(): while (!atomic_read(>stopping)) { aio_poll(iothread->ctx, true); } The iothread_join() function works as follows: void iothread_join(IOThread *iothread) { iothread->stopping = true;

[PULL 0/1] Block patches

2019-10-14 Thread Stefan Hajnoczi
The following changes since commit 98b2e3c9ab3abfe476a2b02f8f51813edb90e72d: Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2019-10-08 16:08:35 +0100) are available in the Git repository at: https://github.com/stefanha/qemu.git tags/block-pull-request

[PULL 0/2] Tracing patches

2019-10-14 Thread Stefan Hajnoczi
The following changes since commit 98b2e3c9ab3abfe476a2b02f8f51813edb90e72d: Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2019-10-08 16:08:35 +0100) are available in the Git repository at: https://github.com/stefanha/qemu.git

[PULL 2/2] trace: avoid "is" with a literal Python 3.8 warnings

2019-10-14 Thread Stefan Hajnoczi
The following statement produces a SyntaxWarning with Python 3.8: if len(format) is 0: scripts/tracetool/__init__.py:459: SyntaxWarning: "is" with a literal. Did you mean "=="? Use the conventional len(x) == 0 syntax instead. Reported-by: Daniel P. Berrangé Reviewed-by: Daniel P. Berrangé

Re: [PULL 1/2] trace: add --group=all to tracing.txt

2019-10-14 Thread Philippe Mathieu-Daudé
Hi Stefan, On 10/14/19 10:57 AM, Stefan Hajnoczi wrote: tracetool needs to know the group name ("all", "root", or a specific subdirectory). Also remove the stdin redirection because tracetool.py needs the path to the trace-events file. Update the documentation. Fixes:

Re: [RFC v5 025/126] scripts: add coccinelle script to use auto propagated errp

2019-10-14 Thread Vladimir Sementsov-Ogievskiy
11.10.2019 20:12, Eric Blake wrote: > On 10/11/19 11:04 AM, Vladimir Sementsov-Ogievskiy wrote: >> Signed-off-by: Vladimir Sementsov-Ogievskiy >> --- >> > >>   scripts/coccinelle/auto-propagated-errp.cocci | 118 ++ >>   1 file changed, 118 insertions(+) >>   create mode 100644

Re: [PATCH v3 07/16] qcow2: Write v3-compliant snapshot list on upgrade

2019-10-14 Thread Max Reitz
On 11.10.19 18:23, Eric Blake wrote: > On 10/11/19 10:28 AM, 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. >> >>

Re: [RFC v5 000/126] error: auto propagated local_err

2019-10-14 Thread Vladimir Sementsov-Ogievskiy
12.10.2019 5:52, no-re...@patchew.org wrote: > Patchew URL: > https://patchew.org/QEMU/20191011160552.22907-1-vsement...@virtuozzo.com/ > > > > Hi, > > This series seems to have some coding style problems. See output below for > more information: > > Subject: [RFC v5 000/126] error: auto

Re: [PATCH v2] block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK

2019-10-14 Thread Kevin Wolf
Am 14.10.2019 um 10:15 hat Alberto Garcia geschrieben: > The BDRV_REQ_NO_FALLBACK flag means that an operation should only be > performed if it can be offloaded or otherwise performed efficiently. > > However a misaligned write request requires a RMW so we should return > an error and let the

[PATCH v2] block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK

2019-10-14 Thread Alberto Garcia
The BDRV_REQ_NO_FALLBACK flag means that an operation should only be performed if it can be offloaded or otherwise performed efficiently. However a misaligned write request requires a RMW so we should return an error and let the caller decide how to proceed. This hits an assertion since commit

Re: [PATCH v2] block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK

2019-10-14 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20191014081545.29694-1-be...@igalia.com/ Hi, This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN === #!

[PULL 1/2] trace: add --group=all to tracing.txt

2019-10-14 Thread Stefan Hajnoczi
tracetool needs to know the group name ("all", "root", or a specific subdirectory). Also remove the stdin redirection because tracetool.py needs the path to the trace-events file. Update the documentation. Fixes: 2098c56a9bc5901e145fa5d4759f075808811685 ("trace: move setting of group

[PATCH v2 2/2] iotests: add 269 to check maximum of bitmaps in qcow2

2019-10-14 Thread Vladimir Sementsov-Ogievskiy
Check that it's impossible to create more persistent bitmaps than qcow2 supports. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/269 | 47 ++ tests/qemu-iotests/269.out | 3 +++ tests/qemu-iotests/group | 1 + 3 files changed, 51

Re: [PATCH v2] block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK

2019-10-14 Thread Alberto Garcia
On Mon 14 Oct 2019 11:26:01 AM CEST, Kevin Wolf wrote: >> Signed-off-by: Alberto Garcia > > Thanks, applied to the block branch. I'm a bit late now, but a possible trivial optimization is to flip the conditions, because checking the flag should be faster than checking the alignment and it's

[PATCH v2 0/2] fix qcow2_can_store_new_dirty_bitmap

2019-10-14 Thread Vladimir Sementsov-Ogievskiy
Hi all! Here is a fix for persistent bitmaps managing: we must check existent but not yet stored bitmaps for qcow2-related constraints, like maximum number of bitmaps in qcow2 image. v2: 01: change assertion to error-return at function start Be free to add Reported-by: aihua liang

[PATCH v2 1/2] qcow2-bitmaps: fix qcow2_can_store_new_dirty_bitmap

2019-10-14 Thread Vladimir Sementsov-Ogievskiy
qcow2_can_store_new_dirty_bitmap works wrong, as it considers only bitmaps already stored in the qcow2 image and ignores persistent BdrvDirtyBitmap objects. So, let's instead count persistent BdrvDirtyBitmaps. We load all qcow2 bitmaps on open, so there should not be any bitmap in the image for

Re: [PATCH v2 0/2] fix qcow2_can_store_new_dirty_bitmap

2019-10-14 Thread Vladimir Sementsov-Ogievskiy
14.10.2019 14:51, Vladimir Sementsov-Ogievskiy wrote: > Hi all! > > Here is a fix for persistent bitmaps managing: we must check existent > but not yet stored bitmaps for qcow2-related constraints, like maximum > number of bitmaps in qcow2 image. > > v2: main thing based on

Re: [PULL 00/36] Block patches

2019-10-14 Thread Peter Maydell
On Thu, 10 Oct 2019 at 12:43, Max Reitz wrote: > > The following changes since commit 98b2e3c9ab3abfe476a2b02f8f51813edb90e72d: > > Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' > into staging (2019-10-08 16:08:35 +0100) > > are available in the Git repository at: > >

Re: [PATCH 1/4] vl: Split off user_creatable_print_help()

2019-10-14 Thread Eric Blake
On 10/14/19 4:55 AM, Kevin Wolf wrote: Am 11.10.2019 um 23:35 hat Eric Blake geschrieben: On 10/11/19 3:55 PM, Kevin Wolf wrote: Printing help for --object is something that we don't only want in the s/don't/not/ Can someone send a fix for the English grammar? It's obviously broken and

Re: [PATCH 4/5] iotests: Skip "make check-block" if QEMU does not support virtio-blk

2019-10-14 Thread Kevin Wolf
Am 14.10.2019 um 13:27 hat Thomas Huth geschrieben: > On 14/10/2019 13.21, Kevin Wolf wrote: > > Am 11.10.2019 um 16:50 hat Thomas Huth geschrieben: > >> The next patch is going to add some python-based tests to the "auto" > >> group, and these tests require virtio-blk to work properly. Running >

[PATCH 05/20] hw/timer: Remove unused "ui/console.h" header

2019-10-14 Thread Philippe Mathieu-Daudé
The timer models don't need anything from "ui/console.h". Remove it. Signed-off-by: Philippe Mathieu-Daudé --- hw/timer/hpet.c | 1 - hw/timer/twl92230.c | 1 - 2 files changed, 2 deletions(-) diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c index 1ddae4e7d7..4772cccfe3 100644 ---

[PATCH 11/20] hw/hppa/machine: Include "net/net.h"

2019-10-14 Thread Philippe Mathieu-Daudé
hw/hppa/machine.c uses NICInfo variables which are declared in "net/net.h". Include it. This fixes (when modifying unrelated headers): hw/hppa/machine.c:126:21: error: use of undeclared identifier 'nb_nics' for (i = 0; i < nb_nics; i++) { ^

[PATCH 08/20] hw/xen/xen_pt_load_rom: Remove unused includes

2019-10-14 Thread Philippe Mathieu-Daudé
xen_pt_load_rom.c does not use any of these includes, remove them. Signed-off-by: Philippe Mathieu-Daudé --- hw/xen/xen_pt_load_rom.c | 4 1 file changed, 4 deletions(-) diff --git a/hw/xen/xen_pt_load_rom.c b/hw/xen/xen_pt_load_rom.c index 307a5c93e2..a50a80837e 100644 ---

[PATCH 09/20] hw/alpha/alpha_sys: Remove unused "hw/ide.h" header

2019-10-14 Thread Philippe Mathieu-Daudé
alpha_sys.h does not use anything from the "hw/ide.h" header. Remove it. Signed-off-by: Philippe Mathieu-Daudé --- hw/alpha/alpha_sys.h | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h index 4e127a6de8..9991535c0d 100644 --- a/hw/alpha/alpha_sys.h

[PATCH 16/20] hw/pci-host/piix: Include "qemu/range.h"

2019-10-14 Thread Philippe Mathieu-Daudé
hw/pci-host/piix.c calls various functions from the Range API. Include "qemu/range.h" which declares them. This fixes (when modifying unrelated headers): hw/pci-host/i440fx.c:54:11: error: field has incomplete type 'Range' (aka 'struct Range') Range pci_hole; ^

[PATCH 15/20] hw/i2c/smbus_ich9: Include "qemu/range.h"

2019-10-14 Thread Philippe Mathieu-Daudé
hw/i2c/smbus_ich9.c calls range_covers_byte(). Include "qemu/range.h" which declares it. This fixes (when modifying unrelated headers): hw/i2c/smbus_ich9.c:66:9: error: implicit declaration of function 'range_covers_byte' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if

[PATCH 19/20] hw/pci-host/q35: Remove unused includes

2019-10-14 Thread Philippe Mathieu-Daudé
Only q35.c requires declarations from "hw/i386/pc.h", move it there. Remove all the includes not used by "q35.h". Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/q35.c | 1 + include/hw/pci-host/q35.h | 7 --- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git

[PATCH 14/20] hw/pci-host/q35: Include "qemu/range.h"

2019-10-14 Thread Philippe Mathieu-Daudé
The MCHPCIState structure uses the Range type which is declared in "qemu/range.h". Include it. This fixes (when modifying unrelated headers): In file included from hw/pci-host/q35.c:32: include/hw/pci-host/q35.h:57:11: error: field has incomplete type 'Range' (aka 'struct Range')

[PATCH 13/20] hw/timer/hpet: Include "exec/address-spaces.h"

2019-10-14 Thread Philippe Mathieu-Daudé
hw/timer/hpet.c calls address_space_stl_le() declared in "exec/address-spaces.h". Include it. This fixes (when modifying unrelated headers): hw/timer/hpet.c:210:31: error: use of undeclared identifier 'address_space_memory' address_space_stl_le(_space_memory, timer->fsb >> 32,

[PATCH 17/20] hw/acpi: Include "hw/mem/nvdimm.h"

2019-10-14 Thread Philippe Mathieu-Daudé
Both ich9.c and piix4.c use methods/definitions declared in the NVDIMM device header. Include it. This fixes (when modifying unrelated headers): hw/acpi/ich9.c:507:46: error: use of undeclared identifier 'TYPE_NVDIMM' if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) {

Re: [PATCH v3 07/16] qcow2: Write v3-compliant snapshot list on upgrade

2019-10-14 Thread Eric Blake
On 10/14/19 3:45 AM, Max Reitz wrote: +    need_snapshot_update = false; +    for (i = 0; i < s->nb_snapshots; i++) { +    if (s->snapshots[i].extra_data_size < +    sizeof_field(QCowSnapshotExtraData, vm_state_size_large) + +    sizeof_field(QCowSnapshotExtraData,

Re: [RFC v5 025/126] scripts: add coccinelle script to use auto propagated errp

2019-10-14 Thread Eric Blake
On 10/14/19 3:19 AM, Vladimir Sementsov-Ogievskiy wrote: +| +-    error_propagate(errp, local_err); +) + ...> + } + It looks like once this script is run, error_propagate_prepend() will have no clients. No, it still have a bit, when working with error_copy, and/or moving errors

Re: [PATCH v3 07/16] qcow2: Write v3-compliant snapshot list on upgrade

2019-10-14 Thread Max Reitz
On 14.10.19 15:53, Eric Blake wrote: > On 10/14/19 3:45 AM, Max Reitz wrote: > +    need_snapshot_update = false; +    for (i = 0; i < s->nb_snapshots; i++) { +    if (s->snapshots[i].extra_data_size < +    sizeof_field(QCowSnapshotExtraData, vm_state_size_large) +

Re: [PATCH v2] block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK

2019-10-14 Thread Kevin Wolf
Am 14.10.2019 um 13:22 hat Alberto Garcia geschrieben: > On Mon 14 Oct 2019 11:26:01 AM CEST, Kevin Wolf wrote: > >> Signed-off-by: Alberto Garcia > > > > Thanks, applied to the block branch. > > I'm a bit late now, but a possible trivial optimization is to flip the > conditions, because

[PATCH 00/20] hw: Clean up hw/i386 headers (and few alpha/hppa)

2019-10-14 Thread Philippe Mathieu-Daudé
This is a follow-up of Markus's cleanup series: Tame a few "touch this, recompile the world" https://www.mail-archive.com/qemu-devel@nongnu.org/msg635748.html This part is mostly restricted to X86, but since some file from the Alpha/PA-RISC machines include "hw/i386/pc.h" I had to fix them too.

[PATCH 02/20] hw/southbridge/ich9: Removed unused headers

2019-10-14 Thread Philippe Mathieu-Daudé
The ICH9 chipset is not X86/PC specific. These files don't use anything declared by the "hw/i386/pc.h" or "hw/i386/ioapic.h" headers. Remove them. Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/ich9.c | 1 - hw/isa/lpc_ich9.c | 2 -- include/hw/i386/ich9.h | 1 - 3 files

[PATCH 01/20] vl: Add missing "hw/boards.h" include

2019-10-14 Thread Philippe Mathieu-Daudé
vl.c calls machine_usb() declared in "hw/boards.h". Include it. This fixes (when modifying unrelated headers): vl.c:1283:10: error: implicit declaration of function 'machine_usb' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (!machine_usb(current_machine)) {

[PATCH 10/20] hw/alpha/dp264: Include "net/net.h"

2019-10-14 Thread Philippe Mathieu-Daudé
hw/alpha/dp264.c uses NICInfo variables which are declared in "net/net.h". Include it. This fixes (when modifying unrelated headers): hw/alpha/dp264.c:89:21: error: use of undeclared identifier 'nb_nics' for (i = 0; i < nb_nics; i++) { ^ hw/alpha/dp264.c:90:30:

[PATCH 06/20] hw/usb/dev-storage: Remove unused "ui/console.h" header

2019-10-14 Thread Philippe Mathieu-Daudé
The USB models related to storage don't need anything from "ui/console.h". Remove it. Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/dev-storage.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 8545193488..a2ff52d3e5 100644 ---

[PATCH 04/20] hw/i386/ioapic_internal: Remove unused "hw/i386/ioapic.h" header

2019-10-14 Thread Philippe Mathieu-Daudé
The "ioapic_internal.h" does not use anything from "hw/i386/ioapic.h", remove it. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/ioapic_internal.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_internal.h index

[PATCH 07/20] hw/i386/intel_iommu: Remove unused includes

2019-10-14 Thread Philippe Mathieu-Daudé
intel_iommu.h does not use any of these includes, remove them. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/intel_iommu.h | 4 1 file changed, 4 deletions(-) diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h index 66b931e526..a1c4afcda5 100644 ---

[PATCH 03/20] hw/input/pckbd: Remove unused "hw/i386/pc.h" header

2019-10-14 Thread Philippe Mathieu-Daudé
The keyboard controller model don't need anything from "hw/i386/pc.h". Remove it. Signed-off-by: Philippe Mathieu-Daudé --- hw/input/pckbd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index f0acfd86f7..2f09f780ba 100644 --- a/hw/input/pckbd.c +++

[PATCH 20/20] hw/i386/pc: Clean up includes

2019-10-14 Thread Philippe Mathieu-Daudé
Various headers are not required by hw/i386/pc.h: - "qemu/range.h" - "qemu/bitmap.h" - "qemu/module.h" - "exec/memory.h" - "hw/pci/pci.h" - "hw/mem/pc-dimm.h" - "hw/mem/nvdimm.h" - "net/net.h" Remove them. Add 3 headers that were missing: - "hw/hotplug.h" PCMachineState::acpi_dev

[PATCH 18/20] hw/i386: Include "hw/mem/nvdimm.h"

2019-10-14 Thread Philippe Mathieu-Daudé
All this files use methods/definitions declared in the NVDIMM device header. Include it. This fixes (when modifying unrelated headers): hw/i386/acpi-build.c:2733:9: error: implicit declaration of function 'nvdimm_build_acpi' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

[PATCH 12/20] hw/acpi/cpu_hotplug: Include "hw/pci/pci.h"

2019-10-14 Thread Philippe Mathieu-Daudé
hw/acpi/cpu_hotplug.c calls pci_address_space_io(). Include "hw/pci/pci.h" which declares it. This fixes (when modifying unrelated headers): hw/acpi/cpu_hotplug.c:103:28: error: implicit declaration of function 'pci_address_space_io' is invalid in C99

Re: [PATCH v4 0/7] iotests: Selfish patches

2019-10-14 Thread Max Reitz
On 17.09.19 11:19, Max Reitz wrote: > Hi, > > Again, let me start with a link to an actually explanatory cover letter: > https://lists.nongnu.org/archive/html/qemu-block/2019-06/msg01102.html > > v3: > https://lists.nongnu.org/archive/html/qemu-block/2019-08/msg00950.html > > v4: > - I merged

Re: [PATCH 0/2] qcow2: Limit total allocation range to INT_MAX

2019-10-14 Thread Kevin Wolf
Am 10.10.2019 um 12:08 hat Max Reitz geschrieben: > Hi, > > While looking for why handle_alloc_space() seems to cause issues on > ppc64le+XFS (performance degradation and data corruption), I spotted > this other issue. It isn’t as bad, but still needs fixing. > > See patch 1 for what is fixed

Re: [PATCH 08/20] hw/xen/xen_pt_load_rom: Remove unused includes

2019-10-14 Thread Paul Durrant
On Mon, 14 Oct 2019 at 15:27, Philippe Mathieu-Daudé wrote: > > xen_pt_load_rom.c does not use any of these includes, remove them. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant > --- > hw/xen/xen_pt_load_rom.c | 4 > 1 file changed, 4 deletions(-) > > diff --git

[PATCH v3 2/4] blkdebug: Allow taking/unsharing permissions

2019-10-14 Thread Max Reitz
Sometimes it is useful to be able to add a node to the block graph that takes or unshare a certain set of permissions for debugging purposes. This patch adds this capability to blkdebug. (Note that you cannot make blkdebug release or share permissions that it needs to take or cannot share,

[PATCH v3 0/4] mirror: Do not dereference invalid pointers

2019-10-14 Thread Max Reitz
Hi, v2’s cover letter should explain everything: https://lists.nongnu.org/archive/html/qemu-block/2019-09/msg01079.html v3: - Patch 2: Use input visitor as proposed by Vladimir git-backport-diff against v2: Key: [] : patches are identical [] : number of functional differences between

[PATCH v3 1/4] mirror: Do not dereference invalid pointers

2019-10-14 Thread Max Reitz
mirror_exit_common() may be called twice (if it is called from mirror_prepare() and fails, it will be called from mirror_abort() again). In such a case, many of the pointers in the MirrorBlockJob object will already be freed. This can be seen most reliably for s->target, which is set to NULL

[PATCH v3 3/4] iotests: Add @error to wait_until_completed

2019-10-14 Thread Max Reitz
Callers can use this new parameter to expect failure during the completion process. Signed-off-by: Max Reitz Reviewed-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git

[PATCH v3 4/4] iotests: Add test for failing mirror complete

2019-10-14 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy Tested-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow --- tests/qemu-iotests/041 | 44 ++ tests/qemu-iotests/041.out | 4 ++-- 2 files changed, 46 insertions(+), 2 deletions(-)

[PULL v2 08/19] block/dirty-bitmap: refactor bdrv_dirty_bitmap_next

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy bdrv_dirty_bitmap_next is always used in same pattern. So, split it into _next and _first, instead of combining two functions into one and add FOR_EACH_DIRTY_BITMAP macro. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Message-id:

[PULL v2 10/19] block: reverse order for reopen commits

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy It's needed to fix reopening qcow2 with bitmaps to RW. Currently it can't work, as qcow2 needs write access to file child, to mark bitmaps in-image with IN_USE flag. But usually children goes after parents in reopen queue and file child is still RO on qcow2

[PULL 03/15] replay: disable default snapshot for record/replay

2019-10-14 Thread Kevin Wolf
From: Pavel Dovgalyuk This patch disables setting '-snapshot' option on by default in record/replay mode. This is needed for creating vmstates in record and replay modes. Signed-off-by: Pavel Dovgalyuk Acked-by: Kevin Wolf Signed-off-by: Kevin Wolf --- vl.c | 10 -- 1 file changed,

[PULL 02/15] block: implement bdrv_snapshot_goto for blkreplay

2019-10-14 Thread Kevin Wolf
From: Pavel Dovgalyuk This patch enables making snapshots with blkreplay used in block devices. This function is required to make bdrv_snapshot_goto without calling .bdrv_open which is not implemented. Signed-off-by: Pavel Dovgalyuk Acked-by: Kevin Wolf Signed-off-by: Kevin Wolf ---

[PULL 05/15] replay: don't drain/flush bdrv queue while RR is working

2019-10-14 Thread Kevin Wolf
From: Pavel Dovgalyuk In record/replay mode bdrv queue is controlled by replay mechanism. It does not allow saving or loading the snapshots when bdrv queue is not empty. Stopping the VM is not blocked by nonempty queue, but flushing the queue is still impossible there, because it may cause

Re: [PULL 00/19] Bitmaps patches

2019-10-14 Thread Peter Maydell
On Fri, 11 Oct 2019 at 22:26, John Snow wrote: > > The following changes since commit 98b2e3c9ab3abfe476a2b02f8f51813edb90e72d: > > Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' > into staging (2019-10-08 16:08:35 +0100) > > are available in the Git repository at: > >

[PULL v2 11/19] iotests: add test-case to 165 to test reopening qcow2 bitmaps to RW

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy Reopening bitmaps to RW was broken prior to previous commit. Check that it works now. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20190927122355.7344-4-vsement...@virtuozzo.com Signed-off-by: John Snow --- tests/qemu-iotests/165 | 57

[PULL v2 19/19] dirty-bitmaps: remove deprecated autoload parameter

2019-10-14 Thread John Snow
This parameter has been deprecated since 2.12.0 and is eligible for removal. Remove this parameter as it is actually completely ignored; let's not give false hope. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id:

[PULL v2 05/19] block/dirty-bitmap: drop meta

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy Drop meta bitmaps, as they are unused. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Message-id: 20190916141911.5255-2-vsement...@virtuozzo.com Signed-off-by: John Snow --- include/block/dirty-bitmap.h | 5 block/dirty-bitmap.c

Re: [PATCH 02/20] hw/southbridge/ich9: Removed unused headers

2019-10-14 Thread John Snow
On 10/14/19 10:22 AM, Philippe Mathieu-Daudé wrote: > The ICH9 chipset is not X86/PC specific. > > These files don't use anything declared by the "hw/i386/pc.h" > or "hw/i386/ioapic.h" headers. Remove them. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: John Snow > --- >

[PULL v2 06/19] block/dirty-bitmap: add bs link

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy Add bs field to BdrvDirtyBitmap structure. Drop BlockDriverState parameter from bitmap APIs where possible. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Message-id: 20190916141911.5255-3-vsement...@virtuozzo.com [Rebased on top of

[PULL v2 16/19] block/qcow2-bitmap: fix and improve qcow2_reopen_bitmaps_rw

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy - Correct check for write access to file child, and in correct place (only if we want to write). - Support reopen rw -> rw (which will be used in following commit), for example, !bdrv_dirty_bitmap_readonly() is not a corruption if bitmap is marked IN_USE

[PULL v2 07/19] block/dirty-bitmap: drop BdrvDirtyBitmap.mutex

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy mutex field is just a pointer to bs->dirty_bitmap_mutex, so no needs to store it in BdrvDirtyBitmap when we have bs pointer in it (since previous patch). Drop mutex field. Constantly use bdrv_dirty_bitmaps_lock/unlock in block/dirty-bitmap.c to make it more

[PULL v2 17/19] qcow2-bitmap: move bitmap reopen-rw code to qcow2_reopen_commit

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy The only reason I can imagine for this strange code at the very-end of bdrv_reopen_commit is the fact that bs->read_only updated after calling drv->bdrv_reopen_commit in bdrv_reopen_commit. And in the same time, prior to previous commit, qcow2_reopen_bitmaps_rw

[PULL 01/15] block/vhdx: add check for truncated image files

2019-10-14 Thread Kevin Wolf
From: Peter Lieven qemu is currently not able to detect truncated vhdx image files. Add a basic check if all allocated blocks are reachable at open and report all errors during bdrv_co_check. Signed-off-by: Peter Lieven Signed-off-by: Kevin Wolf --- block/vhdx.c | 120

[PULL 00/15] Block layer patches

2019-10-14 Thread Kevin Wolf
The following changes since commit 22dbfdecc3c52228d3489da3fe81da92b21197bf: Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20191010.0' into staging (2019-10-14 15:09:08 +0100) are available in the Git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for

[PULL 09/15] iotests/028: Fix for long $TEST_DIRs

2019-10-14 Thread Kevin Wolf
From: Max Reitz For long test image paths, the order of the "Formatting" line and the "(qemu)" prompt after a drive_backup HMP command may be reversed. In fact, the interaction between the prompt and the line may lead to the "Formatting" to being greppable at all after "read"-ing it (if the

Re: [PULL 01/19] util/hbitmap: strict hbitmap_reset

2019-10-14 Thread John Snow
On 10/11/19 7:18 PM, John Snow wrote: > > > On 10/11/19 5:48 PM, Eric Blake wrote: >> On 10/11/19 4:25 PM, John Snow wrote: >>> From: Vladimir Sementsov-Ogievskiy >>> >>> hbitmap_reset has an unobvious property: it rounds requested region up. >>> It may provoke bugs, like in recently fixed

[PULL v2 00/19] Bitmaps patches

2019-10-14 Thread John Snow
The following changes since commit c760cb77e511eb05094df67c1b30029a952efa35: Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20191011a' into staging (2019-10-14 16:09:52 +0100) are available in the Git repository at: https://github.com/jnsnow/qemu.git

[PULL v2 02/19] block: move bdrv_can_store_new_dirty_bitmap to block/dirty-bitmap.c

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy block/dirty-bitmap.c seems to be more appropriate for it and bdrv_remove_persistent_dirty_bitmap already in it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Message-id: 20190920082543.23444-2-vsement...@virtuozzo.com Signed-off-by: John

[PULL v2 01/19] util/hbitmap: strict hbitmap_reset

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy hbitmap_reset has an unobvious property: it rounds requested region up. It may provoke bugs, like in recently fixed write-blocking mode of mirror: user calls reset on unaligned region, not keeping in mind that there are possible unrelated dirty bytes, covered

[PULL v2 18/19] MAINTAINERS: Add Vladimir as a reviewer for bitmaps

2019-10-14 Thread John Snow
I already try to make sure all bitmaps patches have been reviewed by both Red Hat and Virtuozzo anyway, so this formalizes the arrangement. Fam meanwhile is no longer as active, so I am removing him as a co-maintainer simply to reflect the current practice. Signed-off-by: John Snow Reviewed-by:

[PULL v2 14/19] block/qcow2-bitmap: do not remove bitmaps on reopen-ro

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy qcow2_reopen_bitmaps_ro wants to store bitmaps and then mark them all readonly. But the latter don't work, as qcow2_store_persistent_dirty_bitmaps removes bitmaps after storing. It's OK for inactivation but bad idea for reopen-ro. And this leads to the

[PULL v2 12/19] block/qcow2-bitmap: get rid of bdrv_has_changed_persistent_bitmaps

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy Firstly, no reason to optimize failure path. Then, function name is ambiguous: it checks for readonly and similar things, but someone may think that it will ignore normal bitmaps which was just unchanged, and this is in bad relation with the fact that we should

[PULL v2 13/19] block/qcow2-bitmap: drop qcow2_reopen_bitmaps_rw_hint()

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy The function is unused, drop it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: John Snow Message-id: 20190927122355.7344-6-vsement...@virtuozzo.com Signed-off-by: John Snow --- block/qcow2.h| 2 -- block/qcow2-bitmap.c | 15

[PULL v2 15/19] iotests: add test 260 to check bitmap life after snapshot + commit

2019-10-14 Thread John Snow
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20190927122355.7344-8-vsement...@virtuozzo.com Signed-off-by: John Snow --- tests/qemu-iotests/260 | 89 ++ tests/qemu-iotests/260.out | 52 ++

[PULL 04/15] replay: update docs for record/replay with block devices

2019-10-14 Thread Kevin Wolf
From: Pavel Dovgalyuk This patch updates the description of the command lines for using record/replay with attached block devices. Signed-off-by: Pavel Dovgalyuk Signed-off-by: Kevin Wolf --- docs/replay.txt | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git

  1   2   >