Re: [Qemu-devel] [PATCH 3/3] i386/kvm: advertise Hyper-V frequency MSRs

2017-08-04 Thread Ladi Prosek
On Fri, Aug 4, 2017 at 3:39 PM, David Hildenbrand wrote: > On 04.08.2017 11:14, Ladi Prosek wrote: >> As of kernel commit eb82feea59d6 ("KVM: hyperv: support >> HV_X64_MSR_TSC_FREQUENCY >> and HV_X64_MSR_APIC_FREQUENCY"), KVM supports two new MSRs which are required >> for nested Hyper-V to read

Re: [Qemu-devel] [PULL 0/1] cpu: crash fix for -rc2 (don't allow negative core id)

2017-08-04 Thread Peter Maydell
On 3 August 2017 at 18:59, Eduardo Habkost wrote: > The following changes since commit aaaec6acad7cf97372d48c1b09126a09697519c8: > > Update version for v2.10.0-rc1 release (2017-08-02 16:36:32 +0100) > > are available in the git repository at: > > git://github.com/ehabkost/qemu.git tags/machin

Re: [Qemu-devel] [Qemu-block] [PATCH for 2.10] block: use 1 MB bounce buffers for crypto instead of 16KB

2017-08-04 Thread Daniel P. Berrange
On Fri, Aug 04, 2017 at 07:08:54AM -0500, Eric Blake wrote: > On 08/04/2017 05:51 AM, Daniel P. Berrange wrote: > > Using 16KB bounce buffers creates a significant performance > > penalty for I/O to encrypted volumes on storage with high > > I/O latency (rotating rust & network drives), because it

[Qemu-devel] Is the use of bdrv_getlength() in parallels.c kosher? (was: Is the use of bdrv_getlength() in handle_aiocb_write_zeroes() kosher?)

2017-08-04 Thread Markus Armbruster
Same question for allocate_clusters() in parallels.c, commit 5a41e1f, modified in commit ddd2ef2: if (s->data_end + space > bdrv_getlength(bs->file->bs) >> BDRV_SECTOR_BITS) { bdrv_getlength() can fail. Does it do the right thing then? For what it's worth, the comparison of its value is si

[Qemu-devel] [PATCH v4 6/9] s390x/sclp: properly guard pci-specific functions

2017-08-04 Thread Cornelia Huck
If we do not provide zpci, pci reconfiguration via sclp is not available either. Don't indicate it in the sclp facilities and return an invalid command if the guest tries to issue pci configure/deconfigure. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/sclp.c | 19 +

Re: [Qemu-devel] [Bug 1708551] Re: macOS Guest Reading USB 3.0 Bus as USB 2.0

2017-08-04 Thread Divine E
Doing so returns: `qemu-system-x86_64: -device usb-tablet,bus=usb-bus.0: Bus 'usb-bus.0' not found` > On Aug 4, 2017, at 2:31 AM, Thomas Huth <1708...@bugs.launchpad.net> wrote: > > Could you please try to run QEMU without the "-usb" option here? "-usb" > automatically creates an EHCI and UHCI c

[Qemu-devel] [PATCH v4 2/9] s390x/pci: add stubs

2017-08-04 Thread Cornelia Huck
Some non-pci code calls into zpci code. Provide some stubs for builds without pci. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/Makefile.objs | 3 +- hw/s390x/s390-pci-stub.c | 74 2 files changed, 76 insertions(+), 1 del

Re: [Qemu-devel] Is the use of bdrv_getlength() in vmdk_check() kosher?

2017-08-04 Thread Fam Zheng
On Fri, 08/04 15:28, Markus Armbruster wrote: > Have a look at vmdk_check(): > > if (ret == VMDK_OK && > cluster_offset >= bdrv_getlength(extent->file->bs)) > > bdrv_getlength() can fail. Does it do the right thing then? For what > it's worth, the comparison of its value is

[Qemu-devel] Is the use of bdrv_getlength() in vmdk_check() kosher?

2017-08-04 Thread Markus Armbruster
Have a look at vmdk_check(): if (ret == VMDK_OK && cluster_offset >= bdrv_getlength(extent->file->bs)) bdrv_getlength() can fail. Does it do the right thing then? For what it's worth, the comparison of its value is unsigned.

[Qemu-devel] Is blk_getlength() in find_image_format() and img_map() kosher?

2017-08-04 Thread Markus Armbruster
Have a look at find_image_format(): if (blk_is_sg(file) || !blk_is_inserted(file) || blk_getlength(file) == 0) { *pdrv = &bdrv_raw; return ret; } blk_getlength() can fail. Shouldn't we error out then? We pretty obviously should in img_map(): length = blk_getlength(b

[Qemu-devel] [PATCH v2] block: document semanatics of bdrv_co_preadv|pwritev

2017-08-04 Thread Daniel P. Berrange
Signed-off-by: Daniel P. Berrange --- Changed in v2: - Document 'flags' parameter too (Eric) include/block/block_int.h | 31 +++ 1 file changed, 31 insertions(+) diff --git a/include/block/block_int.h b/include/block/block_int.h index d4f4ea7584..4fe3081742 100644

[Qemu-devel] [PATCH] quorum: Handle bdrv_getlength() failures in quorum_co_flush()

2017-08-04 Thread Alberto Garcia
A bdrv_getlength() call can fail and return a negative value. This is not being handled in quorum_co_flush(), which can result in a QUORUM_REPORT_BAD event with an arbitrary value on the 'sectors-count' field. Reported-by: Markus Armbruster Signed-off-by: Alberto Garcia --- block/quorum.c | 3 +

Re: [Qemu-devel] [PATCH] block: document semanatics of bdrv_co_preadv|pwritev

2017-08-04 Thread Kevin Wolf
Am 04.08.2017 um 12:50 hat Daniel P. Berrange geschrieben: > Signed-off-by: Daniel P. Berrange > --- > include/block/block_int.h | 29 + > 1 file changed, 29 insertions(+) > > diff --git a/include/block/block_int.h b/include/block/block_int.h > index d4f4ea7584..deb81

Re: [Qemu-devel] [PATCH v3 3/7] block: tidy ThrottleGroupMember initializations

2017-08-04 Thread Alberto Garcia
On Mon 31 Jul 2017 11:54:39 AM CEST, Manos Pitsidianakis wrote: > Move the CoMutex and CoQueue inits inside throttle_group_register_tgm() > which is called whenever a ThrottleGroupMember is initialized. There's > no need for them to be separate. > > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Ma

Re: [Qemu-devel] [PATCH] vl.c/exit: pause cpus before closing block devices

2017-08-04 Thread Paolo Bonzini
On 04/08/2017 11:58, Stefan Hajnoczi wrote: >> the root cause of this bug is related to this as well: >> https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg02945.html >> >> From commit 99723548 we started assuming (incorrectly?) that blk_ >> functions always WILL have an attached BDS, but thi

[Qemu-devel] [PATCH v4 5/9] s390x/ccw: create s390 phb conditionally

2017-08-04 Thread Cornelia Huck
Don't create the s390 pci host bridge if we do not provide the zpci facility. Reviewed-by: Thomas Huth Acked-by: Christian Borntraeger Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/s390x/s390-virt

[Qemu-devel] [PATCH v4 8/9] s390x/kvm: msi route fixup for non-pci

2017-08-04 Thread Cornelia Huck
If we don't provide pci, we cannot have a pci device for which we have to translate to adapter routes: just return -ENODEV. Signed-off-by: Cornelia Huck --- target/s390x/kvm.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 9de165d8b1..d8db

[Qemu-devel] [PATCH] qemu-img: Clarify about relative backing file options

2017-08-04 Thread Fam Zheng
It's not too surprising when a user specifies the backing file relative to the current working directory instead of the top layer image. This causes error when they differ. Though the error message has enough information to infer the fact about the misunderstanding, it is better if we document this

Re: [Qemu-devel] [Qemu-block] [PATCH for 2.10] block: use 1 MB bounce buffers for crypto instead of 16KB

2017-08-04 Thread Eric Blake
On 08/04/2017 05:51 AM, Daniel P. Berrange wrote: > Using 16KB bounce buffers creates a significant performance > penalty for I/O to encrypted volumes on storage with high > I/O latency (rotating rust & network drives), because it > triggers lots of fairly small I/O operations. > > On tests with r

[Qemu-devel] Unchecked blk_getlength() in device models and board code

2017-08-04 Thread Markus Armbruster
blk_getlength() can fail. I figure the following need fixing: hw/arm/musicpal.c: musicpal_init() hw/block/nand.c: nand_realize() hw/block/virtio-blk.c: virtio_blk_update_config() hw/ppc/ppc405_boards.c: taihu_405ep_init()

[Qemu-devel] [PATCH v4 1/9] kvm: remove hard dependency on pci

2017-08-04 Thread Cornelia Huck
The msi routing code in kvm calls some pci functions: provide some stubs to enable builds without pci. Also, to make this more obvious, guard them via a pci_available boolean (which also can be reused in other places). Fixes: e1d4fb2de ("kvm-irqchip: x86: add msi route notify fn") Fixes: 767a554a

[Qemu-devel] [PATCH v4 7/9] s390x/pci: fence off instructions for non-pci

2017-08-04 Thread Cornelia Huck
If a guest running on a machine without zpci issues a pci instruction, throw them an exception. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- target/s390x/kvm.c | 54 +- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git

Re: [Qemu-devel] [PATCH] block: document semanatics of bdrv_co_preadv|pwritev

2017-08-04 Thread Daniel P. Berrange
On Fri, Aug 04, 2017 at 04:02:10PM +0200, Kevin Wolf wrote: > Am 04.08.2017 um 12:50 hat Daniel P. Berrange geschrieben: > > Signed-off-by: Daniel P. Berrange > > --- > > include/block/block_int.h | 29 + > > 1 file changed, 29 insertions(+) > > > > diff --git a/inclu

Re: [Qemu-devel] [PATCH v2] qemu-img: Clarify about relative backing file options

2017-08-04 Thread Eric Blake
On 08/04/2017 09:36 AM, Fam Zheng wrote: > It's not too surprising when a user specifies the backing file relative > to the current working directory instead of the top layer image. This > causes error when they differ. Though the error message has enough > information to infer the fact about the m

[Qemu-devel] [PATCH v3] block: document semanatics of bdrv_co_preadv|pwritev

2017-08-04 Thread Daniel P. Berrange
Signed-off-by: Daniel P. Berrange --- - Clarify that @bytes matches @qiov total size (Kevin) include/block/block_int.h | 31 +++ 1 file changed, 31 insertions(+) diff --git a/include/block/block_int.h b/include/block/block_int.h index d4f4ea7584..4f7f20e56b 100644

[Qemu-devel] [PATCH for-2.10] vmdk: Fix error handling/reporting of vmdk_check

2017-08-04 Thread Fam Zheng
Errors from the callees must be captured and propagated to our caller, ensure this for both find_extent() and bdrv_getlength(). Reported-by: Markus Armbruster Signed-off-by: Fam Zheng --- block/vmdk.c | 26 ++ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git

Re: [Qemu-devel] [PATCH v4 for-2.10 01/15] mirror: inherit supported write/zero flags

2017-08-04 Thread Eric Blake
On 08/01/2017 09:18 AM, Anton Nefedov wrote: > Signed-off-by: Anton Nefedov > --- > block/mirror.c | 5 + > 1 file changed, 5 insertions(+) I think this one counts as a bug fix worthy of inclusion in 2.10. Reviewed-by: Eric Blake > > diff --git a/block/mirror.c b/block/mirror.c > index d

[Qemu-devel] [PATCH] block/null: Remove 'filename' option

2017-08-04 Thread Kevin Wolf
This option was only added to allow 'null-co://' and 'null-aio://' as filenames, its value never served any actual purpose and was ignored. Nevertheless it was accepted as '-drive driver=null,filename=foo'. The correct way to enable the protocol prefixes (and that without adding a useless -drive o

Re: [Qemu-devel] [PATCH v3 2/7] block: add aio_context field in ThrottleGroupMember

2017-08-04 Thread Alberto Garcia
On Mon 31 Jul 2017 11:54:38 AM CEST, Manos Pitsidianakis wrote: > timer_cb() needs to know about the current Aio context of the throttle > request that is woken up. In order to make ThrottleGroupMember backend > agnostic, this information is stored in an aio_context field instead of > accessing it

Re: [Qemu-devel] Is the use of bdrv_getlength() in vhdx*.c kosher?

2017-08-04 Thread Jeff Cody
On Fri, Aug 04, 2017 at 02:49:42PM +0200, Markus Armbruster wrote: > bdrv_getlength() can fail. There are several calls in vhdx*.c that > don't seem to check. Bug or not? Most definitely a bug. Shall I queue up some patches, or do you already have some?

[Qemu-devel] [PATCH 10/17] block/nbd-client: move nbd_coroutine_end content into nbd_co_request

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Move code from nbd_coroutine_end into nbd_co_request. The function nbd_coroutine_end is not needed separately, also it is better to have in_flight-- in nbd_co_request as in_flight++ lives in nbd_co_request too. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 14 +

Re: [Qemu-devel] Is the use of bdrv_getlength() in handle_aiocb_write_zeroes() kosher?

2017-08-04 Thread Markus Armbruster
"Denis V. Lunev" writes: > On 08/04/2017 03:16 PM, Markus Armbruster wrote: >> Denis, you added this in commit d50d822: >> >> #ifdef CONFIG_FALLOCATE >> if (s->has_fallocate && aiocb->aio_offset >= bdrv_getlength(aiocb->bs)) { >> int ret = do_fallocate(s->fd, 0, aiocb->aio_offset, >>

Re: [Qemu-devel] [PATCH v4 00/22] Clean up around qmp() and hmp()

2017-08-04 Thread Fam Zheng
On Fri, 08/04 06:50, Eric Blake wrote: > On 08/03/2017 08:54 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. > >

[Qemu-devel] [PATCH] pc/acpi: Fix booting of macOS with Clover EFI bootloader

2017-08-04 Thread Programmingkid
> On Aug 4, 2017, at 5:21 AM, qemu-devel-requ...@nongnu.org wrote: > > Message: 3 > Date: Fri, 4 Aug 2017 12:15:40 +0530 > From: > To: qemu-devel@nongnu.org > Cc: Igor Mammedov , Pankaj Gupta > , Dhiru Kholia > Subject: [Qemu-devel] [PATCH] pc/acpi: Fix booting of macOS with > Cl

[Qemu-devel] [PATCH 17/17] block/nbd-client: always return EIO on and after the first io channel error

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Do not communicate after the first error to avoid communicating throught broken channel. The only exclusion is try to send NBD_CMD_DISC anyway on in nbd_client_close. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 26 -- 1 file changed, 20 insertions

Re: [Qemu-devel] [Qemu-block] [PATCH] block/null: Remove 'filename' option

2017-08-04 Thread Eric Blake
On 08/04/2017 09:43 AM, Kevin Wolf wrote: > This option was only added to allow 'null-co://' and 'null-aio://' as > filenames, its value never served any actual purpose and was ignored. > Nevertheless it was accepted as '-drive driver=null,filename=foo'. > > The correct way to enable the protocol

[Qemu-devel] [PATCH 04/17] nbd/client: fix nbd_send_request to return int

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Fix nbd_send_request to return int, as it returns a return value of nbd_write (which is int), and the only user of nbd_send_request's return value (nbd_co_send_request) consider it as int too. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 2 +- nbd/client.c| 2 +-

[Qemu-devel] [PATCH 0/3] respect bdrv_getlength() error code

2017-08-04 Thread Denis V. Lunev
These cases were reported by Markus Armbruster Patches add error checking of the bdrv_getlength() call or remove the call of that function. Signed-off-by: Denis V. Lunev CC: Markus Armbruster CC: Kevin Wolf CC: Max Reitz CC: Stefan Hajnoczi

[Qemu-devel] [PATCH 16/17] block/nbd-client: drop reply field from NBDClientSession

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Drop 'reply' from NBDClientSession. It's usage is not very transparent: 1. it is used to deliver error to receiving coroutine, and receiving coroutine must save or handle it somehow and then zero out it in NBDClientSession. 2. it is used to inform receiving coroutines that nbd_read_reply_ent

Re: [Qemu-devel] [PATCH v4 0/9] s390x: zPCI detangling

2017-08-04 Thread Cornelia Huck
On Fri, 4 Aug 2017 13:29:37 +0200 Cornelia Huck wrote: > Next version, not so many changes from v3. > > As you might have guessed, the goals are still the same: > - Being able to disable PCI support in a build completely. > - Properly fencing off PCI if the relevant facility bit is not provided

[Qemu-devel] [PATCH 1/3] block: respect error code from bdrv_getlength in handle_aiocb_write_zeroes

2017-08-04 Thread Denis V. Lunev
Original idea beyond the code in question was the following: we have failed to write zeroes with fallocate(FALLOC_FL_ZERO_RANGE) as the simplest approach and via fallocate(FALLOC_FL_PUNCH_HOLE)/fallocate(0). We have the only chance now: if the request comes beyond end of the file. Thus we should ca

[Qemu-devel] QAPI design mistake: RockerPort member @speed shoud bi

2017-08-04 Thread Markus Armbruster
RockerPort member @speed is documented to be "in Mbps" (presumably Megabits/second). It uses QAPI type 'uint32'. This is inappropriate for QAPI/QMP. It should have been made plain bits/second (no multiple), and maybe 'uint64'. As far as I can tell, the QAPI part didn't get review from QAPI expe

[Qemu-devel] [PATCH] block: drop bdrv_set_key from BlockDriver

2017-08-04 Thread Paolo Bonzini
This is not used anymore since c01c214b69 ("block: remove all encryption handling APIs", 2017-07-11). Signed-off-by: Paolo Bonzini --- include/block/block_int.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index d4f4ea7584..7571c0aaaf 1

[Qemu-devel] [PATCH 2/3] parallels: respect error code of bdrv_getlength() in allocate_clusters()

2017-08-04 Thread Denis V. Lunev
If we can not get the file length, the state of BDS is broken completely. Return error to the caller. Signed-off-by: Denis V. Lunev CC: Markus Armbruster CC: Kevin Wolf CC: Max Reitz CC: Stefan Hajnoczi --- block/parallels.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff

[Qemu-devel] [PATCH 3/3] parallels: drop check that bdrv_truncate() is working

2017-08-04 Thread Denis V. Lunev
This would be actually strange and error prone. If truncate() nowadays will fail, there is something fatally wrong. Let's check for that during the actual work. The only fallback case is when the file is not zero initialized. In this case we should switch to preallocation via fallocate(). Signed-

[Qemu-devel] [Bug 1708551] Re: macOS Guest Reading USB 3.0 Bus as USB 2.0

2017-08-04 Thread Thomas Huth
Then simply omit the "bus=usb-bus.0" here - the devices then should be put onto the XHCI bus automatically. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1708551 Title: macOS Guest Reading USB 3.0

[Qemu-devel] [PATCH 05/17] block/nbd-client: get rid of ssize_t

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Use int variable for nbd_co_send_request return value (as nbd_co_send_request returns int). Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c index 25dd28406b..

[Qemu-devel] [PATCH 11/17] block/nbd-client: fix nbd_co_request: set s->reply.handle to 0 on error

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
We set s->reply.handle to 0 on one error path and don't set on another. For consistancy and to avoid assert in nbd_read_reply_entry let's set s->reply.handle to 0 in case of wrong handle too. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 6 +++--- 1 file changed, 3 inserti

Re: [Qemu-devel] [PATCH] pc/acpi: Fix booting of macOS with Clover EFI bootloader

2017-08-04 Thread Igor Mammedov
On Fri, 4 Aug 2017 16:17:07 +0530 Dhiru Kholia wrote: > On Fri, Aug 4, 2017 at 2:35 PM, Igor Mammedov wrote: > > On Fri, 4 Aug 2017 12:15:40 +0530 > > Dhiru Kholia wrote: > > > >> This was tested with macOS 10.12.5 and Clover r4114. > >> > >> Without this patch, the macOS boot process gets s

Re: [Qemu-devel] [Qemu-block] [PATCH] block: document semanatics of bdrv_co_preadv|pwritev

2017-08-04 Thread Eric Blake
On 08/04/2017 09:06 AM, Daniel P. Berrange wrote: > On Fri, Aug 04, 2017 at 04:02:10PM +0200, Kevin Wolf wrote: >> Am 04.08.2017 um 12:50 hat Daniel P. Berrange geschrieben: >>> Signed-off-by: Daniel P. Berrange >>> --- >> Really? We are asserting that they match in bdrv_aligned_preadv(): >> >>

[Qemu-devel] [PATCH 03/17] nbd/client: refactor nbd_receive_reply

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Refactor nbd_receive_reply to return 1 on success, 0 on eof, when no data was read and <0 for other cases, because returned size of read data is not actually used. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 2 +- nbd/client.c| 12 +--- 2 files changed,

[Qemu-devel] [PATCH 14/17] block/nbd-client: exit reply-reading coroutine on incorrect handle

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Check reply-handle == request-handle in the same place, where recv coroutine number is calculated from reply->handle and it's correctness checked - in nbd_read_reply_entry. Also finish nbd_read_reply_entry in case of reply-handle != request-handle in the same way as in case of incorrect reply-hand

[Qemu-devel] [PATCH 12/17] block/nbd-client: refactor nbd_co_request

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Reduce nesting, get rid of extra variable. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c index b84cab4079..d6145c7db0 100644 --- a/block/nb

[Qemu-devel] [PATCH 08/17] block/nbd-client: rename nbd_recv_coroutines_enter_all

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Rename nbd_recv_coroutines_enter_all to nbd_recv_coroutines_wake_all, as it most probably just add all recv coroutines into co_queue_wakeup, not directly enter them. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[Qemu-devel] [PATCH 09/17] block/nbd-client: move nbd_co_receive_reply content into nbd_co_request

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Move code from nbd_co_receive_reply into nbd_co_request. This simplify things, makes further refactoring possible. Also, a function starting with qemu_coroutine_yield is weird. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 33 ++--- 1 file chang

[Qemu-devel] [PATCH 01/17] nbd/client: fix nbd_opt_go

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Do not send NBD_OPT_ABORT to the broken server. After sending NBD_REP_ACK on NBD_OPT_GO server is most probably in transmission phase, when option sending is finished. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/client.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/nbd/client.c b

[Qemu-devel] [PATCH 13/17] block/nbd-client: refactor NBDClientSession.recv_coroutine

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Move from recv_coroutine[i] to requests[i].co. This is needed for further refactoring, new fields will be added to created structure. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.h | 4 +++- block/nbd-client.c | 20 ++-- 2 files changed, 13 insertions(+), 11

[Qemu-devel] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Set reply.handle to 0 on error path to prevent normal path of nbd_co_receive_reply. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/nbd-client.c b/block/nbd-client.c index dc19894a7c..0c88d84de6 100644 --- a/block/nbd-c

[Qemu-devel] [PATCH 15/17] block/nbd-client: refactor reading reply

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Read the whole reply in one place - in nbd_read_reply_entry. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.h | 1 + block/nbd-client.c | 27 +-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/block/nbd-client.h b/block/nbd-client.h in

[Qemu-devel] [PATCH 07/17] block/nbd-client: refactor request send/receive

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Move nbd_co_receive_reply and nbd_coroutine_end calls into nbd_co_send_request and rename the latter to just nbd_co_request. This removes code duplications in nbd_client_co_{pwrite,pread,...} functions. Also this is needed for further refactoring. Signed-off-by: Vladimir Sementsov-Ogievskiy ---

Re: [Qemu-devel] [Qemu-block] [PATCH v2] qemu-img: Clarify about relative backing file options

2017-08-04 Thread Jeff Cody
On Fri, Aug 04, 2017 at 10:36:58PM +0800, Fam Zheng wrote: > It's not too surprising when a user specifies the backing file relative > to the current working directory instead of the top layer image. This > causes error when they differ. Though the error message has enough > information to infer th

[Qemu-devel] [PATCH 00/17] nbd client refactoring and fixing

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
A bit more refactoring and fixing before BLOCK_STATUS series. I've tried to make individual patches simple enough, so there are a lot of them. Vladimir Sementsov-Ogievskiy (17): nbd/client: fix nbd_opt_go nbd/client: refactor nbd_read_eof nbd/client: refactor nbd_receive_reply nbd/client:

[Qemu-devel] [PATCH 02/17] nbd/client: refactor nbd_read_eof

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Refactor nbd_read_eof to return 1 on success, 0 on eof, when no data was read and <0 for other cases, because returned size of read data is not actually used. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/nbd-internal.h | 34 +- nbd/client.c

Re: [Qemu-devel] [PATCH v3] block: document semanatics of bdrv_co_preadv|pwritev

2017-08-04 Thread Daniel P. Berrange
On Fri, Aug 04, 2017 at 09:28:54AM -0500, Eric Blake wrote: > On 08/04/2017 09:08 AM, Daniel P. Berrange wrote: > > Signed-off-by: Daniel P. Berrange > > --- > > > > - Clarify that @bytes matches @qiov total size (Kevin) > > > > include/block/block_int.h | 31 +++ >

Re: [Qemu-devel] [PATCH v8 0/5] hypertrace: Lightweight guest-to-QEMU trace channel

2017-08-04 Thread Stefan Hajnoczi
On Sun, Jul 30, 2017 at 05:08:18PM +0300, Lluís Vilanova wrote: > The hypertrace channel allows guest code to emit events in QEMU (the host) > using > its tracing infrastructure (see "docs/trace.txt"). This works in both 'system' > and 'user' modes, is architecture-agnostic and introduces minimal

Re: [Qemu-devel] [PATCH v4 02/15] blkverify: set supported write/zero flags

2017-08-04 Thread Eric Blake
On 08/01/2017 09:18 AM, Anton Nefedov wrote: > Signed-off-by: Anton Nefedov > --- > block/blkverify.c | 9 + > 1 file changed, 9 insertions(+) Basically, blkverify supports a flag if BOTH of its underlying files also support the flag; if either side can't handle the flag, then we fall ba

Re: [Qemu-devel] [PATCH v4 14/15] iotest 190: test BDRV_REQ_ALLOCATE

2017-08-04 Thread Eric Blake
On 08/01/2017 09:19 AM, Anton Nefedov wrote: > Signed-off-by: Anton Nefedov > --- > tests/qemu-iotests/190 | 146 > + > tests/qemu-iotests/190.out | 50 > tests/qemu-iotests/group | 1 + > 3 files changed, 197 insertions(+) >

Re: [Qemu-devel] Is blk_getlength() in find_image_format() and img_map() kosher?

2017-08-04 Thread Eric Blake
On 08/04/2017 08:55 AM, Markus Armbruster wrote: > Have a look at find_image_format(): > > if (blk_is_sg(file) || !blk_is_inserted(file) || blk_getlength(file) == > 0) { > *pdrv = &bdrv_raw; > return ret; > } > > blk_getlength() can fail. Shouldn't we error out then? >

Re: [Qemu-devel] [PATCH for-2.10] quorum: Handle bdrv_getlength() failures in quorum_co_flush()

2017-08-04 Thread Eric Blake
On 08/04/2017 09:08 AM, Alberto Garcia wrote: > A bdrv_getlength() call can fail and return a negative value. This > is not being handled in quorum_co_flush(), which can result in a > QUORUM_REPORT_BAD event with an arbitrary value on the 'sectors-count' > field. > > Reported-by: Markus Armbruster

Re: [Qemu-devel] [PATCH for-2.10] vmdk: Fix error handling/reporting of vmdk_check

2017-08-04 Thread Eric Blake
On 08/04/2017 09:09 AM, Fam Zheng wrote: > Errors from the callees must be captured and propagated to our caller, > ensure this for both find_extent() and bdrv_getlength(). > > Reported-by: Markus Armbruster > Signed-off-by: Fam Zheng > --- > block/vmdk.c | 26 ++ > 1 fi

Re: [Qemu-devel] [Qemu-block] [PATCH] block/null: Remove 'filename' option

2017-08-04 Thread Jeff Cody
On Fri, Aug 04, 2017 at 04:43:54PM +0200, Kevin Wolf wrote: > This option was only added to allow 'null-co://' and 'null-aio://' as > filenames, its value never served any actual purpose and was ignored. > Nevertheless it was accepted as '-drive driver=null,filename=foo'. > > The correct way to en

Re: [Qemu-devel] [Qemu-block] [PATCH] block: document semanatics of bdrv_co_preadv|pwritev

2017-08-04 Thread Daniel P. Berrange
On Fri, Aug 04, 2017 at 10:41:54AM -0500, Eric Blake wrote: > On 08/04/2017 09:06 AM, Daniel P. Berrange wrote: > > On Fri, Aug 04, 2017 at 04:02:10PM +0200, Kevin Wolf wrote: > >> Am 04.08.2017 um 12:50 hat Daniel P. Berrange geschrieben: > >>> Signed-off-by: Daniel P. Berrange > >>> --- > > >>

[Qemu-devel] [PATCH for-2.10 0/2] RCU: forking fix and cleanups

2017-08-04 Thread Paolo Bonzini
The first patch fixes a migration deadlock. The second reverts a now-unnecessary hack (introduced to support the pre-MTTCG "kick the CPU thread" special behavior of qemu_mutex_lock_iothread). Paolo Paolo Bonzini (2): rcu: completely disable pthread_atfork callbacks as soon as possible Revert

[Qemu-devel] [PATCH 2/2] Revert "rcu: do not create thread in pthread_atfork callback"

2017-08-04 Thread Paolo Bonzini
This reverts commit a59629fcc6f603e19b516dc08f75334e5c480bd0. This is not needed anymore because the IOThread mutex is not "magic" anymore (need not kick the CPU thread) and also because fork callbacks are only enabled at the very beginning of QEMU's execution. Signed-off-by: Paolo Bonzini --- i

Re: [Qemu-devel] [PATCH 05/17] block/nbd-client: get rid of ssize_t

2017-08-04 Thread Daniel P. Berrange
On Fri, Aug 04, 2017 at 06:14:28PM +0300, Vladimir Sementsov-Ogievskiy wrote: > Use int variable for nbd_co_send_request return value (as > nbd_co_send_request returns int). Hmm, nbd_co_send_request() propagates return value of nbd_send_request, which returns ssize_t. IOW, I think we need to fix

Re: [Qemu-devel] [PATCH for-2.11 22/23] tcg/ppc: Look for shifted constants

2017-08-04 Thread Philippe Mathieu-Daudé
Hi Richard, On 08/04/2017 02:44 AM, Richard Henderson wrote: Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.inc.c | 9 + 1 file changed, 9 insertions(+) diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c index bc14d2c9c6..4b32809217 100644 --- a/tcg/ppc/tcg-ta

[Qemu-devel] [PATCH 1/2] rcu: completely disable pthread_atfork callbacks as soon as possible

2017-08-04 Thread Paolo Bonzini
Because of -daemonize, system mode QEMU sometimes needs to fork() and keep RCU enabled in the child. However, there is a possible deadlock with synchronize_rcu: - the CPU thread is inside a RCU critical section and wants to take the BQL in order to do MMIO - the monitor thread, which is owning

[Qemu-devel] [Bug 1352179] Re: could not open disk image

2017-08-04 Thread Thomas Huth
Triaging old bug tickets ... can you still reproduce this problem with the latest release of QEMU? how did you create the disk image? ** Changed in: qemu Status: New => Incomplete -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU

Re: [Qemu-devel] [Bug 1708551] Re: macOS Guest Reading USB 3.0 Bus as USB 2.0

2017-08-04 Thread Divine E
Removing the `bus=usb-bus.0` param from everything, [as shown here](https://pastebin.com/x0Cp70XD), boots fine; but completely breaks mouse functionality. To mitigate, i tried passing through a Logitech mousepad I own--in similar fashion to the iPhone; but Host complained about permissions & `libus

Re: [Qemu-devel] [PATCH v2 6/6] dev-storage: Fix the unusual function name

2017-08-04 Thread Philippe Mathieu-Daudé
On 08/04/2017 07:26 AM, Mao Zhongyi wrote: The function name of usb_msd_{realize,unrealize}_*, usb_msd_class_initfn_* are unusual. Rename it to usb_msd_*_{realize,unrealize}, usb_msd_class_*_initfn. Cc: Gerd Hoffmann Signed-off-by: Mao Zhongyi Reviewed-by: Philippe Mathieu-Daudé --- hw

Re: [Qemu-devel] [PATCH] kvm: workaround build break on gcc-7.1.1 / fedora26

2017-08-04 Thread Paolo Bonzini
On 03/08/2017 16:24, Cornelia Huck wrote: > On Thu, 3 Aug 2017 09:10:29 -0500 > Eric Blake wrote: > >> On 08/03/2017 08:46 AM, Philippe Mathieu-Daudé wrote: >>> Hi Greg, >>> >>> On 08/02/2017 11:47 AM, Greg Kurz wrote: Building QEMU on fedora26 with the latest gcc package fails:

Re: [Qemu-devel] [PATCH for-2.11 22/23] tcg/ppc: Look for shifted constants

2017-08-04 Thread Richard Henderson
On 08/04/2017 09:39 AM, Philippe Mathieu-Daudé wrote: >> @@ -638,6 +639,14 @@ static void tcg_out_movi_int(TCGContext *s, TCGType >> type, TCGReg ret, >> return; >> } >> +lsb = ctz64(arg); >> +high = arg >> lsb; >> +if (arg == (int16_t)arg) { > > Can you move these

Re: [Qemu-devel] [PATCH 1/2] rcu: completely disable pthread_atfork callbacks as soon as possible

2017-08-04 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > Because of -daemonize, system mode QEMU sometimes needs to fork() and > keep RCU enabled in the child. However, there is a possible deadlock > with synchronize_rcu: > > - the CPU thread is inside a RCU critical section and wants to take > the BQL i

[Qemu-devel] [PATCH 0/8] Implement ARM external abort handling

2017-08-04 Thread Peter Maydell
Following recent list discussion https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg00063.html here's a patchseries which defines a new API for handling CPU memory transaction failures at the right level in the memory subsystem code, and implements it for ARM so that we can generate prefetch

[Qemu-devel] [PATCH 7/8] target/arm: Allow deliver_fault() caller to specify EA bit

2017-08-04 Thread Peter Maydell
For external aborts, we will want to be able to specify the EA (external abort type) bit in the syndrome field. Allow callers of deliver_fault() to do that by adding a field to ARMMMUFaultInfo which we use when constructing the syndrome values. Signed-off-by: Peter Maydell --- target/arm/intern

[Qemu-devel] [PATCH 6/8] target/arm: Factor out fault delivery code

2017-08-04 Thread Peter Maydell
We currently have some similar code in tlb_fill() and in arm_cpu_do_unaligned_access() for delivering a data abort or prefetch abort. We're also going to want to do the same thing to handle external aborts. Factor out the common code into a new function deliver_fault(). Signed-off-by: Peter Mayd

[Qemu-devel] [PATCH 8/8] target/arm: Implement new do_transaction_failed hook

2017-08-04 Thread Peter Maydell
Implement the new do_transaction_failed hook for ARM, which should cause the CPU to take a prefetch abort or data abort. Signed-off-by: Peter Maydell --- target/arm/internals.h | 10 ++ target/arm/cpu.c | 1 + target/arm/op_helper.c | 43 +++

[Qemu-devel] [PATCH 2/8] cpu: Define new cpu_transaction_failed() hook

2017-08-04 Thread Peter Maydell
Currently we have a rather half-baked setup for allowing CPUs to generate exceptions on accesses to invalid memory: the CPU has a cpu_unassigned_access() hook which the memory system calls in unassigned_mem_write() and unassigned_mem_read() if the current_cpu pointer is non-NULL. This was original

[Qemu-devel] [PATCH 1/8] memory.h: Move MemTxResult type to memattrs.h

2017-08-04 Thread Peter Maydell
Move the MemTxResult type to memattrs.h. We're going to want to use it in cpu/qom.h, which doesn't want to include all of memory.h. In practice MemTxResult and MemTxAttrs are pretty closely linked since both are used for the new-style read_with_attrs and write_with_attrs callbacks, so memattrs.h is

[Qemu-devel] [PATCH 5/8] hw/arm: Set ignore_memory_transaction_failures for most ARM boards

2017-08-04 Thread Peter Maydell
Set the MachineClass flag ignore_memory_transaction_failures for almost all ARM boards. This means they retain the legacy behaviour that accesses to unimplemented addresses will RAZ/WI rather than aborting, when a subsequent commit adds support for external aborts. The exceptions are: * virt -- w

[Qemu-devel] [PATCH 4/8] boards.h: Define new flag ignore_memory_transaction_failures

2017-08-04 Thread Peter Maydell
Define a new MachineClass field ignore_memory_transaction_failures. If this is flag is true then the CPU will ignore memory transaction failures which should cause the CPU to take an exception due to an access to an unassigned physical address; the transaction will instead return zero (for a read)

[Qemu-devel] [PATCH 3/8] cputlb: Support generating CPU exceptions on memory transaction failures

2017-08-04 Thread Peter Maydell
Call the new cpu_transaction_failed() hook at the places where CPU generated code interacts with the memory system: io_readx() io_writex() get_page_addr_code() Any access from C code (eg via cpu_physical_memory_rw(), address_space_rw(), ld/st_*_phys()) will *not* trigger CPU exceptions via cpu_

[Qemu-devel] Do we need a "virt-2.10" machine type before the 2.10 release?

2017-08-04 Thread Peter Maydell
Hi; I noticed today that the virt board doesn't have a virt-2.10 machine type defined. Do we need to add it before release? (I don't know if there have in fact been any changes between 2.9 and 2.10 that would be compatibility issues.) thanks -- PMM

Re: [Qemu-devel] [PATCH 1/8] memory.h: Move MemTxResult type to memattrs.h

2017-08-04 Thread Richard Henderson
On 08/04/2017 10:20 AM, Peter Maydell wrote: > Move the MemTxResult type to memattrs.h. We're going to want to > use it in cpu/qom.h, which doesn't want to include all of > memory.h. In practice MemTxResult and MemTxAttrs are pretty > closely linked since both are used for the new-style > read_with

Re: [Qemu-devel] Do we need a "virt-2.10" machine type before the 2.10 release?

2017-08-04 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > Hi; I noticed today that the virt board doesn't have a virt-2.10 > machine type defined. Do we need to add it before release? > > (I don't know if there have in fact been any changes between > 2.9 and 2.10 that would be compatibility issues.) I

Re: [Qemu-devel] [PATCH v8 1/5] hypertrace: Add documentation

2017-08-04 Thread Eric Blake
On 07/30/2017 09:12 AM, Lluís Vilanova wrote: > Signed-off-by: Lluís Vilanova > --- > docs/devel/tracing.txt |3 + > docs/hypertrace.txt| 225 > Do we want the new document directly in docs/, or does it live in one of the subdirectories?

Re: [Qemu-devel] Do we need a "virt-2.10" machine type before the 2.10 release?

2017-08-04 Thread Peter Maydell
On 4 August 2017 at 18:48, Dr. David Alan Gilbert wrote: > * Peter Maydell (peter.mayd...@linaro.org) wrote: >> Hi; I noticed today that the virt board doesn't have a virt-2.10 >> machine type defined. Do we need to add it before release? >> >> (I don't know if there have in fact been any changes

[Qemu-devel] [PATCH f0r 2.11] runstate/migrate: Two more transitions

2017-08-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" There's a race if someone does a 'stop' near the end of migrate; the migration process goes through two runstates: 'finish migrate' 'postmigrate' If the user issues a 'stop' between the two we end up with invalid state transitions. Add the transitions as va

Re: [Qemu-devel] [Qemu-arm] [PATCH 4/8] boards.h: Define new flag ignore_memory_transaction_failures

2017-08-04 Thread Philippe Mathieu-Daudé
On 08/04/2017 02:20 PM, Peter Maydell wrote: Define a new MachineClass field ignore_memory_transaction_failures. If this is flag is true then the CPU will ignore memory transaction failures which should cause the CPU to take an exception due to an access to an unassigned physical address; the tra

Re: [Qemu-devel] [PATCH v8 0/5] hypertrace: Lightweight guest-to-QEMU trace channel

2017-08-04 Thread Lluís Vilanova
Stefan Hajnoczi writes: > On Sun, Jul 30, 2017 at 05:08:18PM +0300, Lluís Vilanova wrote: >> The hypertrace channel allows guest code to emit events in QEMU (the host) >> using >> its tracing infrastructure (see "docs/trace.txt"). This works in both >> 'system' >> and 'user' modes, is architectu

<    1   2   3   >