Re: [Qemu-devel] [PATCH v5 1/7] stm32f205_timer: Add the stm32f205 Timer

2014-10-21 Thread Alistair Francis
On Mon, Oct 20, 2014 at 5:18 PM, Peter Crosthwaite wrote: > Sorry about the review delay... > > On Thu, Oct 16, 2014 at 10:53 PM, Alistair Francis > wrote: >> This patch adds the stm32f205 timers: TIM2, TIM3, TIM4 and TIM5 >> to QEMU. >> >> Signed-off-by: Alistair Francis >> --- >> V4: >> - Up

Re: [Qemu-devel] [PATCH 0/4] multiwrite patches for 2.2

2014-10-21 Thread Max Reitz
On 2014-10-20 at 22:48, Peter Lieven wrote: Am 20.10.2014 um 17:56 schrieb Max Reitz : On 20.10.2014 at 16:35, Peter Lieven wrote: This adds some preparing patches for upcoming multiwrite modifications. I will leave the dangerous patches for after 2.2 release. Peter Lieven (4): block: add

Re: [Qemu-devel] [PATCH v6 06/11] qcow2: Fix refcount blocks beyond image end

2014-10-21 Thread Max Reitz
On 2014-10-20 at 18:44, Kevin Wolf wrote: Am 20.10.2014 um 16:35 hat Max Reitz geschrieben: If the qcow2 check function detects a refcount block located beyond the image end, grow the image appropriately. This cannot break anything and is the logical fix for such a case. Signed-off-by: Max Reit

[Qemu-devel] QEMU's performance

2014-10-21 Thread Ayaz Akram
Hi, I have added support for MIPS64 based octeon linux in QEMU, and now I want to compare performance of this emulated system with real system( cavium networks octeon board). I have run benchmarks like lmbench. I need to know what will be the most appropriate benchmarks to compare performance or an

Re: [Qemu-devel] [question] savevm/delvm: Is it necessary to perform bdrv_drain_all before savevm and delvm?

2014-10-21 Thread Kevin Wolf
Am 21.10.2014 um 03:13 hat Zhang Haoyu geschrieben: > >> >> Hi, > >> >> > >> >> I noticed that bdrv_drain_all is performed in load_vmstate before > >> bdrv_snapshot_goto, > >> >> and bdrv_drain_all is performed in qmp_transaction before > >> internal_snapshot_prepare, > >> >> so is it also neccesar

Re: [Qemu-devel] [PATCH v5 1/7] stm32f205_timer: Add the stm32f205 Timer

2014-10-21 Thread Peter Crosthwaite
On Tue, Oct 21, 2014 at 5:05 PM, Alistair Francis wrote: > On Mon, Oct 20, 2014 at 5:18 PM, Peter Crosthwaite > wrote: >> Sorry about the review delay... >> >> On Thu, Oct 16, 2014 at 10:53 PM, Alistair Francis >> wrote: >>> This patch adds the stm32f205 timers: TIM2, TIM3, TIM4 and TIM5 >>> to

Re: [Qemu-devel] [PATCH 0/4] multiwrite patches for 2.2

2014-10-21 Thread Peter Lieven
On 21.10.2014 09:06, Max Reitz wrote: On 2014-10-20 at 22:48, Peter Lieven wrote: Am 20.10.2014 um 17:56 schrieb Max Reitz : On 20.10.2014 at 16:35, Peter Lieven wrote: This adds some preparing patches for upcoming multiwrite modifications. I will leave the dangerous patches for after 2.2 rel

Re: [Qemu-devel] [PATCH v6 07/11] qcow2: Do not perform potentially damaging repairs

2014-10-21 Thread Kevin Wolf
Am 20.10.2014 um 16:35 hat Max Reitz geschrieben: > If a referenced cluster has a refcount of 0, increasing its refcount may > result in clusters being allocated for the refcount structures. This may > overwrite the referenced cluster, therefore we cannot simply increase > the refcount then. > > I

Re: [Qemu-devel] [PATCH 0/4] multiwrite patches for 2.2

2014-10-21 Thread Peter Lieven
On 21.10.2014 09:06, Max Reitz wrote: On 2014-10-20 at 22:48, Peter Lieven wrote: Am 20.10.2014 um 17:56 schrieb Max Reitz : On 20.10.2014 at 16:35, Peter Lieven wrote: This adds some preparing patches for upcoming multiwrite modifications. I will leave the dangerous patches for after 2.2 rel

[Qemu-devel] [PATCH] snapshot: use local variable to bdrv_pwrite_sync L1 table

2014-10-21 Thread Zhang Haoyu
Use local variable to bdrv_pwrite_sync L1 table, needless to make conversion of cached L1 table between big-endian and host style. Signed-off-by: Zhang Haoyu --- block/qcow2-refcount.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/block/qcow2-refcoun

Re: [Qemu-devel] [PATCH] block: char devices on FreeBSD are not behind a pager

2014-10-21 Thread Roger Pau Monné
El 20/10/14 a les 19.22, Kevin Wolf ha escrit: > Am 20.10.2014 um 18:39 hat Roger Pau Monne geschrieben: >> Acknowledge this and forcefully set BDRV_O_NOCACHE and O_DIRECT in order to >> force QEMU to use aligned buffers. >> >> Signed-off-by: Roger Pau Monné >> Cc: Kevin Wolf >> Cc: Stefan Hajnoc

Re: [Qemu-devel] spec, RFC: TLS support for NBDµ

2014-10-21 Thread Markus Armbruster
Wouter Verhelst writes: > On Mon, Oct 20, 2014 at 01:51:43PM +0200, Markus Armbruster wrote: >> Stefan Hajnoczi writes: >> >> > On Mon, Oct 20, 2014 at 08:58:14AM +0100, Daniel P. Berrange wrote: >> >> On Sat, Oct 18, 2014 at 07:33:22AM +0100, Richard W.M. Jones wrote: >> >> > On Sat, Oct 18, 2

Re: [Qemu-devel] Patch checking bot

2014-10-21 Thread Fam Zheng
On Mon, Oct 20, 2014 at 6:25 PM, Stefan Hajnoczi wrote: > Hi, > At KVM Forum 2014 we discussed a patch checking bot that automates patch > format checking and smoke testing: > > 1. Did the patch submitter include Signed-off-by? > 2. Does checkpatch.pl pass? > 3. Does the patch apply to qemu.git/ma

Re: [Qemu-devel] Close the BlockDriverState when guest eject the media

2014-10-21 Thread Markus Armbruster
Weidong Huang writes: > On 2014/10/20 20:12, Markus Armbruster wrote: > >> >> Correct. This is a known wart. To work around it, wait for event >> DEVICE_TRAY_MOVED and eject again. Yes, this is racy: the guest can >> reclose the tray and lock it before you get your eject in. > > > Yes. You go

[Qemu-devel] [PATCH bugfix] snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem

2014-10-21 Thread Zhang Haoyu
If there are still pending i/o while deleting snapshot, because deleting snapshot is done in non-coroutine context, and the pending i/o read/write (bdrv_co_do_rw) is done in coroutine context, so it's possible to cause concurrency problem between above two operations. Add bdrv_drain_all() to bdrv_s

[Qemu-devel] [PATCH 0/2] block/vdi: Fix bmap writing error

2014-10-21 Thread Max Reitz
The bmap size in block/vdi.c may exceed INT_MAX. Using bdrv_pwrite_sync() (which takes an int byte count) is therefore not a good idea. The second patch of this series fixes this by replacing bdrv_pwrite_sync() by bdrv_write()+bdrv_flush() (we don't need the p in pwrite here). The first patch empl

[Qemu-devel] [PATCH 1/2] block/vdi: Use {DIV_,}ROUND_UP

2014-10-21 Thread Max Reitz
There are macros for these operations, so make use of them. Signed-off-by: Max Reitz --- block/vdi.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index 9604721..19701ee 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -407,8 +407,7 @@ static

[Qemu-devel] [PATCH 2/2] block/vdi: Do not use bdrv_pwrite_sync() for bmap

2014-10-21 Thread Max Reitz
The bmap can be rather large (maximum blocks per image count: 0x3fff; the bmap has a size of block_count * sizeof(uint32_t) bytes, which makes 0xfffc bytes) and exceed INT_MAX. Using block layer functions which take a byte count as an int is therefore not a good idea. Use bdrv_write()+bdrv_

Re: [Qemu-devel] [PATCH 6/6] vnc: track & limit connections

2014-10-21 Thread Gerd Hoffmann
On Di, 2014-10-21 at 14:06 +0800, Gonglei wrote: > On 2014/10/20 15:02, Gerd Hoffmann wrote: > > > > > Hi, > > > >> If we set the max trying times, and then > >> There are some concepts: > >> - INTERVAL_TIME: a time window that user can connnet vnc server > >> - REJECT_TIME: the time of reje

Re: [Qemu-devel] [PATCH 1/1] s390x: sweep up unmaintained files

2014-10-21 Thread Alexander Graf
> Am 21.10.2014 um 08:34 schrieb Cornelia Huck : > > Several s390x/kvm/ccw related files don't have an entry in MAINTAINERS: > Sort them into the appropriate sections. > > CC: Christian Borntraeger > CC: Alexander Graf > Signed-off-by: Cornelia Huck Reviewed-by: Alexander Graf Also, for si

Re: [Qemu-devel] [PATCH 0/2] intel_iommu: Add support for translation for devices behind bridges

2014-10-21 Thread Alexander Graf
> Am 21.10.2014 um 07:26 schrieb Knut Omang : > >> On Tue, 2014-10-21 at 01:29 +0200, Alexander Graf wrote: >> >> >>> Am 21.10.2014 um 00:34 schrieb Knut Omang : >>> >>> This patch set changes the data structure used to handle address spaces >>> within >>> the emulated Intel iommu to suppor

Re: [Qemu-devel] [PATCH 0/4] multiwrite patches for 2.2

2014-10-21 Thread Max Reitz
On 2014-10-21 at 10:01, Peter Lieven wrote: On 21.10.2014 09:06, Max Reitz wrote: On 2014-10-20 at 22:48, Peter Lieven wrote: Am 20.10.2014 um 17:56 schrieb Max Reitz : On 20.10.2014 at 16:35, Peter Lieven wrote: This adds some preparing patches for upcoming multiwrite modifications. I will

Re: [Qemu-devel] [PATCH 6/6] vnc: track & limit connections

2014-10-21 Thread Gonglei
On 2014/10/21 16:57, Gerd Hoffmann wrote: > On Di, 2014-10-21 at 14:06 +0800, Gonglei wrote: >> On 2014/10/20 15:02, Gerd Hoffmann wrote: >> >>> >>> Hi, >>> If we set the max trying times, and then There are some concepts: - INTERVAL_TIME: a time window that user can connnet vnc

Re: [Qemu-devel] Close the BlockDriverState when guest eject the media

2014-10-21 Thread Gonglei
On 2014/10/21 16:33, Markus Armbruster wrote: > Weidong Huang writes: > >> On 2014/10/20 20:12, Markus Armbruster wrote: >> >>> >>> Correct. This is a known wart. To work around it, wait for event >>> DEVICE_TRAY_MOVED and eject again. Yes, this is racy: the guest can >>> reclose the tray and

Re: [Qemu-devel] [PATCH] get_maintainer.pl: Default to --no-git-fallback

2014-10-21 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Mon, Oct 20, 2014 at 03:04:44PM +0100, Peter Maydell wrote: >> On 20 October 2014 10:19, Markus Armbruster wrote: >> > Contributors rely on this script to find maintainers to copy. The >> > script falls back to git when no exact MAINTAINERS pattern matches. >>

Re: [Qemu-devel] [PATCH] snapshot: use local variable to bdrv_pwrite_sync L1 table

2014-10-21 Thread Max Reitz
On 2014-10-21 at 10:04, Zhang Haoyu wrote: Use local variable to bdrv_pwrite_sync L1 table, needless to make conversion of cached L1 table between big-endian and host style. Signed-off-by: Zhang Haoyu --- block/qcow2-refcount.c | 22 +++--- 1 file changed, 7 insertions(+), 15

Re: [Qemu-devel] [question] savevm/delvm: Is it necessary to performbdrv_drain_all before savevm and delvm?

2014-10-21 Thread Zhang Haoyu
> >> >> Hi, > >> >> > >> >> I noticed that bdrv_drain_all is performed in load_vmstate before > >> bdrv_snapshot_goto, >> >> >> and bdrv_drain_all is performed in qmp_transaction before >> >> internal_snapshot_prepare, >> >> >> so is it also neccesary to perform bdrv_drain_all in savevm and delvm?

Re: [Qemu-devel] [PATCH] get_maintainer.pl: Default to --no-git-fallback

2014-10-21 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Mon, Oct 20, 2014 at 03:19:52PM +0100, Peter Maydell wrote: >> On 20 October 2014 15:15, Michael S. Tsirkin wrote: >> > On Mon, Oct 20, 2014 at 03:04:44PM +0100, Peter Maydell wrote: >> >> On 20 October 2014 10:19, Markus Armbruster wrote: >> >> > Contributors

Re: [Qemu-devel] [PATCH v6 08/11] qcow2: Rebuild refcount structure during check

2014-10-21 Thread Kevin Wolf
Am 20.10.2014 um 16:35 hat Max Reitz geschrieben: > The previous commit introduced the "rebuild" variable to qcow2's > implementation of the image consistency check. Now make use of this by > adding a function which creates a completely new refcount structure > based solely on the in-memory informa

Re: [Qemu-devel] spec, RFC: TLS support for NBD

2014-10-21 Thread Daniel P. Berrange
On Tue, Oct 21, 2014 at 12:10:39AM +0200, Wouter Verhelst wrote: > On Mon, Oct 20, 2014 at 01:56:43PM +0200, Florian Weimer wrote: > > I cannot comment on whether the proposed STARTTLS command is at the correct > > stage of the NBD protocol. If there is a protocol description for NBD, I > > can ha

Re: [Qemu-devel] [PATCH] block: char devices on FreeBSD are not behind a pager

2014-10-21 Thread Kevin Wolf
Am 21.10.2014 um 10:14 hat Roger Pau Monné geschrieben: > El 20/10/14 a les 19.22, Kevin Wolf ha escrit: > > Am 20.10.2014 um 18:39 hat Roger Pau Monne geschrieben: > >> Acknowledge this and forcefully set BDRV_O_NOCACHE and O_DIRECT in order to > >> force QEMU to use aligned buffers. > >> > >> Sig

Re: [Qemu-devel] [PATCH 6/6] vnc: track & limit connections

2014-10-21 Thread Gerd Hoffmann
Hi, > Yes. But I think it is not a big problem, when the REJECT_TIME is over, > the good guys can connect vnc successfully immediately. > Or maybe we just lock those guys with "the same Source IP address" ? Better. Question is whenever we really want implement those schemes within qemu or leav

Re: [Qemu-devel] [PATCH 0/2] intel_iommu: Add support for translation for devices behind bridges

2014-10-21 Thread Knut Omang
On Tue, 2014-10-21 at 11:07 +0200, Alexander Graf wrote: > > > > Am 21.10.2014 um 07:26 schrieb Knut Omang : > > > >> On Tue, 2014-10-21 at 01:29 +0200, Alexander Graf wrote: > >> > >> > >>> Am 21.10.2014 um 00:34 schrieb Knut Omang : > >>> > >>> This patch set changes the data structure used

Re: [Qemu-devel] [PATCH 0/4] multiwrite patches for 2.2

2014-10-21 Thread Kevin Wolf
Am 21.10.2014 um 11:07 hat Max Reitz geschrieben: > On 2014-10-21 at 10:01, Peter Lieven wrote: > >On 21.10.2014 09:06, Max Reitz wrote: > >>On 2014-10-20 at 22:48, Peter Lieven wrote: > >>>Am 20.10.2014 um 17:56 schrieb Max Reitz : > >>> > On 20.10.2014 at 16:35, Peter Lieven wrote: > >Thi

Re: [Qemu-devel] [PATCH 1/1] s390x: sweep up unmaintained files

2014-10-21 Thread Christian Borntraeger
Am 21.10.2014 08:34, schrieb Cornelia Huck: > Several s390x/kvm/ccw related files don't have an entry in MAINTAINERS: > Sort them into the appropriate sections. > > CC: Christian Borntraeger Acked-by: Christian Borntraeger > CC: Alexander Graf > Signed-off-by: Cornelia Huck > --- > MAINTAIN

[Qemu-devel] [Bug 1353456] Re: qemu-io: Failure on a qcow2 image with the fuzzed refcount table

2014-10-21 Thread Max Reitz
Hi, this has been fixed in upstream master (5f77ef69a195098baddfdc6d189f1b4a94587378): $ ./qemu-io copy.img -c 'aio_write 836608 166400' qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps with qcow2_header); further corruption events will be suppressed aio_write fail

Re: [Qemu-devel] [PATCH v6 08/11] qcow2: Rebuild refcount structure during check

2014-10-21 Thread Max Reitz
On 2014-10-21 at 11:31, Kevin Wolf wrote: Am 20.10.2014 um 16:35 hat Max Reitz geschrieben: The previous commit introduced the "rebuild" variable to qcow2's implementation of the image consistency check. Now make use of this by adding a function which creates a completely new refcount structure

Re: [Qemu-devel] [PATCH 0/4] multiwrite patches for 2.2

2014-10-21 Thread Max Reitz
On 2014-10-21 at 11:38, Kevin Wolf wrote: Am 21.10.2014 um 11:07 hat Max Reitz geschrieben: On 2014-10-21 at 10:01, Peter Lieven wrote: On 21.10.2014 09:06, Max Reitz wrote: On 2014-10-20 at 22:48, Peter Lieven wrote: Am 20.10.2014 um 17:56 schrieb Max Reitz : On 20.10.2014 at 16:35, Peter

Re: [Qemu-devel] [PATCH] get_maintainer.pl: Default to --no-git-fallback

2014-10-21 Thread Michael S. Tsirkin
On Tue, Oct 21, 2014 at 11:31:12AM +0200, Markus Armbruster wrote: > "Michael S. Tsirkin" writes: > > > On Mon, Oct 20, 2014 at 03:19:52PM +0100, Peter Maydell wrote: > >> On 20 October 2014 15:15, Michael S. Tsirkin wrote: > >> > On Mon, Oct 20, 2014 at 03:04:44PM +0100, Peter Maydell wrote: >

Re: [Qemu-devel] [PATCH v6 09/11] qcow2: Clean up after refcount rebuild

2014-10-21 Thread Kevin Wolf
Am 20.10.2014 um 16:35 hat Max Reitz geschrieben: > Because the old refcount structure will be leaked after having rebuilt > it, we need to recalculate the refcounts and run a leak-fixing operation > afterwards (if leaks should be fixed at all). > > Signed-off-by: Max Reitz > Reviewed-by: Benoît

Re: [Qemu-devel] [PATCH v7 1/1] xen-hvm.c: Add support for Xen access to vmport

2014-10-21 Thread Stefano Stabellini
On Mon, 20 Oct 2014, Don Slutz wrote: > This adds synchronisation of the 6 vcpu registers (only 32bits of > them) that vmport.c needs between Xen and QEMU. > > This is to avoid a 2nd and 3rd exchange between QEMU and Xen to > fetch and put these 6 vcpu registers used by the code in vmport.c > and

Re: [Qemu-devel] [PATCH v6 07/11] qcow2: Do not perform potentially damaging repairs

2014-10-21 Thread Max Reitz
On 2014-10-21 at 09:52, Kevin Wolf wrote: Am 20.10.2014 um 16:35 hat Max Reitz geschrieben: If a referenced cluster has a refcount of 0, increasing its refcount may result in clusters being allocated for the refcount structures. This may overwrite the referenced cluster, therefore we cannot simp

Re: [Qemu-devel] [PATCH v6 08/11] qcow2: Rebuild refcount structure during check

2014-10-21 Thread Kevin Wolf
Am 21.10.2014 um 11:52 hat Max Reitz geschrieben: > On 2014-10-21 at 11:31, Kevin Wolf wrote: > >Am 20.10.2014 um 16:35 hat Max Reitz geschrieben: > >>The previous commit introduced the "rebuild" variable to qcow2's > >>implementation of the image consistency check. Now make use of this by > >>addi

Re: [Qemu-devel] [PATCH v3] virtio-pci: fix migration for pci bus master

2014-10-21 Thread Michael S. Tsirkin
On Mon, Oct 20, 2014 at 06:08:56PM +0200, Alexander Graf wrote: > > > On 20.10.14 08:58, Michael S. Tsirkin wrote: > > Current support for bus master (clearing OK bit) together with the need to > > support guests which do not enable PCI bus mastering, leads to extra state > > in > > VIRTIO_PCI_F

Re: [Qemu-devel] [PATCH v6 09/11] qcow2: Clean up after refcount rebuild

2014-10-21 Thread Max Reitz
On 2014-10-21 at 11:59, Kevin Wolf wrote: Am 20.10.2014 um 16:35 hat Max Reitz geschrieben: Because the old refcount structure will be leaked after having rebuilt it, we need to recalculate the refcounts and run a leak-fixing operation afterwards (if leaks should be fixed at all). Signed-off-by

Re: [Qemu-devel] [PATCH 6/6] vnc: track & limit connections

2014-10-21 Thread Gonglei
On 2014/10/21 17:35, Gerd Hoffmann wrote: > Hi, > >> Yes. But I think it is not a big problem, when the REJECT_TIME is over, >> the good guys can connect vnc successfully immediately. >> Or maybe we just lock those guys with "the same Source IP address" ? > > Better. Question is whenever we r

Re: [Qemu-devel] [Consult] microblaze: About running upstream main branch qemu

2014-10-21 Thread Chen Gang
On 10/21/14 12:37, Guenter Roeck wrote: > On 10/20/2014 08:23 AM, Chen Gang wrote: >> On 10/19/2014 10:58 PM, Guenter Roeck wrote: >>> >>> This doesn't use devicetree, but the configurations are known to be working >>> with kernel releases all the way back to kernel version 3.10. >>> >> >> Yeah, re

[Qemu-devel] [PATCH v2] block: char devices on FreeBSD are not behind a pager

2014-10-21 Thread Roger Pau Monne
Introduce a new flag to mark devices that require requests to be aligned and replace the usage of BDRV_O_NOCACHE and O_DIRECT with this flag when appropriate. If a character device is used as a backend on a FreeBSD host set this flag unconditionally. Signed-off-by: Roger Pau Monné Cc: Kevin Wolf

Re: [Qemu-devel] [PATCH] snapshot: use local variable to bdrv_pwrite_syncL1 table

2014-10-21 Thread Zhang Haoyu
>> Use local variable to bdrv_pwrite_sync L1 table, >> needless to make conversion of cached L1 table between >> big-endian and host style. >> >> Signed-off-by: Zhang Haoyu >> --- >> block/qcow2-refcount.c | 22 +++--- >> 1 file changed, 7 insertions(+), 15 deletions(-) >> >> di

Re: [Qemu-devel] [PATCH] snapshot: use local variable to bdrv_pwrite_syncL1 table

2014-10-21 Thread Max Reitz
On 2014-10-21 at 12:49, Zhang Haoyu wrote: Use local variable to bdrv_pwrite_sync L1 table, needless to make conversion of cached L1 table between big-endian and host style. Signed-off-by: Zhang Haoyu --- block/qcow2-refcount.c | 22 +++--- 1 file changed, 7 insertions(+),

[Qemu-devel] [PATCH v2 00/11] block: allow blockjobs to coexist with dataplane

2014-10-21 Thread Stefan Hajnoczi
v2: * Protect block_job_defer_to_main_loop_bh() against AioContext change [Max] * Drop unnecessary if (buf) around qemu_vfree(buf) [Max] Almost all the infrastructure is in place to make blockjobs safe for use with dataplane: * Op blockers all us to exclude commands that could conflict with a

[Qemu-devel] [PATCH v2 04/11] blockdev: add note that block_job_cb() must be thread-safe

2014-10-21 Thread Stefan Hajnoczi
This function is correct but we should document the constraint that everything must be thread-safe. Emitting QMP events and scheduling BHs are both thread-safe so nothing needs to be done here. Signed-off-by: Stefan Hajnoczi Reviewed-by: Max Reitz --- blockdev.c | 5 + 1 file changed, 5 in

[Qemu-devel] [PATCH v2 02/11] blockdev: acquire AioContext in do_qmp_query_block_jobs_one()

2014-10-21 Thread Stefan Hajnoczi
Make sure that query-block-jobs acquires the BlockDriverState AioContext so that the blockjob isn't running in another thread while we access its state. Signed-off-by: Stefan Hajnoczi Reviewed-by: Max Reitz --- blockdev.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --gi

[Qemu-devel] [PATCH v2 01/11] block: acquire AioContext in generic blockjob QMP commands

2014-10-21 Thread Stefan Hajnoczi
block-job-set-speed, block-job-cancel, block-job-pause, block-job-resume, and block-job-complete must acquire the BlockDriverState AioContext so that it is safe to access bs. At the moment bs->job is always NULL when dataplane is active because op blockers prevent blockjobs from starting. Once th

[Qemu-devel] [PATCH v2 06/11] block: add bdrv_drain()

2014-10-21 Thread Stefan Hajnoczi
Now that op blockers are in use, we can ensure that no other sources are generating I/O on a BlockDriverState. Therefore it is possible to drain requests for a single BDS. Signed-off-by: Stefan Hajnoczi Reviewed-by: Max Reitz --- block.c | 36 +---

[Qemu-devel] [PATCH v2 07/11] block: let backup blockjob run in BDS AioContext

2014-10-21 Thread Stefan Hajnoczi
The backup block job must run in the BlockDriverState AioContext so that it works with dataplane. The basics of acquiring the AioContext are easy in blockdev.c. The completion code in block/backup.c must call bdrv_unref() from the main loop. Use block_job_defer_to_main_loop() to achieve that. S

[Qemu-devel] [PATCH v2 03/11] blockdev: acquire AioContext in blockdev_mark_auto_del()

2014-10-21 Thread Stefan Hajnoczi
When an emulated storage controller is unrealized it will call blockdev_mark_auto_del(). This will cancel any running block job (and that eventually releases its reference to the BDS so it can be freed). Since the block job may be executing in another AioContext we must acquire/release to ensure

[Qemu-devel] [PATCH v2 05/11] blockjob: add block_job_defer_to_main_loop()

2014-10-21 Thread Stefan Hajnoczi
Block jobs will run in the BlockDriverState's AioContext, which may not always be the QEMU main loop. There are some block layer APIs that are either not thread-safe or risk lock ordering problems. This includes bdrv_unref(), bdrv_close(), and anything that calls bdrv_drain_all(). The block_job_

[Qemu-devel] [PATCH v2 09/11] block: let mirror blockjob run in BDS AioContext

2014-10-21 Thread Stefan Hajnoczi
The mirror block job must run in the BlockDriverState AioContext so that it works with dataplane. Acquire the AioContext in blockdev.c so starting the block job is safe. Note that to_replace is treated separately from other BlockDriverStates in that it does not need to be in the same AioContext.

[Qemu-devel] [PATCH v2 11/11] block: declare blockjobs and dataplane friends!

2014-10-21 Thread Stefan Hajnoczi
Now that blockjobs use AioContext they are safe for use with dataplane. Unblock them! Signed-off-by: Stefan Hajnoczi Reviewed-by: Max Reitz --- blockjob.c | 1 + hw/block/dataplane/virtio-blk.c | 5 + 2 files changed, 6 insertions(+) diff --git a/blockjob.c b/blockjob.

[Qemu-devel] [PATCH v2 08/11] block: let stream blockjob run in BDS AioContext

2014-10-21 Thread Stefan Hajnoczi
The stream block job must run in the BlockDriverState AioContext so that it works with dataplane. The basics of acquiring the AioContext are easy in blockdev.c. The tricky part is the completion code which drops part of the backing file chain. This must be done in the main loop where bdrv_unref(

[Qemu-devel] [Bug 1354529] Re: qemu-io: Assert failure on the fuzzed qcow2 image

2014-10-21 Thread Max Reitz
** Changed in: qemu Status: New => Fix Committed -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1354529 Title: qemu-io: Assert failure on the fuzzed qcow2 image Status in QEMU: Fix Committ

[Qemu-devel] [PATCH v2 10/11] block: let commit blockjob run in BDS AioContext

2014-10-21 Thread Stefan Hajnoczi
The commit block job must run in the BlockDriverState AioContext so that it works with dataplane. Acquire the AioContext in blockdev.c so starting the block job is safe. One detail here is that the bdrv_drain_all() must be moved inside the aio_context_acquire() region so requests cannot sneak in b

Re: [Qemu-devel] [PATCH] get_maintainer.pl: Default to --no-git-fallback

2014-10-21 Thread Gerd Hoffmann
On Mo, 2014-10-20 at 20:38 +0200, Paolo Bonzini wrote: > On 10/20/2014 04:15 PM, Michael S. Tsirkin wrote: > > What do you want to happen in this case? > > Won't this cause even more patches to fall to the floor? > > > > The benefit seems marginal, the risk high. > > I agree with Michael. > > Can

[Qemu-devel] [Bug 1353456] Re: qemu-io: Failure on a qcow2 image with the fuzzed refcount table

2014-10-21 Thread Max Reitz
** Changed in: qemu Status: New => Fix Committed -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1353456 Title: qemu-io: Failure on a qcow2 image with the fuzzed refcount table Status in QEMU

[Qemu-devel] [PULL 0/1] s390x files MAINTAINERS update

2014-10-21 Thread Cornelia Huck
The following changes since commit 5f77ef69a195098baddfdc6d189f1b4a94587378: glib: add compatibility interface for g_strcmp0() (2014-10-16 23:02:31 +0100) are available in the git repository at: git://github.com/cohuck/qemu.git tags/s390x-20141021 for you to fetch changes up to

Re: [Qemu-devel] [PATCH] get_maintainer.pl: Default to --no-git-fallback

2014-10-21 Thread Michael S. Tsirkin
On Tue, Oct 21, 2014 at 01:09:19PM +0200, Gerd Hoffmann wrote: > On Mo, 2014-10-20 at 20:38 +0200, Paolo Bonzini wrote: > > On 10/20/2014 04:15 PM, Michael S. Tsirkin wrote: > > > What do you want to happen in this case? > > > Won't this cause even more patches to fall to the floor? > > > > > > The

[Qemu-devel] [PULL 1/1] s390x: sweep up unmaintained files

2014-10-21 Thread Cornelia Huck
Several s390x/kvm/ccw related files don't have an entry in MAINTAINERS: Sort them into the appropriate sections. Acked-by: Christian Borntraeger Reviewed-by: Alexander Graf Signed-off-by: Cornelia Huck --- MAINTAINERS |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/

Re: [Qemu-devel] [PATCH 0/2] intel_iommu: Add support for translation for devices behind bridges

2014-10-21 Thread Alexander Graf
On 21.10.14 11:35, Knut Omang wrote: > On Tue, 2014-10-21 at 11:07 +0200, Alexander Graf wrote: >> >> >>> Am 21.10.2014 um 07:26 schrieb Knut Omang : >>> On Tue, 2014-10-21 at 01:29 +0200, Alexander Graf wrote: > Am 21.10.2014 um 00:34 schrieb Knut Omang : > > This patc

[Qemu-devel] [Bug 1355738] Re: qemu-img: Killed by SIGTRAP on check of the fuzzed image

2014-10-21 Thread Max Reitz
Hi, This issue has at least been partially fixed in master (5f77ef69a195098baddfdc6d189f1b4a94587378): $ ./qemu-img check -f qcow2 -r all copy.img # ... The following inconsistencies were found and repaired: 0 leaked clusters 1 corruptions Double checking the fixed image now... 469 err

[Qemu-devel] [Bug 1354529] Re: qemu-io: Assert failure on the fuzzed qcow2 image

2014-10-21 Thread Max Reitz
Hi, This issue has been fixed in master (5f77ef69a195098baddfdc6d189f1b4a94587378): $ ./qemu-io copy.img -c 'write 2856960 208896' qcow2_free_clusters failed: Invalid argument qcow2_free_clusters failed: Invalid argument qcow2_free_clusters failed: Invalid argument qcow2_free_clusters failed: Inv

[Qemu-devel] [Bug 1355697] Re: qemu-img: Segfault on a fuzzed image with large values of L1/L2 entries

2014-10-21 Thread Max Reitz
Hi, This issue has at least been partially fixed in master (5f77ef69a195098baddfdc6d189f1b4a94587378): $ ./qemu-img check -f qcow2 -r all copy.img Warning: cluster offset=0xfe is after the end of the image file, can't properly check refcounts. Warning: cluster offset=0x10

Re: [Qemu-devel] [PATCH bugfix] snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem

2014-10-21 Thread Paolo Bonzini
On 10/21/2014 10:38 AM, Zhang Haoyu wrote: If there are still pending i/o while deleting snapshot, because deleting snapshot is done in non-coroutine context, and the pending i/o read/write (bdrv_co_do_rw) is done in coroutine context, so it's possible to cause concurrency problem between above

[Qemu-devel] [Bug 1355697] Re: qemu-img: Segfault on a fuzzed image with large values of L1/L2 entries

2014-10-21 Thread Max Reitz
Hi, Okay, so this image has the same “issue” (it's intentionally broken, so it's not really an issue) as the one in bug 1355738: There are corrupted L2 entries which are impossible for qemu to repair. Therefore, we could only ask the user to use qemu-img convert and that's all we can do. Therefore

Re: [Qemu-devel] [PATCH 0/2] intel_iommu: Add support for translation for devices behind bridges

2014-10-21 Thread Michael S. Tsirkin
On Tue, Oct 21, 2014 at 01:15:14PM +0200, Alexander Graf wrote: > > > On 21.10.14 11:35, Knut Omang wrote: > > On Tue, 2014-10-21 at 11:07 +0200, Alexander Graf wrote: > >> > >> > >>> Am 21.10.2014 um 07:26 schrieb Knut Omang : > >>> > On Tue, 2014-10-21 at 01:29 +0200, Alexander Graf wrote:

Re: [Qemu-devel] [PATCH] get_maintainer.pl: Default to --no-git-fallback

2014-10-21 Thread Gerd Hoffmann
Hi, > > How about making "get_maintainer.pl --git-fallback" actually do what it > > says? Right now git it *not* used as fallback, it goes to git log > > unconditionally, even if there are hits in MAINTAINERS ... > > It does? > > How do you reproduce this behaviour? > > $ ./scripts/get_maint

Re: [Qemu-devel] [PATCH v2 05/11] blockjob: add block_job_defer_to_main_loop()

2014-10-21 Thread Max Reitz
On 2014-10-21 at 13:03, Stefan Hajnoczi wrote: Block jobs will run in the BlockDriverState's AioContext, which may not always be the QEMU main loop. There are some block layer APIs that are either not thread-safe or risk lock ordering problems. This includes bdrv_unref(), bdrv_close(), and anyt

Re: [Qemu-devel] [PATCH v2 10/11] block: let commit blockjob run in BDS AioContext

2014-10-21 Thread Max Reitz
On 2014-10-21 at 13:03, Stefan Hajnoczi wrote: The commit block job must run in the BlockDriverState AioContext so that it works with dataplane. Acquire the AioContext in blockdev.c so starting the block job is safe. One detail here is that the bdrv_drain_all() must be moved inside the aio_conte

[Qemu-devel] [PATCH] scripts/get_maintainer.pl: allow "odd fixes"

2014-10-21 Thread Michael S. Tsirkin
We have a bunch of modules in "Odd fixes" status, scripts/get_maintainer.pl ignores that. Reported-by: Gerd Hoffmann Cc: Paolo Bonzini Cc: Peter Maydell Cc: Markus Armbruster Signed-off-by: Michael S. Tsirkin --- scripts/get_maintainer.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [Qemu-devel] [PATCH] get_maintainer.pl: Default to --no-git-fallback

2014-10-21 Thread Michael S. Tsirkin
On Tue, Oct 21, 2014 at 01:23:49PM +0200, Gerd Hoffmann wrote: > Hi, > > > > How about making "get_maintainer.pl --git-fallback" actually do what it > > > says? Right now git it *not* used as fallback, it goes to git log > > > unconditionally, even if there are hits in MAINTAINERS ... > > > >

[Qemu-devel] [PATCH v2] snapshot: use local variable to bdrv_pwrite_sync L1 table

2014-10-21 Thread Zhang Haoyu
Use local variable to bdrv_pwrite_sync L1 table, needless to make conversion of cached L1 table between big-endian and host style. Signed-off-by: Zhang Haoyu --- v1 -> v2: - remove the superflous assignment, l1_table = NULL; - replace 512 with BDRV_SECTOR_SIZE, and align_offset with ROUND_UP -

Re: [Qemu-devel] [PATCH v3] virtio-pci: fix migration for pci bus master

2014-10-21 Thread Alexander Graf
On 21.10.14 12:16, Michael S. Tsirkin wrote: > On Mon, Oct 20, 2014 at 06:08:56PM +0200, Alexander Graf wrote: >> >> >> On 20.10.14 08:58, Michael S. Tsirkin wrote: >>> Current support for bus master (clearing OK bit) together with the need to >>> support guests which do not enable PCI bus master

Re: [Qemu-devel] [PATCH 0/2] intel_iommu: Add support for translation for devices behind bridges

2014-10-21 Thread Knut Omang
On Tue, 2014-10-21 at 14:26 +0300, Michael S. Tsirkin wrote: > On Tue, Oct 21, 2014 at 01:15:14PM +0200, Alexander Graf wrote: > > > > > > On 21.10.14 11:35, Knut Omang wrote: > > > On Tue, 2014-10-21 at 11:07 +0200, Alexander Graf wrote: > > >> > > >> > > >>> Am 21.10.2014 um 07:26 schrieb Knut

[Qemu-devel] [PATCH v5 1/3] qdev: add qdev_build_hotpluggable_device_list helper

2014-10-21 Thread Zhu Guihua
For peripheral device del completion, add a function to build a list for hotpluggable devices. Signed-off-by: Zhu Guihua --- hw/core/qdev.c | 13 + include/hw/qdev-core.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index a1e9247..9

[Qemu-devel] [PATCH v5 2/3] monitor: add del completion for peripheral device

2014-10-21 Thread Zhu Guihua
Add peripheral_device_del_completion() to let peripheral device del completion be possible. Signed-off-by: Zhu Guihua --- monitor.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/monitor.c b/monitor.c index 2d14f39..ac41fa3 100644 --- a/monitor.c +++ b/monitor.c

[Qemu-devel] [PATCH v5 0/3] monitor: add peripheral device del completion support

2014-10-21 Thread Zhu Guihua
After inputting device_del command in monitor, we expect to list all hotpluggable devices automatically by pressing tab key. This patchset provides the function to list all peripheral devices such as memory devices. v5: - In patch 2, make list to free (Marcel) v4: - Delete unused device_del_bus_c

[Qemu-devel] [PATCH v5 3/3] monitor: delete device_del_bus_completion

2014-10-21 Thread Zhu Guihua
device_del_bus_completion() that gathers devices from buses is unused; delete it. Signed-off-by: Zhu Guihua --- monitor.c | 20 1 file changed, 20 deletions(-) diff --git a/monitor.c b/monitor.c index ac41fa3..2cccd0a 100644 --- a/monitor.c +++ b/monitor.c @@ -4340,25 +4340

Re: [Qemu-devel] [PATCH v2] block: char devices on FreeBSD are not behind a pager

2014-10-21 Thread Max Reitz
On 2014-10-21 at 12:39, Roger Pau Monne wrote: Introduce a new flag to mark devices that require requests to be aligned and replace the usage of BDRV_O_NOCACHE and O_DIRECT with this flag when appropriate. If a character device is used as a backend on a FreeBSD host set this flag unconditionally

Re: [Qemu-devel] [PATCH v2] snapshot: use local variable to bdrv_pwrite_sync L1 table

2014-10-21 Thread Max Reitz
On 2014-10-21 at 13:34, Zhang Haoyu wrote: Use local variable to bdrv_pwrite_sync L1 table, needless to make conversion of cached L1 table between big-endian and host style. Signed-off-by: Zhang Haoyu --- v1 -> v2: - remove the superflous assignment, l1_table = NULL; - replace 512 with BDRV

Re: [Qemu-devel] [PATCH v3] virtio-pci: fix migration for pci bus master

2014-10-21 Thread Michael S. Tsirkin
On Tue, Oct 21, 2014 at 01:35:39PM +0200, Alexander Graf wrote: > > > On 21.10.14 12:16, Michael S. Tsirkin wrote: > > On Mon, Oct 20, 2014 at 06:08:56PM +0200, Alexander Graf wrote: > >> > >> > >> On 20.10.14 08:58, Michael S. Tsirkin wrote: > >>> Current support for bus master (clearing OK bit)

Re: [Qemu-devel] [PATCH v3] virtio-pci: fix migration for pci bus master

2014-10-21 Thread Alexander Graf
On 21.10.14 14:10, Michael S. Tsirkin wrote: > On Tue, Oct 21, 2014 at 01:35:39PM +0200, Alexander Graf wrote: >> >> >> On 21.10.14 12:16, Michael S. Tsirkin wrote: >>> On Mon, Oct 20, 2014 at 06:08:56PM +0200, Alexander Graf wrote: On 20.10.14 08:58, Michael S. Tsirkin wrote:

[Qemu-devel] [PATCH] arm: fix TB alignment check

2014-10-21 Thread Pavel Dovgalyuk
Sometimes page faults happen during the translation of the target instructions. To avoid the faults in the middle of the TB we have to stop translation at the end of the page. Current implementation of ARM translation assumes that instructions are aligned to their own size (4 or 2 bytes). But in th

Re: [Qemu-devel] [PATCH 0/2] intel_iommu: Add support for translation for devices behind bridges

2014-10-21 Thread Michael S. Tsirkin
On Tue, Oct 21, 2014 at 01:37:33PM +0200, Knut Omang wrote: > On Tue, 2014-10-21 at 14:26 +0300, Michael S. Tsirkin wrote: > > On Tue, Oct 21, 2014 at 01:15:14PM +0200, Alexander Graf wrote: > > > > > > > > > On 21.10.14 11:35, Knut Omang wrote: > > > > On Tue, 2014-10-21 at 11:07 +0200, Alexande

Re: [Qemu-devel] [PATCH] get_maintainer.pl: Default to --no-git-fallback

2014-10-21 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Tue, Oct 21, 2014 at 11:31:12AM +0200, Markus Armbruster wrote: >> "Michael S. Tsirkin" writes: >> >> > On Mon, Oct 20, 2014 at 03:19:52PM +0100, Peter Maydell wrote: >> >> On 20 October 2014 15:15, Michael S. Tsirkin wrote: >> >> > On Mon, Oct 20, 2014 at 03:

Re: [Qemu-devel] [PATCH] get_maintainer.pl: Default to --no-git-fallback

2014-10-21 Thread Michael S. Tsirkin
On Tue, Oct 21, 2014 at 02:22:41PM +0200, Markus Armbruster wrote: > "Michael S. Tsirkin" writes: > > > On Tue, Oct 21, 2014 at 11:31:12AM +0200, Markus Armbruster wrote: > >> "Michael S. Tsirkin" writes: > >> > >> > On Mon, Oct 20, 2014 at 03:19:52PM +0100, Peter Maydell wrote: > >> >> On 20 O

Re: [Qemu-devel] [PATCH v3] virtio-pci: fix migration for pci bus master

2014-10-21 Thread Greg Kurz
On Tue, 21 Oct 2014 15:10:22 +0300 "Michael S. Tsirkin" wrote: > On Tue, Oct 21, 2014 at 01:35:39PM +0200, Alexander Graf wrote: > > > > > > On 21.10.14 12:16, Michael S. Tsirkin wrote: > > > On Mon, Oct 20, 2014 at 06:08:56PM +0200, Alexander Graf wrote: > > >> > > >> > > >> On 20.10.14 08:58,

[Qemu-devel] [PATCH] hw/pci: fixed crash when using rombar=0 for hotplugged devices

2014-10-21 Thread Marcel Apfelbaum
ROM images must be loaded at startup. Usage of rombar=0 after that is not allowed, but should not crash QEMU. Check that the device is not hotplugged before trying to insert the rom file. Signed-off-by: Marcel Apfelbaum --- hw/pci/pci.c | 11 ++- 1 file changed, 10 insertions(+), 1 dele

Re: [Qemu-devel] [PATCH 0/3] virtio-scsi-dataplane: graceful fail

2014-10-21 Thread Paolo Bonzini
On 10/15/2014 03:15 PM, Cornelia Huck wrote: Hi, these patches are practically a duplicate of the patches I did for virtio-blk dataplane -- they don't convert to the error report infrastructure, for example. The aim was to do the same changes as for virtio-blk in order to avoid killing the who

Re: [Qemu-devel] writing a QEMU block driver

2014-10-21 Thread Sandeep Joshi
On Mon, Oct 20, 2014 at 1:20 PM, Max Reitz wrote: > Am 2014-10-17 um 16:59 schrieb Sandeep Joshi: > > > Hi there, > > Do let me know if I am asking these questions on the wrong forum. I'd > like to write a QEMU block driver which forwards IO requests to a > custom-built storage cluster. > >

[Qemu-devel] [PATCH] i386: fix icount processing for repz instructions

2014-10-21 Thread Pavel Dovgalyuk
TCG generates optimized code for i386 repz instructions. It means that when ecx becomes 0, execution of the string instruction breaks immediately without an additional iteration for ecx==0 (which will only check ecx and set the flags). Omitting this iteration leads to different instructions countin

  1   2   3   >