Re: [Qemu-block] [PATCH v2 13/21] block: Introduce bs->explicit_options

2016-01-08 Thread Paolo Bonzini
On 23/11/2015 16:59, Kevin Wolf wrote: > +bs->explicit_options = qdict_clone_shallow(options); qdict_clone_shallow dereferences options, and other parts of bdrv_open_inherit assume options != NULL. You can remove the first part of this condition, some 50 lines below: /* Check if any

Re: [Qemu-block] [Qemu-devel] [PATCH] ide: ahci: reset ncq object to unused on error

2016-01-08 Thread John Snow
On 01/08/2016 07:08 AM, P J P wrote: > From: Prasad J Pandit > > When processing NCQ commands, ACHI device emulation prepares a > NCQ transfer object; To which an aio control block(aiocb) object > is assigned in 'execute_ncq_command'. In case, when the NCQ > command is

Re: [Qemu-block] [Qemu-devel] [PATCH] ide: ahci: reset ncq object to unused on error

2016-01-08 Thread P J P
+-- On Fri, 8 Jan 2016, John Snow wrote --+ | In both of these error pathways, AIOCB is actually never assigned to | begin with. True, it's mentioned in the commit message. | So it's not necessarily a use-after-free. Yes, right. | I think it should be safe to put ncq_tfs->used = 0

[Qemu-block] [PATCH v2 7/9] libqos/ahci: add ahci_exec

2016-01-08 Thread John Snow
add ahci_exec, which is a standard purpose flexible command dispatcher and tester for the AHCI device. The intent is to eventually cut down on the absurd amount of boilerplate inside of the AHCI qtest. Signed-off-by: John Snow --- tests/libqos/ahci.c | 76

[Qemu-block] [PATCH v2 2/9] libqos/ahci: ATAPI support

2016-01-08 Thread John Snow
Add pathways to tolerate ATAPI commands. Notably, unlike ATA, each SCSI command's layout is a little different, so support will have to be patched in for each command as we want to test them in e.g. ahci_command_set_sizes and ahci_command_set_offset. For now, I'm adding support for 0x28, READ

Re: [Qemu-block] [Qemu-devel] [PATCH v2] ide: ahci: reset ncq object to unused on error

2016-01-08 Thread John Snow
On 01/08/2016 02:48 PM, P J P wrote: > From: Prasad J Pandit > > When processing NCQ commands, ACHI device emulation prepares a > NCQ transfer object; To which an aio control block(aiocb) object > is assigned in 'execute_ncq_command'. In case, when the NCQ > command is

[Qemu-block] [PATCH v2 5/9] libqos: allow zero-size allocations

2016-01-08 Thread John Snow
As part of streamlining the AHCI tests interface, it'd be nice if specying a size of zero could be handled without special branches and the allocator could handle this special case gracefully. This lets me use the "ahci_io" macros for non-data commands, too, which moves me forward towards

[Qemu-block] [PATCH v2 1/9] ahci-test: fix memory leak

2016-01-08 Thread John Snow
Use the proper free command to detroy an AHCICommand. Signed-off-by: John Snow --- tests/ahci-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 0888506..f4945dc 100644 --- a/tests/ahci-test.c +++

[Qemu-block] [PATCH v2 0/9] ahci: atapi qtests

2016-01-08 Thread John Snow
Add ATAPI support into libqos/ahci, and write a few tests for it. This is the last "batch" of planned qtests for s/ata -- basic i/o testing of HDDs and CDROMs on both PCI and AHCI should be complete after this series. v2: Rebase and resend for 2.6.

[Qemu-block] [PATCH v2 9/9] libqos/ahci: organize header

2016-01-08 Thread John Snow
Organize the prototypes into nice little sections. Signed-off-by: John Snow --- tests/libqos/ahci.h | 36 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/tests/libqos/ahci.h b/tests/libqos/ahci.h index 2c2d2fc..69dc4d7

[Qemu-block] [PATCH v2 4/9] libqos/ahci: Switch to mutable properties

2016-01-08 Thread John Snow
ATAPI commands are, unfortunately, weird in that they can be either DMA or PIO depending on a header bit. In order to accommodate them, I'll need to make AHCI command properties mutable so we can toggle between which "flavor" of ATAPI command we want to test. The default ATAPI transfer mechanism

[Qemu-block] [PATCH v2 3/9] libqos/ahci: ATAPI identify

2016-01-08 Thread John Snow
We need to say "hello!" to our ATAPI friends in a slightly different manner. Signed-off-by: John Snow --- tests/ahci-test.c | 8 +++- tests/libqos/ahci.c | 5 + tests/libqos/ahci.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git

[Qemu-block] [PATCH v2 8/9] qtest/ahci: ATAPI data tests

2016-01-08 Thread John Snow
Simple I/O tests for DMA and PIO pathways in the AHCI HBA. I believe at this point in time all of the common, major IO pathways in BMDMA and AHCI are covered by qtests now. Signed-off-by: John Snow --- tests/ahci-test.c | 97

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/9] ahci: atapi qtests

2016-01-08 Thread John Snow
On 01/08/2016 02:55 PM, John Snow wrote: > Add ATAPI support into libqos/ahci, and write a few tests for it. > > This is the last "batch" of planned qtests for s/ata -- basic i/o > testing of HDDs and CDROMs on both PCI and AHCI should be complete > after this series. > > v2: Rebase and resend

[Qemu-block] [PATCH v2 6/9] libqos/ahci: allow nondata commands for ahci_io variants

2016-01-08 Thread John Snow
These variants try to set a data offset, even if you don't specify one. In the cases where the offset is zero and it's a nondata command, just ignore the instruction. Signed-off-by: John Snow --- tests/ahci-test.c | 14 ++ tests/libqos/ahci.c | 3 +++ 2 files

Re: [Qemu-block] [Qemu-devel] [PATCH v2] ide: ahci: reset ncq object to unused on error

2016-01-08 Thread John Snow
On 01/08/2016 02:48 PM, P J P wrote: > From: Prasad J Pandit > > When processing NCQ commands, ACHI device emulation prepares a > NCQ transfer object; To which an aio control block(aiocb) object > is assigned in 'execute_ncq_command'. In case, when the NCQ > command is

Re: [Qemu-block] [Qemu-devel] [PULL 00/21] Block layer patches

2016-01-08 Thread Peter Maydell
On 7 January 2016 at 22:57, Max Reitz wrote: > Kevin is on PTO this week, so I am filling in for him. > > > The following changes since commit a7e00e2536941a6e570b45b7ab4afec4505ff67e: > > petalogix-ml605: Set the MicroBlaze CPU version to 8.10.a (2016-01-07 > 14:57:26

Re: [Qemu-block] [Qemu-devel] [PATCH v2] ide: ahci: reset ncq object to unused on error

2016-01-08 Thread P J P
+-- On Fri, 8 Jan 2016, John Snow wrote --+ | > ide_state->status = READY_STAT | ERR_STAT; | > ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag); | > +ncq_tfs->used = 0; | > } | | Thanks, applied to my IDE tree: | | https://github.com/jnsnow/qemu/commits/ide |

Re: [Qemu-block] [Qemu-devel] [PULL v2 10/40] blockdev: Implement change with basic operations

2016-01-08 Thread Peter Maydell
On 7 January 2016 at 22:43, Max Reitz wrote: > I hope that the above explanation helped you understand why it bled into > tray-less devices, from a technical perspective. Yes, thanks, that was definitely a helpful explanation for why the design is the way it is. I'm still not

[Qemu-block] [PATCH] ide: ahci: reset ncq object to unused on error

2016-01-08 Thread P J P
From: Prasad J Pandit When processing NCQ commands, ACHI device emulation prepares a NCQ transfer object; To which an aio control block(aiocb) object is assigned in 'execute_ncq_command'. In case, when the NCQ command is invalid, the 'aiocb' object is not assigned, and

Re: [Qemu-block] [PATCH 04/10] hw/sd: Add QOM bus which SD cards plug in to

2016-01-08 Thread Peter Crosthwaite
On Thu, Jan 7, 2016 at 10:09 AM, Peter Maydell wrote: > On 20 December 2015 at 20:51, Peter Crosthwaite > wrote: >> On Sun, Dec 20, 2015 at 9:10 AM, Peter Maydell >> wrote: >>> For user-level back compat I think we

[Qemu-block] [PULL 55/59] i386/pc: expose identifying the floppy controller

2016-01-08 Thread Michael S. Tsirkin
From: Roman Kagan Factor out and expose the function to locate the floppy controller in the system. It will allow to dynamically populate the relevant objects in the ACPI tables. Signed-off-by: Roman Kagan Cc: "Michael S. Tsirkin"

Re: [Qemu-block] [PATCH 1/2] nbd: Interface tweak of nbd_client_new

2016-01-08 Thread Daniel P. Berrange
On Wed, Dec 30, 2015 at 01:49:25PM +0800, Fam Zheng wrote: > In preparation for an async implementation, introduce a callback and > move the shutdown/close to the function. > > Signed-off-by: Fam Zheng > --- > blockdev-nbd.c | 5 ++--- > include/block/nbd.h | 6 -- >

[Qemu-block] [PATCH 1/2] block: detach devices from DriveInfo at unrealize time

2016-01-08 Thread Paolo Bonzini
Instead of delaying blk_detach_dev and blockdev_auto_del until the object is finalized and properties are released, do that as soon as possible. This patch replaces blockdev_mark_auto_del calls with blk_detach_dev and blockdev_del_drive (the latter is a combination of the former

[Qemu-block] [RFC PATCH 0/2] Early release of -drive QemuOpts

2016-01-08 Thread Paolo Bonzini
In short, this patch gets rid of blockdev_mark_auto_del and blockdev_auto_del. With these patches, it is possible to create a new -drive with the same id as soon as the DEVICE_DELETED event is delivered (which equals to unrealize). I'm sorry I'm not able to explain the history (and probably do

[Qemu-block] [PATCH 2/2] block: remove legacy_dinfo at blk_detach_dev time

2016-01-08 Thread Paolo Bonzini
Currently, blockdev_del_drive does a blk_unref (and before it blockdev_auto_del did the same) that will cause blk_delete to be called and the DriveInfo to be freed. But really, we want to free the drive info as soon as the device is detached, even if there are other references for whatever