Re: [Qemu-devel] [PATCH] libqos: Convert malloc-pc allocator to a generic allocator

2014-10-23 Thread John Snow
, -PC_ALLOC_LEAK_ASSERT = 0x02, -PC_ALLOC_PARANOID= 0x04 -} PCAllocOpts; - QGuestAllocator *pc_alloc_init(void); -QGuestAllocator *pc_alloc_init_flags(PCAllocOpts flags); -void pc_alloc_uninit(QGuestAllocator *allocator); +QGuestAllocator *pc_alloc_init_flags(QAllocOpts f

Re: [Qemu-devel] [PATCH] libqos: Convert malloc-pc allocator to a generic allocator

2014-10-24 Thread John Snow
On 10/24/2014 05:00 AM, Marc Marí wrote: El Thu, 23 Oct 2014 18:49:03 -0400 John Snow escribió: Reviewed-by: John Snow Did you mean this for the v2, which has the extra free? Marc Yes. No more late-night replies to patches :\

Re: [Qemu-devel] [PATCH 1/6] ahci: Correct PIO/D2H FIS responses

2014-10-27 Thread John Snow
On 10/27/2014 05:32 AM, Markus Armbruster wrote: John Snow writes: Currently, the D2H FIS packets AHCI generates simply parrot back the LBA that the guest sent to us in the cmd_fis. However, some commands (like READ NATIVE MAX) modify the LBA registers as a return value, through which the

Re: [Qemu-devel] [PATCH 5/6] ide: Correct handling of malformed/short PRDTs

2014-10-27 Thread John Snow
On 10/27/2014 06:06 AM, Paolo Bonzini wrote: On 10/02/2014 12:55 AM, John Snow wrote: +/* If this is true, you're leaking memory. */ ... or qsg is uninitialized, which would work because qemu_sglist_init initializes all fields. This is the only comment I have on the series. :)

Re: [Qemu-devel] [PATCH 0/6] AHCI Device Fixes

2014-10-28 Thread John Snow
On 10/28/2014 09:51 AM, Stefan Hajnoczi wrote: On Wed, Oct 01, 2014 at 06:55:45PM -0400, John Snow wrote: Based off of feedback from the RFC of the same name, this series batches together a group of fixes that improve the AHCI device to fix a number of bugs. A number of fixes included in the

Re: [Qemu-devel] [PATCH 0/6] AHCI Device Fixes

2014-10-28 Thread John Snow
On 10/28/2014 08:03 PM, Paolo Bonzini wrote: On 10/29/2014 12:54 AM, John Snow wrote: On 10/28/2014 09:51 AM, Stefan Hajnoczi wrote: On Wed, Oct 01, 2014 at 06:55:45PM -0400, John Snow wrote: Based off of feedback from the RFC of the same name, this series batches together a group of

Re: [Qemu-devel] [PATCH 0/6] AHCI Device Fixes

2014-10-28 Thread John Snow
On 10/28/2014 08:27 PM, Paolo Bonzini wrote: Yeah, I was wondering if any commands could have <512 bytes response... I sort of convinced myself that the answer was no for ATA commands, but stupidly forgot about packet (SCSI) commands. Their results are obviously shorter than 512 bytes.

Re: [Qemu-devel] [PATCH 01/17] ahci: Fix CD-ROM signature

2014-10-29 Thread John Snow
On 10/29/2014 04:11 AM, Hannes Reinecke wrote: On 10/29/2014 09:07 AM, Markus Armbruster wrote: Copying John Snow for additional AHCI expertise. Hannes Reinecke writes: The CD-ROM signature is 0xeb140101, not 0xeb14. Without this change OVMF/Duet runs into a timeout trying to detect a

[Qemu-devel] [block PATCH v2 1/3] ide: repair PIO transfers for cases where nsector > 1

2014-10-31 Thread John Snow
same sector eight times. This patch adds offset tracking into the PIO pathways so that we can fulfill these requests appropriately. Signed-off-by: John Snow --- hw/ide/ahci.c | 2 +- hw/ide/core.c | 4 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c

[Qemu-devel] [block PATCH v2 0/3] AHCI device fixes

2014-10-31 Thread John Snow
code meaning "no sectors" or "no bytes" which led to bad error pathways. John Snow (3): ide: repair PIO transfers for cases where nsector > 1 ahci: unify sglist preparation ide: Correct handling of malformed/short PRDTs hw/ide/ahci.c | 33

[Qemu-devel] [block PATCH v2 2/3] ahci: unify sglist preparation

2014-10-31 Thread John Snow
e sglist at the correct offset. It will also set io_buffer_size, but this is not used in the cmd_read_pio or cmd_write_pio pathways. Signed-off-by: John Snow --- hw/ide/ahci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 3d9b018..ff7e225

[Qemu-devel] [block PATCH v2 3/3] ide: Correct handling of malformed/short PRDTs

2014-10-31 Thread John Snow
, relied upon by the AHCI implementation of .prepare_buf() as well as the PCI implementation of the callback have had overflow assertions added to help make clear the reasonings behind the various type changes. Signed-off-by: John Snow --- hw/ide/ahci.c | 31 +-

Re: [Qemu-devel] [PATCH] AHCI read/write corruption with int13h

2014-08-29 Thread John Snow
On 07/30/2014 02:11 PM, Eniac Zhang wrote: The AHCI controller code in Qemu has a bug that it will use the wrong LBA address when Seabios tries to access LBA>128GB (aka 127.5GB limit http://www.hardwaresecrets.com/printpage/Hard-Disk-Drives-Capacity-Limits/482). When we needs to access t

Re: [Qemu-devel] [libvirt] NBD TLS support in QEMU

2014-09-04 Thread John Snow
On 09/04/2014 10:34 AM, Daniel P. Berrange wrote: On Thu, Sep 04, 2014 at 04:19:17PM +0200, Benoît Canet wrote: The Wednesday 03 Sep 2014 à 17:44:17 (+0100), Stefan Hajnoczi wrote : Hi, QEMU offers both NBD client and server functionality. The NBD protocol runs unencrypted, which is a proble

Re: [Qemu-devel] [PATCH v3] ide: Add resize callback to ide/core

2014-09-04 Thread John Snow
On 09/04/2014 12:13 PM, Stefan Hajnoczi wrote: This patch seems to break tests/bios-tables-test.c: ERROR:tests/bios-tables-test.c:744:test_acpi_one: assertion failed (signature == SIGNATURE): (0x == 0xdead) GTester: last random seed: R02S3d881198f35228a485b4c3d116dff3b1 I have run

[Qemu-devel] [PATCH v4 0/2] add resize callback to ide/core

2014-09-04 Thread John Snow
not attempt to update geometry values, to avoid clobbering user-specified values, if they exist. - Do not regenerate the entire IDENTIFY buffer to avoid losing any settings that occurred during normal operation. John Snow (2): IDE: Fill the IDENTIFY request consistently ide: Add resize

[Qemu-devel] [PATCH v4 2/2] ide: Add resize callback to ide/core

2014-09-04 Thread John Snow
QEMU process. Signed-off-by: John Snow --- hw/ide/core.c | 69 ++- 1 file changed, 59 insertions(+), 10 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index f5b1ef2..f077c0f 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -75,6

[Qemu-devel] [PATCH v4 1/2] IDE: Fill the IDENTIFY request consistently

2014-09-04 Thread John Snow
IDE-HD, IDE-ATAPI and IDE-CFATA all fill the identify buffer in slightly different ways, this is a relatively minor patch to make them uniform, to emphasize that: (1) We build the s->identify_data cache first, then (2) We copy it to s->io_buffer to fulfill the request. Signed-off-by: Joh

Re: [Qemu-devel] [Bug 1358722] Re: latest acpi commits causes memory allocation fault in macosx

2014-09-05 Thread John Snow
On 09/04/2014 10:21 AM, Marco Minetti wrote: On Thu, 2014-09-04 at 09:10 -0400, Gabriel L. Somlo wrote: On Thu, 04 Sep 2014 08:43:12, Marco Minetti wrote: The experiments for running MacOSXon KVM/QEMU I followed are here: http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/ [...] Bug descript

Re: [Qemu-devel] [PATCH v4 0/8] AHCI test suite framework

2014-09-09 Thread John Snow
On 08/21/2014 01:44 PM, John Snow wrote: This submission does not re-send earlier patches in the series which have already been merged into QEMU, which were primarily staging fixes and small tweaks to support this smaller set of patches. This patch series introduces a number of small fixes

[Qemu-devel] [PATCH 1/1] ide/atapi: Mark non-data commands as complete

2014-09-12 Thread John Snow
EMU with a Fedora 20 live CD under Q35/AHCI, which uses ATAPI command 0x00, which is a status check that may cause a hang because we never complete, and ATAPI command 0x56, which is unsupported by our current implementation and results in an error that we never report back to the guest. Signed-of

Re: [Qemu-devel] [PATCH 1/1] ide/atapi: Mark non-data commands as complete

2014-09-12 Thread John Snow
On 09/12/2014 12:08 PM, Paolo Bonzini wrote: Il 12/09/2014 18:00, John Snow ha scritto: When the command completion code in IDE and AHCI was unified to put all command completion inside of a callback, "cmd_done," we neglected to ensure that all AHCI/ATAPI command paths would

[Qemu-devel] [PATCH v2 0/1] ide/atapi: Mark non-data commands as complete

2014-09-12 Thread John Snow
v2: - Instead of using ide_set_inactive, use ide_stop_transfer - ATAPI helpers use either ide_atapi_cmd_ok or ide_atapi_cmd_error, instead of ide_stop_transfer directly. John Snow (1): ide/atapi: Mark non-data commands as complete hw/ide/atapi.c | 7 +++ 1 file changed, 3 insertions

[Qemu-devel] [PATCH v2 1/1] ide/atapi: Mark non-data commands as complete

2014-09-12 Thread John Snow
EMU with a Fedora 20 live CD under Q35/AHCI, which uses ATAPI command 0x00, which is a status check that may cause a hang because we never complete, and ATAPI command 0x56, which is unsupported by our current implementation and results in an error that we never report back to the guest. Signed-of

[Qemu-devel] [RFC 03/10] AHCI: Add PRD interrupt

2014-09-12 Thread John Snow
to see the PRD/DPS interrupt bit set. Signed-off-by: John Snow --- hw/ide/ahci.c | 11 +++ hw/ide/ahci.h | 5 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index d3ece78..8e6a352 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -50

[Qemu-devel] [RFC 05/10] AHCI: Rename NCQFIS structure fields

2014-09-12 Thread John Snow
property. Signed-off-by: John Snow --- hw/ide/ahci.c | 50 ++ hw/ide/ahci.h | 38 -- 2 files changed, 74 insertions(+), 14 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 42a77c4..4a1af3b 100644 --- a/hw

[Qemu-devel] [RFC 02/10] AHCI: Update byte count after DMA completion

2014-09-12 Thread John Snow
7. Signed-off-by: John Snow --- dma-helpers.c| 5 + hw/ide/ahci.c| 47 +-- hw/ide/core.c| 14 +- hw/ide/internal.h| 1 + include/sysemu/dma.h | 1 + 5 files changed, 53 insertions(+), 15 deletions(-) diff

[Qemu-devel] [RFC 00/10] AHCI Device improvements

2014-09-12 Thread John Snow
when reading from / writing to sectors located beyond the LBA28 limit. (Reported by Eniac Zhang ) (3) SDB_FIS construction issues may be partly responsible for unreliable NCQ operation within windows. John Snow (10): ide: add is_write() macro for semantic consistency AHCI: Update

[Qemu-devel] [RFC 04/10] ide: Correct handling of malformed/short PRDTs

2014-09-12 Thread John Snow
nish the DMA operation. This patch corrects both occurrences and adds an assertion to prevent future regression. This assertion is tested in the existing ide-test, and is covered in a forthcoming AHCI test. Signed-off-by: John Snow --- dma-helpers.c | 3 +++ hw/ide/ahci.c | 2 +- hw/ide/core.c | 1

[Qemu-devel] [RFC 07/10] ide/ahci: Reorder error cases in handle_cmd

2014-09-12 Thread John Snow
d, and the debug print of the command fis is cleaned up with its size corrected. Signed-off-by: John Snow --- hw/ide/ahci.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index c2fa733..1153ce9 100644 --- a/hw/ide/ahci.

[Qemu-devel] [RFC 01/10] ide: add is_write() macro for semantic consistency

2014-09-12 Thread John Snow
callback name the incoming argument is_write. -Both functions ignore this hint currently, anyway. This is therefore a simple patch to avoid future mistakes. Signed-off-by: John Snow --- hw/ide/core.c | 2 +- hw/ide/internal.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a

[Qemu-devel] [RFC 10/10] AHCI: Fix SDB FIS Construction

2014-09-12 Thread John Snow
atch adds an SDB FIS structure with human-readable names, and ensures that we are filling the structure appropriately. Signed-off-by: John Snow --- hw/ide/ahci.c | 23 --- hw/ide/ahci.h | 8 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/hw/ide/ahci.c

[Qemu-devel] [RFC 06/10] AHCI: Fix FIS decomposition

2014-09-12 Thread John Snow
nd should not be overridden for every PACKET command. - The feature register is defined as valid for the PACKET command, so we should not suppress it. The ATAPI layer does not even currently depend on or require 0x01 as mandatory. Signed-off-by: John Snow --- hw

[Qemu-devel] [RFC 08/10] ahci: Check cmd_fis[1] more explicitly

2014-09-12 Thread John Snow
Instead of checking for a known byte, inspect the fields of this byte explicitly to produce more meaningful error messages and improve the readability of this section. Signed-off-by: John Snow --- hw/ide/ahci.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions

[Qemu-devel] [RFC 09/10] ahci: factor out FIS decomposition

2014-09-12 Thread John Snow
Signed-off-by: John Snow --- hw/ide/ahci.c | 169 ++ 1 file changed, 86 insertions(+), 83 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index e4eae0c..5bc5a92 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -936,10 +936,94

Re: [Qemu-devel] [RFC 01/10] ide: add is_write() macro for semantic consistency

2014-09-13 Thread John Snow
On 09/13/2014 08:54 AM, Paolo Bonzini wrote: Il 13/09/2014 06:34, John Snow ha scritto: The prepare_buf callback takes an argument named /is_write/, however in core.c we are checking to see if this DMA command is /is_read/. I am adding a small macro to correct this oversight. Impact: Nothing

Re: [Qemu-devel] [RFC 03/10] AHCI: Add PRD interrupt

2014-09-15 Thread John Snow
On 09/13/2014 09:26 AM, Paolo Bonzini wrote: Il 13/09/2014 06:34, John Snow ha scritto: AHCI devices support a feature where individual entries in the scatter-gather list may have interrupt request bits set, in order to receive notification partway through a command that a portion of a

Re: [Qemu-devel] [RFC 03/10] AHCI: Add PRD interrupt

2014-09-15 Thread John Snow
On 09/13/2014 03:50 PM, Paolo Bonzini wrote: Il 13/09/2014 15:26, Paolo Bonzini ha scritto: +if (ad->dp_intr_req) { +ahci_trigger_irq(ad->hba, ad, PORT_IRQ_SG_DONE); +ad->dp_intr_req = 0; +} Is it also needed in the error case? Especially the short-PRDT case that you

Re: [Qemu-devel] [RFC 02/10] AHCI: Update byte count after DMA completion

2014-09-15 Thread John Snow
On 09/13/2014 09:21 AM, Paolo Bonzini wrote: Il 13/09/2014 06:34, John Snow ha scritto: Currently, DMA read/write operations neglect to update the byte count after a successful transfer like ATAPI DMA read or PIO read/write operations do. We correct this oversight by adding another callback

[Qemu-devel] [PATCH] virtio-rng: Add human-readable error message for negative max-bytes parameter

2014-07-14 Thread John Snow
If a negative integer is used for the max_bytes parameter, QEMU currently calls abort() and leaves behind a core dump. This patch adds a simple error message to make the reason for the termination clearer. Signed-off-by: John Snow --- hw/virtio/virtio-rng.c | 6 +- 1 file changed, 5

[Qemu-devel] [PATCH v2] virtio-rng: Add human-readable error message for negative max-bytes parameter

2014-07-17 Thread John Snow
If a negative integer is used for the max_bytes parameter, QEMU currently calls abort() and leaves behind a core dump. This patch adds a simple error message to make the reason for the termination clearer. Signed-off-by: John Snow --- v2: Changed 0L constant to (uint64_t)0 constant to match

Re: [Qemu-devel] [PATCH v2] virtio-rng: Add human-readable error message for negative max-bytes parameter

2014-07-18 Thread John Snow
Snow writes: If a negative integer is used for the max_bytes parameter, QEMU currently calls abort() and leaves behind a core dump. This patch adds a simple error message to make the reason for the termination clearer. Signed-off-by: John Snow --- v2: Changed 0L constant to (uint64_t)0 constant

Re: [Qemu-devel] [PATCH v2] virtio-rng: Add human-readable error message for negative max-bytes parameter

2014-07-18 Thread John Snow
Snow writes: If a negative integer is used for the max_bytes parameter, QEMU currently calls abort() and leaves behind a core dump. This patch adds a simple error message to make the reason for the termination clearer. Signed-off-by: John Snow --- v2: Changed 0L constant to (uint64_t)0 constant

Re: [Qemu-devel] [PATCH v2] virtio-rng: Add human-readable error message for negative max-bytes parameter

2014-07-21 Thread John Snow
On 07/21/2014 03:48 AM, Markus Armbruster wrote: It certainly could check whether the value fits into uint64_t. A quick peek at how string-input-visitor.c uses strtoll() makes me cringe. [...] What I meant by that was to say that by the time a value was returned to visit_type_uint64, the v

Re: [Qemu-devel] [PATCH v2] virtio-rng: Add human-readable error message for negative max-bytes parameter

2014-07-21 Thread John Snow
On 07/21/2014 01:33 PM, Markus Armbruster wrote: John Snow writes: On 07/21/2014 03:48 AM, Markus Armbruster wrote: It certainly could check whether the value fits into uint64_t. A quick peek at how string-input-visitor.c uses strtoll() makes me cringe. [...] What I meant by that was to

Re: [Qemu-devel] [PATCH v2] virtio-rng: Add human-readable error message for negative max-bytes parameter

2014-07-21 Thread John Snow
On 07/21/2014 03:15 PM, Markus Armbruster wrote: John Snow writes: On 07/21/2014 01:33 PM, Markus Armbruster wrote: John Snow writes: On 07/21/2014 03:48 AM, Markus Armbruster wrote: It certainly could check whether the value fits into uint64_t. A quick peek at how string-input

[Qemu-devel] [PATCH v3] virtio-rng: Add human-readable error message for negative max-bytes parameter

2014-07-21 Thread John Snow
unable to reject negative values for unsigned properties, thus the error message "a non-negative integer below 2^63" is the most user-friendly and correct message we can give until the underlying insufficiency is corrected. Signed-off-by: John Snow --- v3: Adjusted the error message

Re: [Qemu-devel] [PATCH v3] virtio-rng: Add human-readable error message for negative max-bytes parameter

2014-07-22 Thread John Snow
On 07/22/2014 07:48 AM, Amit Shah wrote: On (Tue) 22 Jul 2014 [13:41:43], Markus Armbruster wrote: Amit Shah writes: On (Mon) 21 Jul 2014 [17:44:37], John Snow wrote: If a negative integer is used for the max_bytes parameter, QEMU currently calls abort() and leaves behind a core dump. This

Re: [Qemu-devel] AHCI bug

2014-07-24 Thread John Snow
On 07/24/2014 01:01 PM, Zhang, Eniac wrote: Hi all, I found a problem while using following combinations: qemu-1.6.1 + large disks (>127GB) + q35(AHCI controller) + int13h disk access. The AHCI controller code in Qemu has a bug that it will use the wrong LBA address when Seabios tries to a

Re: [Qemu-devel] [PATCH 5/7] libqos: Change free function called in malloc

2014-07-29 Thread John Snow
rprise when I noticed the allocator was summoning up millions of bytes. "Oh good!" Reviewed-by: John Snow

Re: [Qemu-devel] [PATCH 4/7] libqos: Correct mask to align size to PAGE_SIZE in malloc-pc

2014-07-29 Thread John Snow
/libqos/malloc-pc.c +++ b/tests/libqos/malloc-pc.c @@ -36,7 +36,7 @@ static uint64_t pc_alloc(QGuestAllocator *allocator, size_t size) size += (PAGE_SIZE - 1); -size &= PAGE_SIZE; +size &= -PAGE_SIZE; g_assert_cmpint((s->start + size), <=, s->end);

[Qemu-devel] [PATCH 0/4] libqos: add a simple first-fit memory allocator

2014-07-29 Thread John Snow
This set collects two patches by Marc Marí already on the mailing list, but goes further by adding a simple memory allocator that allows us to track and debug freed memory, and optionally keep track of any leaks. John Snow (2): libqos: add a simple first-fit memory allocator qtest/ide-test

[Qemu-devel] [PATCH 2/4] libqos: Change free function called in malloc

2014-07-29 Thread John Snow
From: Marc Marí Signed-off-by: Marc Marí Signed-off-by: John Snow --- tests/libqos/malloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libqos/malloc.h b/tests/libqos/malloc.h index 46f6000..5565381 100644 --- a/tests/libqos/malloc.h +++ b/tests/libqos/malloc.h

[Qemu-devel] [PATCH 3/4] libqos: add a simple first-fit memory allocator

2014-07-29 Thread John Snow
ff-by: John Snow --- tests/libqos/malloc-pc.c | 321 +-- tests/libqos/malloc-pc.h | 9 ++ 2 files changed, 321 insertions(+), 9 deletions(-) diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c index 2efd095..410181d 100644 --- a/tests/l

[Qemu-devel] [PATCH 1/4] libqos: Correct mask to align size to PAGE_SIZE in malloc-pc

2014-07-29 Thread John Snow
From: Marc Marí Signed-off-by: Paolo Bonzini Signed-off-by: Marc Marí Signed-off-by: John Snow --- tests/libqos/malloc-pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c index db1496c..2efd095 100644 --- a/tests/libqos

[Qemu-devel] [PATCH 4/4] qtest/ide-test: add pc-alloc-uninit call

2014-07-29 Thread John Snow
Uninitialize the allocator and cleanup residual memory. Signed-off-by: John Snow --- tests/ide-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/ide-test.c b/tests/ide-test.c index 4a0d97f..ad32328 100644 --- a/tests/ide-test.c +++ b/tests/ide-test.c @@ -123,6 +123,8 @@ static

[Qemu-devel] [PATCH 1/2] virtio-rng: Move error-checking forward to prevent memory leak

2014-07-29 Thread John Snow
This patch pushes the error-checking forward and the virtio initialization backward in the device realization function in order to prevent memory leaks for hot plug scenarios. Signed-off-by: John Snow --- hw/virtio/virtio-rng.c | 20 ++-- 1 file changed, 10 insertions(+), 10

[Qemu-devel] [PATCH 0/2] virtio-rng: Fix memory leaks in virtio_rng_device_realize

2014-07-29 Thread John Snow
functions from error_set to error_setg. John Snow (2): virtio-rng: Move error-checking forward to prevent memory leak virtio-rng: replace error_set calls with error_setg hw/virtio/virtio-rng.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) -- 1.9.3

[Qemu-devel] [PATCH 2/2] virtio-rng: replace error_set calls with error_setg

2014-07-29 Thread John Snow
Under recommendation from Luiz Capitulino, we are changing the error_set calls to error_setg while we are fixing up the error handling pathways of virtio-rng. Signed-off-by: John Snow --- hw/virtio/virtio-rng.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH 3/4] libqos: add a simple first-fit memory allocator

2014-07-30 Thread John Snow
ff-by: John Snow --- tests/libqos/malloc-pc.c | 296 +-- tests/libqos/malloc-pc.h | 9 ++ 2 files changed, 295 insertions(+), 10 deletions(-) diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c index 2efd095..641162d 100644 --- a/tests/l

[Qemu-devel] [PATCH 1/4] libqos: Correct mask to align size to PAGE_SIZE in malloc-pc

2014-07-30 Thread John Snow
From: Marc Marí Signed-off-by: Paolo Bonzini Signed-off-by: Marc Marí Signed-off-by: John Snow --- tests/libqos/malloc-pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c index db1496c..2efd095 100644 --- a/tests/libqos

[Qemu-devel] [PATCH v2 0/4] libqos: add a simple first-fit memory allocator

2014-07-30 Thread John Snow
an error in the size of the initial node. John Snow (2): libqos: add a simple first-fit memory allocator qtest/ide: Uninitialize PC allocator Marc Marí (2): libqos: Correct mask to align size to PAGE_SIZE in malloc-pc libqos: Change free function called in malloc tests/ide-test.c

[Qemu-devel] [PATCH 4/4] qtest/ide: Uninitialize PC allocator

2014-07-30 Thread John Snow
Use the new call to pc_alloc_uninit as a test for the new pathways. The leak checking / assert pathways are not enabled in this patch, leaving this as an option to future test writers. Signed-off-by: John Snow --- tests/ide-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/ide

[Qemu-devel] [PATCH 2/4] libqos: Change free function called in malloc

2014-07-30 Thread John Snow
From: Marc Marí Signed-off-by: Marc Marí Signed-off-by: John Snow --- tests/libqos/malloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libqos/malloc.h b/tests/libqos/malloc.h index 46f6000..5565381 100644 --- a/tests/libqos/malloc.h +++ b/tests/libqos/malloc.h

Re: [Qemu-devel] [PATCH 24/28] ahci: Add test_pci_spec to ahci-test.

2014-07-31 Thread John Snow
On 07/31/2014 09:19 AM, Stefan Hajnoczi wrote: On Mon, Jul 07, 2014 at 02:18:05PM -0400, John Snow wrote: +#ifdef AHCI_13_STRICT Please drop the #ifdef. #ifdefs mean dead code that is not being compiled or tested. Just decide which case we should take and keep that one. OK. It might be nice

Re: [Qemu-devel] [PATCH 26/28] ahci: Add test_hba_spec to ahci-test.

2014-07-31 Thread John Snow
On 07/31/2014 10:01 AM, Stefan Hajnoczi wrote: On Mon, Jul 07, 2014 at 02:18:07PM -0400, John Snow wrote: +if (bitset(cap, AHCI_CAP_SAM)) { +g_test_message("Supports AHCI-Only Mode: GHC_AE is Read-Only."); +assert_bit_set(reg, AHCI_GHC_AE); +

Re: [Qemu-devel] [PATCH 3/4] libqos: add a simple first-fit memory allocator

2014-07-31 Thread John Snow
On 07/31/2014 06:13 AM, Stefan Hajnoczi wrote: On Wed, Jul 30, 2014 at 06:28:28PM -0400, John Snow wrote: +#define bitany(X, MASK) ((X) & (MASK)) +#define bitset(X, MASK) (bitany((X), (MASK)) == (MASK)) This is subjective but macros like this should be avoided. This macro does

Re: [Qemu-devel] [PATCH 03/28] ide-test: add test for werror=stop

2014-07-31 Thread John Snow
On 07/31/2014 06:58 AM, Stefan Hajnoczi wrote: On Mon, Jul 07, 2014 at 02:17:44PM -0400, John Snow wrote: +static void test_retry_flush(void) +{ +uint8_t data; +const char *s; + +prepare_blkdebug_script(debug_path, "flush_to_disk"); + +ide_test_start( +

Re: [Qemu-devel] [PATCH 15/28] ide: stop PIO transfer on errors

2014-07-31 Thread John Snow
On 07/31/2014 08:23 AM, Stefan Hajnoczi wrote: On Mon, Jul 07, 2014 at 02:17:56PM -0400, John Snow wrote: From: Paolo Bonzini This will provide a hook for sending the result of the command via the FIS receive area. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/core.c

[Qemu-devel] [PATCH v3 1/4] libqos: Correct mask to align size to PAGE_SIZE in malloc-pc

2014-08-01 Thread John Snow
From: Marc Marí Signed-off-by: Paolo Bonzini Signed-off-by: Marc Marí Signed-off-by: John Snow --- tests/libqos/malloc-pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c index db1496c..2efd095 100644 --- a/tests/libqos

[Qemu-devel] [PATCH v3 0/4] libqos: add a simple first-fit memory allocator

2014-08-01 Thread John Snow
a basis for the linked list implementation instead. Correct an error in the size of the initial node. v3: remove mlist wrappers around QTAILQ interface for clarity. adjust the options controlling when to do allocation list debugging. John Snow (2): libqos: add a simple first-fit memory

[Qemu-devel] [PATCH v3 3/4] libqos: add a simple first-fit memory allocator

2014-08-01 Thread John Snow
ff-by: John Snow --- tests/libqos/malloc-pc.c | 280 +-- tests/libqos/malloc-pc.h | 9 ++ 2 files changed, 279 insertions(+), 10 deletions(-) diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c index 2efd095..ba316d3 100644 --- a/tests/l

[Qemu-devel] [PATCH v3 4/4] qtest/ide: Uninitialize PC allocator

2014-08-01 Thread John Snow
Use the new call to pc_alloc_uninit as a test for the new pathways. The leak checking / assert pathways are not enabled in this patch, leaving this as an option to future test writers. Signed-off-by: John Snow --- tests/ide-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/ide

[Qemu-devel] [PATCH v3 2/4] libqos: Change free function called in malloc

2014-08-01 Thread John Snow
From: Marc Marí Signed-off-by: Marc Marí Signed-off-by: John Snow --- tests/libqos/malloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libqos/malloc.h b/tests/libqos/malloc.h index 46f6000..5565381 100644 --- a/tests/libqos/malloc.h +++ b/tests/libqos/malloc.h

Re: [Qemu-devel] Are -cdrom/-hda (or -drive if=ide) supposed to work in q35?

2014-08-01 Thread John Snow
On 06/12/2014 05:03 AM, Markus Armbruster wrote: Michael Tokarev writes: 10.06.2014 10:34, Paolo Bonzini wrote: Il 10/06/2014 08:30, Michael Tokarev ha scritto: Hello. The question is: are the drive shortcuts - -cdrom, -hda, -hdb etc - supposed to work in -machine q35 too? Or are they mer

Re: [Qemu-devel] [PATCH 26/28] ahci: Add test_hba_spec to ahci-test.

2014-08-01 Thread John Snow
On 07/31/2014 10:01 AM, Stefan Hajnoczi wrote: On Mon, Jul 07, 2014 at 02:18:07PM -0400, John Snow wrote: +/*** IO macros for the AHCI memory registers. ***/ +#define void_incr(vptr, OFST) ((void *)((char *)(vptr) + (OFST))) I'm pretty sure QEMU takes advantage of GCC's vo

[Qemu-devel] [PATCH v2 11/30] ide: fold add_status callback into set_inactive

2014-08-04 Thread John Snow
From: Paolo Bonzini It is now called only after the set_inactive callback. Put the two together. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/ahci.c | 9 - hw/ide/atapi.c| 2 +- hw/ide/core.c | 12 hw/ide/internal.h | 6 +++--- hw/ide

[Qemu-devel] [PATCH v2 01/30] blkdebug: report errors on flush too

2014-08-04 Thread John Snow
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- block/blkdebug.c | 20 1 file changed, 20 insertions(+) diff --git a/block/blkdebug.c b/block/blkdebug.c index f51407d..1586ed9 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -522,6

[Qemu-devel] [PATCH v2 02/30] libqtest: add QTEST_LOG for debugging qtest testcases

2014-08-04 Thread John Snow
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- tests/libqtest.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index 98e8f4b..4a75cd3 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -167,11

[Qemu-devel] [PATCH v2 00/30] AHCI test suite framework

2014-08-04 Thread John Snow
ahci-test." - Removed unneeded macros - Added in an optional bar_size return parameter to qpci_iomap "ahci: Add test_identify case to ahci-test." - Corrected raw usage of free() For convenience; https://github.com/jnsnow/qemu/tree/ahci-test-v2 John Snow (13): q35: Enabl

[Qemu-devel] [PATCH v2 05/30] ide: simplify reset callbacks

2014-08-04 Thread John Snow
From: Paolo Bonzini Drop the unused return value and make the callback optional. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/ahci.c | 6 -- hw/ide/core.c | 5 +++-- hw/ide/internal.h | 3 ++- hw/ide/macio.c| 1 - hw/ide/pci.c | 4 +--- 5 files

[Qemu-devel] [PATCH v2 06/30] ide: simplify set_inactive callbacks

2014-08-04 Thread John Snow
From: Paolo Bonzini Drop the unused return value and make the callback optional. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/ahci.c | 6 -- hw/ide/core.c | 5 +++-- hw/ide/internal.h | 2 +- hw/ide/macio.c| 1 - hw/ide/pci.c | 4 +--- 5 files changed

[Qemu-devel] [PATCH v2 07/30] ide: simplify async_cmd_done callbacks

2014-08-04 Thread John Snow
From: Paolo Bonzini Drop the unused return value. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/ahci.c | 4 +--- hw/ide/internal.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 679357f..e494503 100644 --- a

[Qemu-devel] [PATCH v2 04/30] ide: stash aiocb for flushes

2014-08-04 Thread John Snow
From: Paolo Bonzini This ensures that operations are completed after a reset Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index db191a6..79985f9 100644 --- a/hw/ide

[Qemu-devel] [PATCH v2 03/30] ide-test: add test for werror=stop

2014-08-04 Thread John Snow
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- tests/ide-test.c | 81 1 file changed, 81 insertions(+) diff --git a/tests/ide-test.c b/tests/ide-test.c index 4a0d97f..151ef30 100644 --- a/tests/ide-test.c

[Qemu-devel] [PATCH v2 08/30] ide: simplify start_transfer callbacks

2014-08-04 Thread John Snow
From: Paolo Bonzini Drop the unused return value and make the callback optional. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/ahci.c | 4 +--- hw/ide/core.c | 10 +++--- hw/ide/internal.h | 3 +-- hw/ide/macio.c| 6 -- hw/ide/pci.c | 6

[Qemu-devel] [PATCH v2 10/30] ide: remove wrong setting of BM_STATUS_INT

2014-08-04 Thread John Snow
-by: John Snow --- hw/ide/ahci.c | 4 hw/ide/atapi.c | 1 - 2 files changed, 5 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index adbac3d..14677ec 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1107,10 +1107,6 @@ static int ahci_dma_add_status(IDEDMA *dma, int status

[Qemu-devel] [PATCH v2 18/30] q35: Enable the ioapic device to be seen by qtest.

2014-08-04 Thread John Snow
Currently, the ioapic device can not be found in a qtest environment when requesting "irq_interrupt_in ioapic" via the qtest socket. By mirroring how the ioapic is added in i44ofx (hw/i440/pc_piix.c), as a child of "q35," the device is able to be seen by qtest. Signed-off-by

[Qemu-devel] [PATCH v2 09/30] ide: wrap start_dma callback

2014-08-04 Thread John Snow
From: Paolo Bonzini Make it optional and prepare for the next patches. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/atapi.c| 6 ++ hw/ide/core.c | 15 --- hw/ide/internal.h | 1 + 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a

[Qemu-devel] [PATCH v2 15/30] ide: stop PIO transfer on errors

2014-08-04 Thread John Snow
From: Paolo Bonzini This will provide a hook for sending the result of the command via the FIS receive area. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index

[Qemu-devel] [PATCH v2 13/30] ide: move retry constants out of BM_STATUS_* namespace

2014-08-04 Thread John Snow
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/core.c | 20 ++-- hw/ide/internal.h | 12 ++-- hw/ide/pci.c | 14 +++--- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c

[Qemu-devel] [PATCH v2 19/30] qtest: Adding qtest_memset and qmemset.

2014-08-04 Thread John Snow
Currently, libqtest allows for memread and memwrite, but does not offer a simple way to zero out regions of memory. This patch adds a simple function to do so. Signed-off-by: John Snow --- tests/libqtest.c | 12 tests/libqtest.h | 24 2 files changed, 36

[Qemu-devel] [PATCH v2 16/30] ide: make all commands go through cmd_done

2014-08-04 Thread John Snow
From: Paolo Bonzini AHCI has code to fill in the D2H FIS trigger the IRQ all over the place. Centralize this in a single cmd_done callback by generalizing the existing async_cmd_done callback. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/ahci.c | 16

[Qemu-devel] [PATCH v2 17/30] ahci: construct PIO Setup FIS for PIO commands

2014-08-04 Thread John Snow
From: Paolo Bonzini PIO commands should put a PIO Setup FIS in the receive area when data transfer ends. Currently QEMU does not do this and only places the D2H FIS at the end of the operation. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/ahci.c | 70

[Qemu-devel] [PATCH v2 12/30] ide: move BM_STATUS bits to pci.[ch]

2014-08-04 Thread John Snow
From: Paolo Bonzini They are not used by AHCI, and should not be even available there. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/internal.h | 11 --- hw/ide/pci.c | 4 hw/ide/pci.h | 7 +++ 3 files changed, 11 insertions(+), 11 deletions

[Qemu-devel] [PATCH v2 24/30] qtest/ide: Fix small memory leak

2014-08-04 Thread John Snow
devel mailing list. Signed-off-by: John Snow --- tests/ide-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/ide-test.c b/tests/ide-test.c index e2b4efc..a77a037 100644 --- a/tests/ide-test.c +++ b/tests/ide-test.c @@ -120,6 +120,8 @@ static void ide_test_start(const char *cmdlin

[Qemu-devel] [PATCH v2 14/30] ahci: remove duplicate PORT_IRQ_* constants

2014-08-04 Thread John Snow
From: Paolo Bonzini These are defined twice, just use one set consistently. Signed-off-by: Paolo Bonzini Signed-off-by: John Snow --- hw/ide/ahci.c | 6 +++--- hw/ide/ahci.h | 21 - 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide

[Qemu-devel] [PATCH v2 20/30] libqos: Correct memory leak

2014-08-04 Thread John Snow
Fix a small memory leak inside of libqos, in the pc_alloc_init routine. Signed-off-by: John Snow --- tests/libqos/malloc-pc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c index db1496c..63af60a 100644 --- a/tests/libqos/malloc-pc.c

[Qemu-devel] [PATCH v2 30/30] ahci: Add test_identify case to ahci-test.

2014-08-04 Thread John Snow
Utilizing all of the bring-up code in pci_enable and hba_enable, this test issues a simple IDENTIFY command via the HBA and retrieves the response via the PIO receive mechanisms of the HBA. Signed-off-by: John Snow --- tests/ahci-test.c | 296

[Qemu-devel] [PATCH v2 27/30] ahci: add test_pci_enable to ahci-test.

2014-08-04 Thread John Snow
This adds a test wherein we engage the PCI AHCI device and ensure that the memory region for the HBA functionality is now accessible. Under Q35 environments, additional PCI configuration is performed to ensure that the HBA functionality will become usable. Signed-off-by: John Snow --- tests

<    1   2   3   4   5   6   7   8   9   10   >