[Qemu-block] [PATCH] qemu-block: add support HMB with feature commands.

2017-10-20 Thread Minwoo Im
Add support HMB(Host Memory Block) with feature commands(Get Feature, Set Feature). nvme-4.14 tree supports HMB features. This patch will make nvme controller to return 32MiB preferred size of HMB to host via identify command. Set Feature, Get Feature implemented for HMB. Signed-off-by: Minwoo I

[Qemu-block] [PATCH] block: all I/O should be completed before removing throttle timers.

2017-10-20 Thread Zhengui Li
From: Zhengui In blk_remove_bs, all I/O should be completed before removing throttle timers. If there has inflight I/O, removing throttle timers here will cause the inflight I/O never return. This patch add bdrv_drained_begin before throttle_timers_detach_aio_context to let all I/O completed befo

Re: [Qemu-block] [PATCH v5 11/11] nbd: Minimal structured read for client

2017-10-20 Thread Eric Blake
On 10/20/2017 02:58 PM, Vladimir Sementsov-Ogievskiy wrote: > 20.10.2017 01:26, Eric Blake wrote: >> From: Vladimir Sementsov-Ogievskiy >> >> Minimal implementation: for structured error only error_report error >> message. >> >> Signed-off-by: Vladimir Sementsov-Ogievskiy >> Signed-off-by: Eric B

Re: [Qemu-block] nvme: Add tracing v3

2017-10-20 Thread Doug Gale
On Thu, Oct 12, 2017 at 3:07 PM, Doug Gale wrote: > From c7f12a5949458fdd195b5e0b52f158e8f114f203 Mon Sep 17 00:00:00 2001 > From: Doug Gale > Date: Thu, 12 Oct 2017 14:29:07 -0400 > Subject: [PATCH] nvme: Add tracing > > Add trace output for commands, errors, and undefined behavior. > Add guest

Re: [Qemu-block] [PATCH v5 11/11] nbd: Minimal structured read for client

2017-10-20 Thread Vladimir Sementsov-Ogievskiy
20.10.2017 01:26, Eric Blake wrote: From: Vladimir Sementsov-Ogievskiy Minimal implementation: for structured error only error_report error message. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Eric Blake --- v5: fix payload_advance[32,64], return correct negative error on str

Re: [Qemu-block] [PATCH v5 08/11] nbd/client: refactor nbd_receive_starttls

2017-10-20 Thread Eric Blake
On 10/20/2017 02:26 PM, Vladimir Sementsov-Ogievskiy wrote: > 20.10.2017 01:26, Eric Blake wrote: >> From: Vladimir Sementsov-Ogievskiy >> >> Split out nbd_request_simple_option to be reused for structured reply >> option. >> >> Signed-off-by: Vladimir Sementsov-Ogievskiy >> Signed-off-by: Eric B

Re: [Qemu-block] [PATCH v5 06/11] nbd: Minimal structured read for server

2017-10-20 Thread Vladimir Sementsov-Ogievskiy
20.10.2017 22:11, Eric Blake wrote: On 10/20/2017 02:03 PM, Vladimir Sementsov-Ogievskiy wrote: 20.10.2017 01:26, Eric Blake wrote: From: Vladimir Sementsov-Ogievskiy Minimal implementation of structured read: one structured reply chunk, no segmentation. Minimal structured error implementatio

Re: [Qemu-block] [PATCH v5 08/11] nbd/client: refactor nbd_receive_starttls

2017-10-20 Thread Vladimir Sementsov-Ogievskiy
20.10.2017 01:26, Eric Blake wrote: From: Vladimir Sementsov-Ogievskiy Split out nbd_request_simple_option to be reused for structured reply option. Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Eric Blake --- v5: only check length for ACK responses v4: reduce redundant traces,

Re: [Qemu-block] [PATCH v5 06/11] nbd: Minimal structured read for server

2017-10-20 Thread Eric Blake
On 10/20/2017 02:03 PM, Vladimir Sementsov-Ogievskiy wrote: > 20.10.2017 01:26, Eric Blake wrote: >> From: Vladimir Sementsov-Ogievskiy >> >> Minimal implementation of structured read: one structured reply chunk, >> no segmentation. >> Minimal structured error implementation: no text message. >> S

Re: [Qemu-block] [PATCH v5 07/11] nbd/server: Include human-readable message in structured errors

2017-10-20 Thread Vladimir Sementsov-Ogievskiy
20.10.2017 01:26, Eric Blake wrote: The NBD spec permits including a human-readable error string if structured replies are in force, so we might as well send the client the message that we logged on any error. Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best reg

Re: [Qemu-block] [PATCH v5 06/11] nbd: Minimal structured read for server

2017-10-20 Thread Vladimir Sementsov-Ogievskiy
20.10.2017 01:26, Eric Blake wrote: From: Vladimir Sementsov-Ogievskiy Minimal implementation of structured read: one structured reply chunk, no segmentation. Minimal structured error implementation: no text message. Support DF flag, but just ignore it, as there is no segmentation any way. Sig

Re: [Qemu-block] [PATCH v5 05/11] nbd/server: Refactor zero-length option check

2017-10-20 Thread Vladimir Sementsov-Ogievskiy
20.10.2017 18:07, Eric Blake wrote: On 10/20/2017 03:34 AM, Vladimir Sementsov-Ogievskiy wrote: 20.10.2017 01:26, Eric Blake wrote: Consolidate the check for a zero-length payload to an option into a new function, nbd_check_zero_length(); this check will also be used when introducing support fo

Re: [Qemu-block] [PATCH v6 00/24] make bdrv_get_block_status byte-based

2017-10-20 Thread Kevin Wolf
Am 12.10.2017 um 05:46 hat Eric Blake geschrieben: > There are patches floating around to add NBD_CMD_BLOCK_STATUS, > but NBD wants to report status on byte granularity (even if the > reporting will probably be naturally aligned to sectors or even > much higher levels). I've therefore started the

Re: [Qemu-block] [Qemu-devel] [PATCH v3 42/46] util: Replace fprintf(stderr, "*\n" with error_report()

2017-10-20 Thread Alistair Francis
On Fri, Oct 20, 2017 at 3:47 AM, Stefan Hajnoczi wrote: > On Fri, Oct 20, 2017 at 08:27:41AM +0200, Thomas Huth wrote: >> On 19.10.2017 21:47, Stefan Weil wrote: >> > Am 19.10.2017 um 19:53 schrieb Thomas Huth: >> >> On 19.10.2017 18:18, Alistair Francis wrote: >> >>> Replace a large number of the

Re: [Qemu-block] [PATCH v6 12/24] block: Convert bdrv_get_block_status_above() to bytes

2017-10-20 Thread Kevin Wolf
Am 20.10.2017 um 17:22 hat Eric Blake geschrieben: > On 10/20/2017 10:03 AM, Kevin Wolf wrote: > > Am 12.10.2017 um 05:47 hat Eric Blake geschrieben: > >> We are gradually moving away from sector-based interfaces, towards > >> byte-based. In the common case, allocation is unlikely to ever use > >>

Re: [Qemu-block] [Qemu-devel] [PATCH v6 23/24] qcow2: Relax is_zero() assertion

2017-10-20 Thread Eric Blake
On 10/20/2017 10:11 AM, Kevin Wolf wrote: > Am 12.10.2017 um 15:20 hat Eric Blake geschrieben: >> On 10/11/2017 10:47 PM, Eric Blake wrote: >>> Now that bdrv_is_allocated accepts non-aligned inputs, we can >>> remove the TODO added in earlier refactoring. >>> >>> Signed-off-by: Eric Blake >> >> I

Re: [Qemu-block] [PATCH v6 07/24] block: Convert bdrv_get_block_status() to bytes

2017-10-20 Thread Kevin Wolf
Am 20.10.2017 um 17:12 hat Eric Blake geschrieben: > On 10/20/2017 09:31 AM, Kevin Wolf wrote: > > Am 12.10.2017 um 05:47 hat Eric Blake geschrieben: > >> We are gradually moving away from sector-based interfaces, towards > >> byte-based. In the common case, allocation is unlikely to ever use > >>

Re: [Qemu-block] [PATCH v6 12/24] block: Convert bdrv_get_block_status_above() to bytes

2017-10-20 Thread Eric Blake
On 10/20/2017 10:03 AM, Kevin Wolf wrote: > Am 12.10.2017 um 05:47 hat Eric Blake geschrieben: >> We are gradually moving away from sector-based interfaces, towards >> byte-based. In the common case, allocation is unlikely to ever use >> values that are not naturally sector-aligned, but it is poss

Re: [Qemu-block] [Qemu-devel] [PATCH v6 23/24] qcow2: Relax is_zero() assertion

2017-10-20 Thread Kevin Wolf
Am 12.10.2017 um 15:20 hat Eric Blake geschrieben: > On 10/11/2017 10:47 PM, Eric Blake wrote: > > Now that bdrv_is_allocated accepts non-aligned inputs, we can > > remove the TODO added in earlier refactoring. > > > > Signed-off-by: Eric Blake > > I was a bit too hasty in the copy-and-paste fro

Re: [Qemu-block] [PATCH v6 07/24] block: Convert bdrv_get_block_status() to bytes

2017-10-20 Thread Eric Blake
On 10/20/2017 09:31 AM, Kevin Wolf wrote: > Am 12.10.2017 um 05:47 hat Eric Blake geschrieben: >> We are gradually moving away from sector-based interfaces, towards >> byte-based. In the common case, allocation is unlikely to ever use >> values that are not naturally sector-aligned, but it is poss

Re: [Qemu-block] [Qemu-devel] [PATCH v5 00/11] nbd minimal structured read

2017-10-20 Thread Eric Blake
On 10/19/2017 06:07 PM, no-re...@patchew.org wrote: > Hi, > > This series failed automatic build test. Please find the testing commands and > their output below. If you have docker installed, you can probably reproduce > it > locally. > > 058 - output mismatch (see 058.out.bad) > --- /t

Re: [Qemu-block] [PATCH v5 05/11] nbd/server: Refactor zero-length option check

2017-10-20 Thread Eric Blake
On 10/20/2017 03:34 AM, Vladimir Sementsov-Ogievskiy wrote: > 20.10.2017 01:26, Eric Blake wrote: >> Consolidate the check for a zero-length payload to an option >> into a new function, nbd_check_zero_length(); this check will >> also be used when introducing support for structured replies. >> >> B

Re: [Qemu-block] [PATCH v6 12/24] block: Convert bdrv_get_block_status_above() to bytes

2017-10-20 Thread Kevin Wolf
Am 12.10.2017 um 05:47 hat Eric Blake geschrieben: > We are gradually moving away from sector-based interfaces, towards > byte-based. In the common case, allocation is unlikely to ever use > values that are not naturally sector-aligned, but it is possible > that byte-based values will let us be mo

Re: [Qemu-block] [PATCH v6 07/24] block: Convert bdrv_get_block_status() to bytes

2017-10-20 Thread Kevin Wolf
Am 12.10.2017 um 05:47 hat Eric Blake geschrieben: > We are gradually moving away from sector-based interfaces, towards > byte-based. In the common case, allocation is unlikely to ever use > values that are not naturally sector-aligned, but it is possible > that byte-based values will let us be mo

Re: [Qemu-block] [PATCH] throttle: fix a qemu crash problem when calling blk_delete

2017-10-20 Thread Alberto Garcia
On Sun 24 Nov 2013 04:55:52 AM CET, sochin.jiang wrote: ^^^ I guess the date in your computer is wrong :-) > commit 7ca7f0 moves the throttling related part of the BDS life cycle > management to BlockBackend, adds call to > throttle_timers_detach_aio_context in blk_remove_bs. commi

Re: [Qemu-block] [Qemu-devel] [PATCH v3 42/46] util: Replace fprintf(stderr, "*\n" with error_report()

2017-10-20 Thread Stefan Hajnoczi
On Fri, Oct 20, 2017 at 08:27:41AM +0200, Thomas Huth wrote: > On 19.10.2017 21:47, Stefan Weil wrote: > > Am 19.10.2017 um 19:53 schrieb Thomas Huth: > >> On 19.10.2017 18:18, Alistair Francis wrote: > >>> Replace a large number of the fprintf(stderr, "*\n" calls with > >>> error_report(). The fun

Re: [Qemu-block] Clean Block Driver Shutdown

2017-10-20 Thread Stefan Hajnoczi
On Tue, Oct 17, 2017 at 01:46:25PM +0200, Kevin Wolf wrote: > Am 17.10.2017 um 12:33 hat Peter Lieven geschrieben: > > I noticed that Qemu quits at several points with an exit() if the > > supplied parameters in the commandline are incorrect. This at some > > stages happens after there have already

Re: [Qemu-block] [PATCH] ide: avoid referencing NULL dev in rotational rate setting

2017-10-20 Thread Stefan Hajnoczi
On Fri, Oct 20, 2017 at 10:14:03AM +0100, Daniel P. Berrange wrote: > The 'dev' variable can be NULL when the guest OS calls identify on an IDE > unit that does not have a drive attached to it. > > Signed-off-by: Daniel P. Berrange > --- > hw/ide/core.c | 4 +++- > 1 file changed, 3 insertions(+

[Qemu-block] [PATCH] ide: avoid referencing NULL dev in rotational rate setting

2017-10-20 Thread Daniel P. Berrange
The 'dev' variable can be NULL when the guest OS calls identify on an IDE unit that does not have a drive attached to it. Signed-off-by: Daniel P. Berrange --- 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 a04766aee7..471

Re: [Qemu-block] [Qemu-devel] [PATCH v1 2/2] ide: support reporting of rotation rate

2017-10-20 Thread Daniel P. Berrange
On Fri, Oct 20, 2017 at 10:42:21AM +0200, Kevin Wolf wrote: > [ Cc: qemu-block ] > > Am 04.10.2017 um 13:40 hat Daniel P. Berrange geschrieben: > > The Linux kernel will query the ATA IDENTITY DEVICE data, word 217 > > to determine the rotations per minute of the disk. If this has > > the value 1,

Re: [Qemu-block] [Qemu-devel] [PATCH v1 2/2] ide: support reporting of rotation rate

2017-10-20 Thread Kevin Wolf
[ Cc: qemu-block ] Am 04.10.2017 um 13:40 hat Daniel P. Berrange geschrieben: > The Linux kernel will query the ATA IDENTITY DEVICE data, word 217 > to determine the rotations per minute of the disk. If this has > the value 1, it is taken to be an SSD and so Linux sets the > 'rotational' flag to 0

Re: [Qemu-block] [PATCH v5 05/11] nbd/server: Refactor zero-length option check

2017-10-20 Thread Vladimir Sementsov-Ogievskiy
20.10.2017 01:26, Eric Blake wrote: Consolidate the check for a zero-length payload to an option into a new function, nbd_check_zero_length(); this check will also be used when introducing support for structured replies. By sticking a catch-all check at the end of the loop for processing options

Re: [Qemu-block] [PATCH v5 04/11] nbd/server: Report error for write to read-only export

2017-10-20 Thread Vladimir Sementsov-Ogievskiy
20.10.2017 01:26, Eric Blake wrote: When the server is read-only, we were already reporting an error message for NBD_CMD_WRITE_ZEROES, but failed to set errp for a similar NBD_CMD_WRITE. This will matter more once structured replies allow the server to propagate the errp information back to the

Re: [Qemu-block] [PATCH v5 03/11] nbd: Expose constants and structs for structured read

2017-10-20 Thread Vladimir Sementsov-Ogievskiy
20.10.2017 01:26, Eric Blake wrote: Upcoming patches will implement the NBD structured reply extension [1] for both client and server roles. Declare the constants, structs, and lookup routines that will be valuable whether the server or client code is backported in isolation. This includes movi