[Qemu-block] [PATCH 4/6] qcow2: remove qcow2_cache_find_entry_to_replace()

2015-04-30 Thread Alberto Garcia
A cache miss means that the whole array was traversed and the entry we were looking for was not found, so there's no need to traverse it again in order to select an entry to replace. Signed-off-by: Alberto Garcia be...@igalia.com --- block/qcow2-cache.c | 45

[Qemu-block] [PATCH 2/6] qcow2: simplify qcow2_cache_put() and qcow2_cache_entry_mark_dirty()

2015-04-30 Thread Alberto Garcia
Since all tables are now stored together, it is possible to obtain the position of a particular table directly from its address, so the operation becomes O(1). Signed-off-by: Alberto Garcia be...@igalia.com --- block/qcow2-cache.c | 22 +- 1 file changed, 5 insertions(+), 17

[Qemu-block] [PATCH 3/6] qcow2: use an LRU algorithm to replace entries from the L2 cache

2015-04-30 Thread Alberto Garcia
The current algorithm to evict entries from the cache gives always preference to those in the lowest positions. As the size of the cache increases, the chances of the later elements of being removed decrease exponentially. In a scenario with random I/O and lots of cache misses, entries in

[Qemu-block] [PATCH 5/6] qcow2: use a hash to look for entries in the L2 cache

2015-04-30 Thread Alberto Garcia
The current cache algorithm traverses the array starting always from the beginning, so the average number of comparisons needed to perform a lookup is proportional to the size of the array. By using a hash of the offset as the starting point, lookups are faster and independent from the array

[Qemu-block] [PATCH 6/6] qcow2: style fixes in qcow2-cache.c

2015-04-30 Thread Alberto Garcia
Fix pointer declaration to make it consistent with the rest of the code. Signed-off-by: Alberto Garcia be...@igalia.com --- block/qcow2-cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index c0e0278..dd591ef 100644 ---

Re: [Qemu-block] [Qemu-devel] Question about block driver

2015-04-30 Thread Wen Congyang
On 04/30/2015 05:33 PM, Kevin Wolf wrote: [Cc: qemu-block] Am 30.04.2015 um 11:11 hat Wen Congyang geschrieben: Some drivers use bdrv_open, while the other dirvers use bdrv_file_open(). What is the difference between bdrv_open() and bdrv_file_open()? bdrv_file_open() is used by protocol

Re: [Qemu-block] [Qemu-devel] Question about block driver

2015-04-30 Thread Kevin Wolf
Am 30.04.2015 um 11:43 hat Wen Congyang geschrieben: On 04/30/2015 05:33 PM, Kevin Wolf wrote: [Cc: qemu-block] Am 30.04.2015 um 11:11 hat Wen Congyang geschrieben: Some drivers use bdrv_open, while the other dirvers use bdrv_file_open(). What is the difference between bdrv_open() and

[Qemu-block] [PATCH 1/6] qcow2: use one single memory block for the L2/refcount cache tables

2015-04-30 Thread Alberto Garcia
The qcow2 L2/refcount cache contains one separate table for each cache entry. Doing one allocation per table adds unnecessary overhead and it also requires us to store the address of each table separately. Since the size of the cache is constant during its lifetime, it's better to have an array

Re: [Qemu-block] [Qemu-devel] Question about block driver

2015-04-30 Thread Kevin Wolf
[Cc: qemu-block] Am 30.04.2015 um 11:11 hat Wen Congyang geschrieben: Some drivers use bdrv_open, while the other dirvers use bdrv_file_open(). What is the difference between bdrv_open() and bdrv_file_open()? bdrv_file_open() is used by protocol drivers that don't need any other driver to work

Re: [Qemu-block] [PATCH] Enable NVMe start controller for Windows guest.

2015-04-30 Thread Kevin Wolf
[Cc: qemu-block] Am 24.04.2015 um 21:19 hat Keith Busch geschrieben: On Fri, 24 Apr 2015, Daniel Stekloff wrote: Windows seems to send two separate calls to NVMe controller configuration. The first sends configuration info and the second the enable bit. I couldn't enable the Windows 8.1

[Qemu-block] [PATCH v3 7/9] qtest/ahci: add flush migrate test

2015-04-30 Thread John Snow
Use blkdebug to inject an error on first flush, then attempt to flush on the first guest. When the error halts the VM, migrate to the second VM, and attempt to resume the command. Signed-off-by: John Snow js...@redhat.com --- tests/ahci-test.c | 52

[Qemu-block] [PATCH v3 6/9] qtest/ahci: add migrate dma test

2015-04-30 Thread John Snow
Write to one guest, migrate, and then read from the other. adjust ahci_io to clear any buffers it creates, so that we can use ahci_io safely on both guests knowing we are using empty buffers and not accidentally re-using data. Signed-off-by: John Snow js...@redhat.com --- tests/ahci-test.c |

[Qemu-block] [PATCH v3 8/9] qtest/ahci: add halted dma test

2015-04-30 Thread John Snow
If we're going to test the migration of halted DMA jobs, we should probably check to make sure we can resume them locally as a first step. Signed-off-by: John Snow js...@redhat.com --- tests/ahci-test.c | 60 +++ 1 file changed, 60

[Qemu-block] [PATCH v3 1/9] libqos/ahci: Add halted command helpers

2015-04-30 Thread John Snow
Sometimes we want a command to halt the VM instead of complete successfully, so it'd be nice to let the libqos/ahci functions cope with such scenarios. Signed-off-by: John Snow js...@redhat.com --- tests/libqos/ahci.c | 27 +++ tests/libqos/ahci.h | 3 +++ 2 files

[Qemu-block] [PATCH v3 0/9] ahci: enable migration

2015-04-30 Thread John Snow
The day we all feared is here, and I am proposing we allow the migration of the AHCI device tentatively for the 2.4 development window. There are some more NCQ migration tests are needed, but I felt that it was important to get migration enabled as close to the start of the 2.4 development window

[Qemu-block] [PATCH v3 2/9] libqos/ahci: Fix sector set method

2015-04-30 Thread John Snow
|| probably does not mean the same thing as |. Additionally, allow users to submit a prd_size of 0 to indicate that they'd like to continue using the default. Signed-off-by: John Snow js...@redhat.com --- tests/libqos/ahci.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

[Qemu-block] [PATCH v3 4/9] ich9/ahci: Enable Migration

2015-04-30 Thread John Snow
Lift the flag preventing the migration of the ICH9/AHCI devices. Signed-off-by: John Snow js...@redhat.com --- hw/ide/ahci.c | 1 - hw/ide/ich.c | 1 - 2 files changed, 2 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 833fd45..8e36dec 100644 --- a/hw/ide/ahci.c +++

[Qemu-block] [PATCH v3 9/9] qtest/ahci: add migrate halted dma test

2015-04-30 Thread John Snow
Test migrating a halted DMA transaction. Resume, then test data integrity. Signed-off-by: John Snow js...@redhat.com --- tests/ahci-test.c | 75 ++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/tests/ahci-test.c

[Qemu-block] [PULL 6/7] MAINTAINERS: Add qemu-block list where missing

2015-04-30 Thread Kevin Wolf
Signed-off-by: Kevin Wolf kw...@redhat.com --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 25fd2b5..0b67c48 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -735,12 +735,14 @@ F: backends/rng*.c nvme M: Keith Busch keith.bu...@intel.com

[Qemu-block] [PULL 5/7] MAINTAINERS: make block layer core Kevin Wolf's responsibility

2015-04-30 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com Kevin is now sole maintainer of the core block layer, including BlockDriverState graphs and monitor commands. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Kevin Wolf kw...@redhat.com --- MAINTAINERS | 4 +--- 1 file changed, 1

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] vl.c: Since the help says that 'disk_image' is a raw hard disk image, pass format=raw

2015-04-30 Thread Eric Blake
[adding qemu-block] On 04/30/2015 12:23 PM, Don Slutz wrote: ~/qemu/out/master/x86_64-softmmu/qemu-system-x86_64 -h | head QEMU emulator version 2.3.50, Copyright (c) 2003-2008 Fabrice Bellard usage: qemu-system-x86_64 [options] [disk_image] 'disk_image' is a raw hard disk image for IDE

[Qemu-block] [PULL 7/7] Enable NVMe start controller for Windows guest.

2015-04-30 Thread Kevin Wolf
From: Daniel Stekloff d...@wendan.org Windows seems to send two separate calls to NVMe controller configuration. The first sends configuration info and the second the enable bit. I couldn't enable the Windows 8.1 in-box NVMe driver with base Qemu. I made the following change to store the

[Qemu-block] [PULL 0/7] Block patches

2015-04-30 Thread Kevin Wolf
The following changes since commit 06feaacfb4cfef10cc0c93d97df7bfc8a71dbc7e: Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2015-04-30 12:04:11 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to

[Qemu-block] [PULL 2/7] MAINTAINERS: split out image formats

2015-04-30 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com Block driver submaintainers has proven to be a good model. Kevin and Stefan are splitting up the unclaimed block drivers so each has a dedicated maintainer. Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Kevin Wolf kw...@redhat.com

[Qemu-block] [PULL 3/7] MAINTAINERS: make block I/O path Stefan Hajnoczi's responsibility

2015-04-30 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com The block I/O path includes the asynchronous I/O machinery and read/write/flush/discard processing. It somewhat arbitrarily also includes block migration, which I've found myself reviewing patches for over the years. Signed-off-by: Stefan Hajnoczi

[Qemu-block] [PULL 1/7] MAINTAINERS: make virtio-blk Stefan Hajnoczi's responsibility

2015-04-30 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com Cc: Kevin Wolf kw...@redhat.com Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Kevin Wolf kw...@redhat.com --- MAINTAINERS | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index

[Qemu-block] [PULL 4/7] MAINTAINERS: make image fuzzer Stefan Hajnoczi's responsibility

2015-04-30 Thread Kevin Wolf
From: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Kevin Wolf kw...@redhat.com --- MAINTAINERS | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 9e1413e..65a5cc5 100644 ---

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] vl.c: Since the help says that 'disk_image' is a raw hard disk image, pass format=raw

2015-04-30 Thread Eric Blake
On 04/30/2015 01:15 PM, Eric Blake wrote: [adding qemu-block] On 04/30/2015 12:23 PM, Don Slutz wrote: ~/qemu/out/master/x86_64-softmmu/qemu-system-x86_64 -h | head QEMU emulator version 2.3.50, Copyright (c) 2003-2008 Fabrice Bellard usage: qemu-system-x86_64 [options] [disk_image]

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] vl.c: Since the help says that 'disk_image' is a raw hard disk image, pass format=raw

2015-04-30 Thread Don Slutz
On 04/30/15 16:15, Kevin Wolf wrote: Am 30.04.2015 um 21:15 hat Eric Blake geschrieben: [adding qemu-block] On 04/30/2015 12:23 PM, Don Slutz wrote: ~/qemu/out/master/x86_64-softmmu/qemu-system-x86_64 -h | head QEMU emulator version 2.3.50, Copyright (c) 2003-2008 Fabrice Bellard usage:

Re: [Qemu-block] [Qemu-devel] Question about block driver

2015-04-30 Thread Stefan Hajnoczi
On Thu, Apr 30, 2015 at 11:52:01AM +0200, Kevin Wolf wrote: Am 30.04.2015 um 11:43 hat Wen Congyang geschrieben: On 04/30/2015 05:33 PM, Kevin Wolf wrote: [Cc: qemu-block] Am 30.04.2015 um 11:11 hat Wen Congyang geschrieben: Some drivers use bdrv_open, while the other dirvers use

Re: [Qemu-block] [PATCH COLO v3 01/14] docs: block replication's description

2015-04-30 Thread Stefan Hajnoczi
On Wed, Apr 29, 2015 at 04:37:49PM +0800, Gonglei wrote: On 2015/4/29 16:29, Paolo Bonzini wrote: On 27/04/2015 11:37, Stefan Hajnoczi wrote: But it's only for the failover case. Quorum (or a new block/colo.c driver or filter) is fine for normal colo operation. Perhaps this