[Qemu-devel] Adding some code to the QEMU used inside Android Emulator

2013-11-12 Thread Fardin
Hi everyone,  My question might look very stupid but the answer would really help me.  I am working on Android emulator which is using QEMU. I need to print out the value of env->cp15.c13_fcse everytime the  voidtlb_flush(CPUState*env,intflush_global) in exec.c is called. The problem is when co

Re: [Qemu-devel] [PATCH] qemu-img: Fix content mismatch offset of image compare

2013-11-12 Thread Amos Kong
On Wed, Nov 13, 2013 at 12:04:18PM +0800, Fam Zheng wrote: > We were lucky to pass qemu-iotests 048 (qemu-img compare case) but when > I tried to run with TEST_DIR=/tmp (tmpfs), it fails with a very weird > mismatch offset. This fixes the bug. > > In the if branch, setting ret to 1 before using it

Re: [Qemu-devel] [PATCH for-1.7] target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid()

2013-11-12 Thread Gleb Natapov
On Wed, Nov 13, 2013 at 12:27:10PM +1000, Richard Henderson wrote: > On 11/13/2013 08:53 AM, Paolo Bonzini wrote: > > Il 12/11/2013 19:54, Richard Henderson ha scritto: > >> For what it's worth, I think BOTH of the patches that have been posted > >> should be applied. That is, the patch that does

Re: [Qemu-devel] [PATCH for-1.7] target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid()

2013-11-12 Thread Paolo Bonzini
Il 13/11/2013 03:27, Richard Henderson ha scritto: > I think it's also worthwhile to implement the kvm api in kvm-stub.c, > unnecessary or not. If you really want compile-time feedback on those that > ought to have been removed by optimization, you could elide them from the stub > file depending o

Re: [Qemu-devel] [PATCH] virtio-net: don't update mac_table in error state

2013-11-12 Thread Jason Wang
On 11/11/2013 11:48 AM, Amos Kong wrote: > mac_table was always cleaned up first in handling > VIRTIO_NET_CTRL_MAC_TABLE_SET command, and we din't recover > mac_table content in error state, it's not correct. > > This patch makes all the changes in temporal variables, > only update the real mac_tab

Re: [Qemu-devel] [PATCH V7 2/4] block: Add check infinite loop in bdrv_img_create()

2013-11-12 Thread Fam Zheng
On 2013年11月13日 14:32, Fam Zheng wrote: On 2013年11月13日 10:39, Xu Wang wrote: Backing file loop should be checked before qemu-img create command execution. If loop is found, qemu-img create should be stopped and an error printed. Signed-off-by: Xu Wang --- block.c | 9 + 1 file change

Re: [Qemu-devel] [PATCH V7 0/4] Refine and export backing file loop check

2013-11-12 Thread Fam Zheng
On 2013年11月13日 10:39, Xu Wang wrote: If there is loop exists in the backing file chain, many problems could be caused by it, such as no response and segment fault during system boot. Hence stopping backing file loop appear is very necessary. These patches refine and export loop checking function

Re: [Qemu-devel] [PATCH V7 2/4] block: Add check infinite loop in bdrv_img_create()

2013-11-12 Thread Fam Zheng
On 2013年11月13日 10:39, Xu Wang wrote: Backing file loop should be checked before qemu-img create command execution. If loop is found, qemu-img create should be stopped and an error printed. Signed-off-by: Xu Wang --- block.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff

Re: [Qemu-devel] [PATCH 08/11] raw-posix: implement write_zeroes with MAY_UNMAP for files

2013-11-12 Thread Peter Lieven
Am 13.11.2013 um 07:27 schrieb Peter Lieven : > > Am 12.11.2013 um 16:49 schrieb Paolo Bonzini : > >> Writing zeroes to a file can be done by punching a hole if MAY_UNMAP >> is set. >> >> Note that in this case handle_aiocb_discard's ENOTSUP return code >> is not ignored, but makes the block l

Re: [Qemu-devel] [PATCH V7 1/4] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list()

2013-11-12 Thread Fam Zheng
On 2013年11月13日 10:39, Xu Wang wrote: If there is a loop in the backing file chain, it could cause problems such as no response or a segfault during system boot. Hence detecting a backing file loop is necessary. This patch extracts the loop check from collect_image_info_list() in block.c into inde

Re: [Qemu-devel] [PATCH 08/11] raw-posix: implement write_zeroes with MAY_UNMAP for files

2013-11-12 Thread Peter Lieven
Am 12.11.2013 um 16:49 schrieb Paolo Bonzini : > Writing zeroes to a file can be done by punching a hole if MAY_UNMAP > is set. > > Note that in this case handle_aiocb_discard's ENOTSUP return code > is not ignored, but makes the block layer fall back to the generic > implementation. > > Signed

Re: [Qemu-devel] [PATCH 09/11] raw-posix: implement write_zeroes with MAY_UNMAP for block devices

2013-11-12 Thread Peter Lieven
Wouldn't it be good to add bdi->can_write_zeroes_with_unmap here as well? This would automatically avoid full allocation when converting something to a host device supporting BLKDISCARDZEROES. Peter Am 12.11.2013 um 16:49 schrieb Paolo Bonzini : > See the next commit for the description of the

[Qemu-devel] [PATCH V2 4/8] qapi script: code move for generate_enum_name()

2013-11-12 Thread Wenchao Xia
Later both qapi-types.py and qapi-visit.py need a common function for enum name generation. Signed-off-by: Wenchao Xia Reviewed-by: Eric Blake --- scripts/qapi-types.py | 10 -- scripts/qapi.py | 10 ++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/s

[Qemu-devel] [PATCH V2 8/8] tests: add cases for inherited struct and union with discriminator

2013-11-12 Thread Wenchao Xia
Test for inherit and complex union. Signed-off-by: Wenchao Xia --- tests/qapi-schema/qapi-schema-test.json | 27 ++ tests/qapi-schema/qapi-schema-test.out | 11 +++ tests/test-qmp-input-visitor.c | 120 + tests/test-qmp-output-visitor.c | 149 +

[Qemu-devel] [PATCH V2 6/8] qapi script: not generate hidden enum type for pre-defined enum discriminator

2013-11-12 Thread Wenchao Xia
By default, any union will automatically generate a enum type as "[UnionName]Kind" in C code, and it is duplicated when the discriminator is specified as a pre-defined enum type in schema. After this patch, the pre-defined enum type will be really used as the switch case condition in generated C c

[Qemu-devel] [PATCH V2 1/8] qapi script: remember enum values

2013-11-12 Thread Wenchao Xia
Later other scripts will need to check the enum values. Signed-off-by: Wenchao Xia Reviewed-by: Eric Blake --- scripts/qapi.py| 18 ++ tests/qapi-schema/comments.out |2 +- tests/qapi-schema/qapi-schema-test.out |4 +++- 3 files changed,

[Qemu-devel] [PATCH V2 7/8] qapi script: do not add "_" for every capitalized char in enum

2013-11-12 Thread Wenchao Xia
Now "enum AIOContext" will generate AIO_CONTEXT instead of A_I_O_CONTEXT, "X86CPU" will generate X86_CPU instead of X86_C_P_U. Signed-off-by: Wenchao Xia --- include/qapi/qmp/qerror.h |2 +- scripts/qapi.py | 26 +++--- target-i386/cpu.c |2 +- 3 f

[Qemu-devel] [PATCH V2 3/8] qapi script: check correctness of discriminator values in union

2013-11-12 Thread Wenchao Xia
It will check whether the values specified are written correctly, and whether all enum values are covered, when discriminator is a pre-defined enum type Signed-off-by: Wenchao Xia --- scripts/qapi-visit.py | 17 + scripts/qapi.py | 31 +++ 2

[Qemu-devel] [PATCH V2 0/8] qapi script: support enum as discriminator and better enum name

2013-11-12 Thread Wenchao Xia
This series is respined from RFC series at: http://lists.nongnu.org/archive/html/qemu-devel/2013-11/msg00363.html Patch 1-6 add support for enum as discriminator. Patch 7 improve enum name generation, now AIOContext->AIO_CONTEXT, X86CPU-> X86_CPU. Patch 8 are the test cases. Changes from RFC: M

[Qemu-devel] [PATCH V2 5/8] qapi script: use same function to generate enum string

2013-11-12 Thread Wenchao Xia
One function one rule, so the enum string generating have same behavior for different caller. If multiple caller exist for one enum define in schema, it is for sure the generated string is identical. Note before the patch qapi-visit.py used custom function to generate the string in union visit, al

[Qemu-devel] [PATCH V2 2/8] qapi script: add check for duplicated key

2013-11-12 Thread Wenchao Xia
It is bad that same key was specified twice, especially when a union have two branches with same condition. This patch can prevent it. Signed-off-by: Wenchao Xia --- scripts/qapi.py |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py index

Re: [Qemu-devel] [PATCH 06/11] scsi-disk: correctly implement WRITE SAME

2013-11-12 Thread Peter Lieven
Am 12.11.2013 um 16:49 schrieb Paolo Bonzini : > The WRITE SAME command is implemented incorrectly. WRITE SAME with the > UNMAP bit set should _not_ unmap the sectors unless the written data > matches the payload of the WRITE SAME command; currently, QEMU is not > looking at the payload at all.

Re: [Qemu-devel] [PATCH v2 2/4] apic: QOM'ify apic & icc_bus

2013-11-12 Thread 赵小强
于 11/12/2013 10:52 PM, Andreas Färber 写道: Resending yesterday's message since it hasn't arrived on qemu-devel... Am 11.11.2013 04:58, schrieb 赵小强: 于 11/05/2013 04:51 PM, 赵小强 写道: 于 2013年11月05日 16:25, Chen Fan 写道: On Tue, 2013-11-05 at 15:55 +0800, xiaoqiang zhao wrote: [...] diff --git a/inc

Re: [Qemu-devel] [PATCH 01/11] block: generalize BlockLimits handling to cover bdrv_aio_discard too

2013-11-12 Thread Peter Lieven
Am 12.11.2013 um 16:49 schrieb Paolo Bonzini : > bdrv_co_discard is only covering drivers which have a .bdrv_co_discard() > implementation, but not those with .bdrv_aio_discard(). Not very nice, > and easy to avoid. > > Suggested-by: Kevin Wolf > Signed-off-by: Paolo Bonzini > --- > block.c |

[Qemu-devel] [Bug 685096] Re: USB Passthrough not working for Windows 7 guest

2013-11-12 Thread FanFan
I also have this issue. USB pass-through didn't work on windows 8. I try to use "virt-mamanger", and set USB interface to USB 2.0. Then everything works well. The default one would be USB 1.0. I don't know how to transform virt-manager's configuration to QEMU's command line arguments. Hope this h

Re: [Qemu-devel] [RFC PATCH 4/4] qcow2: Add full image preallocation option

2013-11-12 Thread Peter Lieven
What is your use case for this seris? QCOW2 creation or converting anything to QCOW2? For the later case you could use "qemu-img convert -S 0 ..." starting in 1.8. Peter Hu Tao wrote: > This adds a preallocation=full mode to qcow2 image creation, which > creates a non-sparse image file. > > Signe

Re: [Qemu-devel] Curses enabled for Windows 32 binary

2013-11-12 Thread Stefan Weil
Am 12.11.2013 23:28, schrieb Mike Levin: > Hello QEMU developers, > > I'm trying to do the closes thing to a static linked compile with > curses enabled of qemu-system32.exe for the Windows platform as possible. > > I've resisted mailing this developer mailing list for a year before I > decided to

[Qemu-devel] [PATCH] qemu-img: re-assign ret after reporting original error

2013-11-12 Thread Amos Kong
Currently the output error is always: strerror(-4) -> Unknown error -4 This patch moves ret assignment after reporting original error. Signed-off-by: Amos Kong --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 926f0a0..1fd664f 100

[Qemu-devel] [PATCH] qemu-img: Fix content mismatch offset of image compare

2013-11-12 Thread Fam Zheng
We were lucky to pass qemu-iotests 048 (qemu-img compare case) but when I tried to run with TEST_DIR=/tmp (tmpfs), it fails with a very weird mismatch offset. This fixes the bug. In the if branch, setting ret to 1 before using it makes dead code in the next line: pnum is never added to mismatch of

[Qemu-devel] [PATCH V7 2/4] block: Add check infinite loop in bdrv_img_create()

2013-11-12 Thread Xu Wang
Backing file loop should be checked before qemu-img create command execution. If loop is found, qemu-img create should be stopped and an error printed. Signed-off-by: Xu Wang --- block.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index 3c43179.

[Qemu-devel] [PATCH V7 0/4] Refine and export backing file loop check

2013-11-12 Thread Xu Wang
If there is loop exists in the backing file chain, many problems could be caused by it, such as no response and segment fault during system boot. Hence stopping backing file loop appear is very necessary. These patches refine and export loop checking function from collect_image_ info_list() to bloc

[Qemu-devel] [PATCH V7 3/4] block: Add backing file loop check in change_backing_file()

2013-11-12 Thread Xu Wang
Backing file loop should be checked before calling change_backing_ file(). If loop appeared, this calling should be stopped and an error printed. Signed-off-by: Xu Wang --- block.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block.c b/block.c index c2ed6ef..861b133 100644 --- a/bloc

[Qemu-devel] [PATCH V7 1/4] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list()

2013-11-12 Thread Xu Wang
If there is a loop in the backing file chain, it could cause problems such as no response or a segfault during system boot. Hence detecting a backing file loop is necessary. This patch extracts the loop check from collect_image_info_list() in block.c into independent functions bdrv_backing_chain_ok

Re: [Qemu-devel] [RFC PATCH 4/4] qcow2: Add full image preallocation option

2013-11-12 Thread Hu Tao
On Tue, Nov 12, 2013 at 11:31:03AM +0100, Kevin Wolf wrote: > Am 12.11.2013 um 08:47 hat Hu Tao geschrieben: > > This adds a preallocation=full mode to qcow2 image creation, which > > creates a non-sparse image file. > > > > Signed-off-by: Hu Tao > > --- > > block/qcow2.c | 28 ++

Re: [Qemu-devel] [RFC PATCH 2/4] block/raw-posix: implement bdrv_zero_init

2013-11-12 Thread Hu Tao
On Tue, Nov 12, 2013 at 11:28:05AM +0100, Kevin Wolf wrote: > Am 12.11.2013 um 08:47 hat Hu Tao geschrieben: > > Implement bdrv_zero_init using posix_fallocate. > > > > Signed-off-by: Hu Tao > > --- > > block/raw-posix.c | 13 + > > 1 file changed, 13 insertions(+) > > > > diff --gi

Re: [Qemu-devel] [PATCH v3 5/6] bitops: add BITNR macro

2013-11-12 Thread Alexey Kardashevskiy
On 11/11/2013 10:57 PM, Andreas Färber wrote: > Am 11.11.2013 08:44, schrieb Alexey Kardashevskiy: >> This adds a macro to calculate the highest bit set. > > Isn't that already available as ffs / clz GCC builtin with wrapper in > qemu/bitops.h? What's the difference to your macro? CC'ing Paolo.

Re: [Qemu-devel] [PATCH 3/8] qapi script: check correctness of discriminator values in union

2013-11-12 Thread Wenchao Xia
于 2013/11/13 2:12, Eric Blake 写道: On 11/06/2013 12:33 PM, Wenchao Xia wrote: It will check whether the values specified are written correctly when discriminator is a pre-defined enum type, which help check whether the schema is in good form. It is allowed, that not every value in enum is used,

Re: [Qemu-devel] [PATCH for-1.7] target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid()

2013-11-12 Thread Richard Henderson
On 11/13/2013 08:53 AM, Paolo Bonzini wrote: > Il 12/11/2013 19:54, Richard Henderson ha scritto: >> For what it's worth, I think BOTH of the patches that have been posted >> should be applied. That is, the patch that does (X || 1) -> (1 || X), >> and the patch that adds the stub. >> >> Frankly I'

Re: [Qemu-devel] [PATCH v3 4/6] qemu-option: support +foo/-foo command line agruments

2013-11-12 Thread Alexey Kardashevskiy
On 11/13/2013 12:11 AM, Igor Mammedov wrote: > On Tue, 12 Nov 2013 23:39:27 +1100 > Alexey Kardashevskiy wrote: > >> On 12.11.2013 20:58, Igor Mammedov wrote: >>> On Tue, 12 Nov 2013 10:49:58 +1100 >>> Alexey Kardashevskiy wrote: >>> On 11/12/2013 01:25 AM, Igor Mammedov wrote: > On Mon

Re: [Qemu-devel] [PATCH v3 4/6] qemu-option: support +foo/-foo command line agruments

2013-11-12 Thread Alexey Kardashevskiy
On 11/12/2013 11:45 PM, Andreas Färber wrote: > Am 12.11.2013 13:39, schrieb Alexey Kardashevskiy: >> On 12.11.2013 20:58, Igor Mammedov wrote: >>> PS: >>> extending QemuOpts to parsing +/-opts format, seems like good workaround >>> above problem. But I was under impression that general movement wa

[Qemu-devel] [PATCH 5/5] mirror: Check for bdrv_get_info result

2013-11-12 Thread Fam Zheng
bdrv_get_info could fail. Add check before using the returned value. Signed-off-by: Fam Zheng --- block/mirror.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 7b95acf..c0c321b 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -320

[Qemu-devel] [PATCH 4/5] vmdk: Implement .bdrv_get_info()

2013-11-12 Thread Fam Zheng
This will return cluster_size and is_compressed to caller, if all the extents has the same value (or there's only one extent). Otherwise return -ENOTSUP. Signed-off-by: Fam Zheng --- block/vmdk.c | 19 +++ tests/qemu-iotests/059.out | 1 + 2 files changed, 20 inser

[Qemu-devel] [PATCH 3/5] block: Change BlockDriverInfo.cluster_size to 64 bits

2013-11-12 Thread Fam Zheng
VMDK could have big cluster_size for monolithicFlat. It implements .bdrv_get_info now, a 32 bit field is likely to overflow. Signed-off-by: Fam Zheng --- include/block/block.h | 2 +- qemu-img.c| 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/block/bloc

[Qemu-devel] [PATCH 1/5] qemu-img: Convert by cluster size if target is compressed

2013-11-12 Thread Fam Zheng
If target block driver forces compression, qemu-img convert needs to write by cluster size as well as "-c" option. Particularly, this applies for converting to VMDK streamOptimized format. Signed-off-by: Fam Zheng --- include/block/block.h | 1 + qemu-img.c| 5 - 2 files changed

[Qemu-devel] [PATCH 2/5] vmdk: Implement .bdrv_write_compressed

2013-11-12 Thread Fam Zheng
Add a wrapper function to support "compressed" path in qemu-img convert. Only support streamOptimized subformat case for now (num_extents == 1 and extent compression is true). Signed-off-by: Fam Zheng --- block/vmdk.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/block/vmdk

[Qemu-devel] [PATCH 0/5] Fix conversion from ISO to VMDK streamOptimized

2013-11-12 Thread Fam Zheng
Previouly, "qemu-img convert" from ISO to VMDK with subformat=streamOptimized fails: $ ./qemu-img convert -O vmdk -o subformat=streamOptimized foo.iso bar.vmdk VMDK: can't write to allocated cluster for streamOptimized qemu-img: error while writing sector 64: Input/output error Becaus

Re: [Qemu-devel] [PATCH 2/2] pc: add 'etc/reserved-memory-end' fw_cfg interface for SeaBIOS

2013-11-12 Thread Paolo Bonzini
Il 12/11/2013 23:10, Michael S. Tsirkin ha scritto: > This was already discussed on previous revisions of this patch. > Have you seen that discussion? Obviously not. :) Paolo

Re: [Qemu-devel] [PATCH for-1.7] target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid()

2013-11-12 Thread Paolo Bonzini
Il 12/11/2013 19:54, Richard Henderson ha scritto: > For what it's worth, I think BOTH of the patches that have been posted > should be applied. That is, the patch that does (X || 1) -> (1 || X), > and the patch that adds the stub. > > Frankly I'd have thought this was obvious It's not that obvi

[Qemu-devel] Curses enabled for Windows 32 binary

2013-11-12 Thread Mike Levin
Hello QEMU developers, I'm trying to do the closes thing to a static linked compile with curses enabled of qemu-system32.exe for the Windows platform as possible. I've resisted mailing this developer mailing list for a year before I decided to turn here for help. I've made a self-contained QEMU/L

Re: [Qemu-devel] [PATCH 2/2] pc: add 'etc/reserved-memory-end' fw_cfg interface for SeaBIOS

2013-11-12 Thread Michael S. Tsirkin
On Tue, Nov 12, 2013 at 07:26:02PM +0100, Paolo Bonzini wrote: > Il 12/11/2013 14:58, Igor Mammedov ha scritto: > > 'etc/reserved-memory-end' will allow QEMU to tell BIOS where PCI > > BARs mapping could safely start in high memory. > > > > Allowing BIOS to start mapping 64-bit PCI BARs at address

Re: [Qemu-devel] QEMU/CPC project: an experience report

2013-11-12 Thread Gabriel Kerneis
On Thu, Oct 10, 2013 at 11:14:22PM +0100, Gabriel Kerneis wrote: > We were so excited about our QEMU/CPC GSoC project that we have decided > to write a 12-page article to share our experience Our "QEMU/CPC" paper has been accepted for publication at PEPM'14: http://www.program-transformation.org/P

[Qemu-devel] i386: pc: align gpa<->hpa on 1GB boundary (v6)

2013-11-12 Thread Marcelo Tosatti
v2: condition enablement of new mapping to new machine types (Paolo) v3: fix changelog v4: rebase v5: ensure alignment of piecetwo on 2MB GPA (Igor) do not register zero-sized piece-one(Igor) v6: fix memory leak (Igor) fix integer overflow(Ig

Re: [Qemu-devel] i386: pc: align gpa<->hpa on 1GB boundary (v5)

2013-11-12 Thread Marcelo Tosatti
On Tue, Nov 12, 2013 at 01:45:51PM +0100, Igor Mammedov wrote: > On Sun, 10 Nov 2013 18:47:53 -0200 > Marcelo Tosatti wrote: > > [...] > > > @@ -1177,10 +1182,50 @@ FWCfgState *pc_memory_init(MemoryRegion > > *system_memory, > > e820_add_entry(0, below_4g_mem_size, E820_RAM); > > if (

Re: [Qemu-devel] [PATCH 2/2] pc: add 'etc/reserved-memory-end' fw_cfg interface for SeaBIOS

2013-11-12 Thread Igor Mammedov
On Tue, 12 Nov 2013 19:26:02 +0100 Paolo Bonzini wrote: > Il 12/11/2013 14:58, Igor Mammedov ha scritto: > > 'etc/reserved-memory-end' will allow QEMU to tell BIOS where PCI > > BARs mapping could safely start in high memory. > > > > Allowing BIOS to start mapping 64-bit PCI BARs at address wher

Re: [Qemu-devel] [PATCH] virtio-net: don't update mac_table in error state

2013-11-12 Thread Vlad Yasevich
On 11/10/2013 10:48 PM, Amos Kong wrote: mac_table was always cleaned up first in handling VIRTIO_NET_CTRL_MAC_TABLE_SET command, and we din't recover mac_table content in error state, it's not correct. This patch makes all the changes in temporal variables, only update the real mac_table if eve

Re: [Qemu-devel] [PATCH] e1000/rtl8139: update HMP NIC when every bit is written

2013-11-12 Thread Vlad Yasevich
On 11/08/2013 10:43 PM, Amos Kong wrote: On Fri, Nov 08, 2013 at 02:42:27PM -0500, Vlad Yasevich wrote: What about this approach? This only updates the monitory when all the bits have been written to. Hi Vlad, Looks good to me. Using this patch, we don't need to care the writing order. If w

Re: [Qemu-devel] [PATCH] build: set up capabilities on qemu-bridge-helper

2013-11-12 Thread Avi Kivity
On Nov 12, 2013 9:23 PM, "Eric Blake" wrote: > > On 11/12/2013 04:10 AM, Avi Kivity wrote: > > Out-of-the-box, 'make install' sets up an unusable qemu-bridge-helper since > > it doesn't have the required capabilities. > > > > Fix by adding them. > > > > Note: this may break installing as non-root.

Re: [Qemu-devel] [PATCH] build: set up capabilities on qemu-bridge-helper

2013-11-12 Thread Eric Blake
On 11/12/2013 04:10 AM, Avi Kivity wrote: > Out-of-the-box, 'make install' sets up an unusable qemu-bridge-helper since > it doesn't have the required capabilities. > > Fix by adding them. > > Note: this may break installing as non-root. This is actually the right > thing to do, since not settin

Re: [Qemu-devel] dump-guest-memory enhancement.

2013-11-12 Thread Dave Anderson
- Original Message - > I haven't been there at the original creation of this functionality, but > I tend to agree with you. For analyzing the vmcore with gdb or crash, > the alignment doesn't seem to be important, so it was probably ignored. With respect to the crash utility, the p_alig

Re: [Qemu-devel] [PATCH for-1.7] target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid()

2013-11-12 Thread Stefan Weil
Am 12.11.2013 19:57, schrieb Peter Maydell: > On 12 November 2013 18:54, Richard Henderson wrote: >> For what it's worth, I think BOTH of the patches that have been posted >> should be applied. That is, the patch that does (X || 1) -> (1 || X), >> and the patch that adds the stub. > I think that

[Qemu-devel] [PATCH] build: set up capabilities on qemu-bridge-helper

2013-11-12 Thread Avi Kivity
Out-of-the-box, 'make install' sets up an unusable qemu-bridge-helper since it doesn't have the required capabilities. Fix by adding them. Note: this may break installing as non-root. This is actually the right thing to do, since not setting up the capability would result in a broken setup. Per

[Qemu-devel] [Bug 1250360] [NEW] qcow2 image logical corruption after host crash

2013-11-12 Thread Blue
Public bug reported: Description of problem: In case of power failure disk images that were active and created in qcow2 format can become logically corrupt so that they actually appear as unused (full of zeroes). Data seems to be there, but at this moment i cannot find any reliable method to re

Re: [Qemu-devel] [PATCH for-1.7] target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid()

2013-11-12 Thread Peter Maydell
On 12 November 2013 18:54, Richard Henderson wrote: > For what it's worth, I think BOTH of the patches that have been posted > should be applied. That is, the patch that does (X || 1) -> (1 || X), > and the patch that adds the stub. I think that makes sense and would be happy with that as a reso

Re: [Qemu-devel] [PATCH for-1.7] target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid()

2013-11-12 Thread Richard Henderson
On 11/13/2013 03:04 AM, Anthony Liguori wrote: > On Tue, Nov 12, 2013 at 8:08 AM, Peter Maydell > wrote: >> On 12 November 2013 15:58, Paolo Bonzini wrote: >>> I don't really see a reason why QEMU should give clang more weight than >>> Windows or Mac OS X. >> >> I'm not asking for more weight (a

[Qemu-devel] [PATCH for-1.7] vfio-pci: Fix multifunction=on

2013-11-12 Thread Alex Williamson
When an assigned device is initialized it copies the device config space into the emulated config space. Unfortunately multifunction is setup prior to the device initfn and gets clobbered. We need to restore it just like pci-assign does. Signed-off-by: Alex Williamson Cc: qemu-sta...@nongnu.org

[Qemu-devel] [PULL 2/2] MAINTAINERS: add git tree info for HMP, QMP and QAPI

2013-11-12 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- MAINTAINERS | 4 1 file changed, 4 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 77edacf..02b85ee 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -699,6 +699,7 @@ S: Supported F: monitor.c F: hmp.c F: hmp-commands.hx +T: git git://repo.or.cz/

[Qemu-devel] [PULL 1/2] Adjust qapi-visit for python-2.4.3

2013-11-12 Thread Luiz Capitulino
From: Richard Henderson We say we support python 2.4, but python 2.4.3 does not support the "expr if test else expr" syntax used here. This allows QEMU to compile on RHEL 5.3, the last release for ia64. Signed-off-by: Richard Henderson Reviewed-by: Michael Roth Signed-off-by: Luiz Capitulino

[Qemu-devel] [PULL for-1.7 0/2] QMP queue

2013-11-12 Thread Luiz Capitulino
The following changes since commit 964668b03d26f0b5baa5e5aff0c966f4fcb76e9e: Update version for 1.7.0-rc0 release (2013-11-06 21:49:39 -0800) are available in the git repository at: git://repo.or.cz/qemu/qmp-unstable.git queue/qmp for you to fetch changes up to dce07e0b2b172ccce43955fdee214

Re: [Qemu-devel] [RFC v2] target-arm: provide skeleton for a64 insn decoding

2013-11-12 Thread Richard Henderson
On 11/12/2013 11:29 PM, Claudio Fontana wrote: > provide a skeleton for a64 instruction decoding in translate-a64.c, > by dividing instructions into the classes defined by the > ARM Architecture Reference Manual(DDI0487A_a) C3 > > Signed-off-by: Claudio Fontana > Signed-off-by: Alex Bennée > Rev

Re: [Qemu-devel] [PATCH 2/2] pc: add 'etc/reserved-memory-end' fw_cfg interface for SeaBIOS

2013-11-12 Thread Paolo Bonzini
Il 12/11/2013 14:58, Igor Mammedov ha scritto: > 'etc/reserved-memory-end' will allow QEMU to tell BIOS where PCI > BARs mapping could safely start in high memory. > > Allowing BIOS to start mapping 64-bit PCI BARs at address where it > wouldn't conflict with other mappings QEMU might place before

Re: [Qemu-devel] [PATCH 4/8] qapi script: code move for generate_enum_name()

2013-11-12 Thread Eric Blake
On 11/06/2013 12:33 PM, Wenchao Xia wrote: > Later both qapi-types.py and qapi-visit.py need a common function > for enum name generation. > > Signed-off-by: Wenchao Xia > --- > scripts/qapi-types.py | 10 -- > scripts/qapi.py | 10 ++ > 2 files changed, 10 insertions(+

Re: [Qemu-devel] [PATCH 3/8] qapi script: check correctness of discriminator values in union

2013-11-12 Thread Eric Blake
On 11/06/2013 12:33 PM, Wenchao Xia wrote: > It will check whether the values specified are written correctly when > discriminator is a pre-defined enum type, which help check whether the > schema is in good form. > > It is allowed, that not every value in enum is used, so does not check > that ca

Re: [Qemu-devel] [PATCH for-1.7] target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid()

2013-11-12 Thread Peter Maydell
On 12 November 2013 17:04, Anthony Liguori wrote: > QEMU has always been intimately tied to GCC. Heck, it all started as > a giant GCC hack relying on entirely undocumented behavior (dyngen's > disassembly of functions). It has historically. Blue Swirl put in a lot of work to remove those depend

Re: [Qemu-devel] [PATCH 02/16] qemu-char: Allow a chardev to reconnect if disconnected

2013-11-12 Thread Corey Minyard
On 11/12/2013 10:43 AM, Eric Blake wrote: > On 11/12/2013 09:33 AM, Corey Minyard wrote: >> Allow a socket that connects to reconnect on a periodic basis if it >> fails to connect at startup or if the connection drops while in use. >> >> Signed-off-by: Corey Minyard >> --- >> include/sysemu/char.

Re: [Qemu-devel] [PATCH for-1.7] target-i386: Fix build by providing stub kvm_arch_get_supported_cpuid()

2013-11-12 Thread Anthony Liguori
On Tue, Nov 12, 2013 at 8:08 AM, Peter Maydell wrote: > On 12 November 2013 15:58, Paolo Bonzini wrote: >> I don't really see a reason why QEMU should give clang more weight than >> Windows or Mac OS X. > > I'm not asking for more weight (and actually my main > reason for caring about clang is ex

Re: [Qemu-devel] [PATCH v2 2/4] apic: QOM'ify apic & icc_bus

2013-11-12 Thread Andreas Färber
Am 12.11.2013 04:02, schrieb Chen Fan: > On Tue, 2013-11-12 at 09:54 +0800, 赵小强 wrote: >> He asked me to drop the parent_realize. so in v2, I just replace the >> 'init' with 'realize'. >> > Hmm,I'm confused, Go through the entire QEMU source code, there was no > DeviceRealize realize field in leaf

[Qemu-devel] [PATCH 10/16] ipmi: Add an external connection simulation interface

2013-11-12 Thread Corey Minyard
This adds an interface for IPMI that connects to a remote BMC over a chardev (generally a TCP socket). The OpenIPMI lanserv simulator describes this interface, see that for interface details. Signed-off-by: Corey Minyard --- default-configs/i386-softmmu.mak | 1 + default-configs/x86_64-sof

Re: [Qemu-devel] [PATCH 2/8] qapi script: report error for default case in union visit

2013-11-12 Thread Eric Blake
On 11/06/2013 12:33 PM, Wenchao Xia wrote: > It is possible to reach default case, when an union have a enum > discriminator, so don't abort() but report the error message. > > Signed-off-by: Wenchao Xia > --- > scripts/qapi-visit.py | 14 -- > 1 files changed, 12 insertions(+), 2

[Qemu-devel] [PATCH 02/16] qemu-char: Allow a chardev to reconnect if disconnected

2013-11-12 Thread Corey Minyard
Allow a socket that connects to reconnect on a periodic basis if it fails to connect at startup or if the connection drops while in use. Signed-off-by: Corey Minyard --- include/sysemu/char.h | 3 ++ qemu-char.c | 88 --- qemu-options.hx

[Qemu-devel] snapshots [was: Qemu-devel Digest, Vol 128, Issue 93]

2013-11-12 Thread Eric Blake
On 11/05/2013 08:27 PM, 宫文超 wrote: > hello evryone,who can give me a detail explain of the qemu code of the online > snapshot?THX Top-posting and replying to a digest message (especially without changing the subject line) is poor netiquette. Better would have been starting a new thread. Your qu

[Qemu-devel] [PATCH 09/16] ipmi: Add a local BMC simulation

2013-11-12 Thread Corey Minyard
This provides a minimal local BMC, basically enough to comply with the spec and provide a complete watchdog timer (including a sensor, SDR, and event). Signed-off-by: Corey Minyard --- default-configs/i386-softmmu.mak |1 + default-configs/x86_64-softmmu.mak |1 + hw/ipmi/Makefile.objs

Re: [Qemu-devel] [PATCH 02/16] qemu-char: Allow a chardev to reconnect if disconnected

2013-11-12 Thread Eric Blake
On 11/12/2013 09:33 AM, Corey Minyard wrote: > Allow a socket that connects to reconnect on a periodic basis if it > fails to connect at startup or if the connection drops while in use. > > Signed-off-by: Corey Minyard > --- > include/sysemu/char.h | 3 ++ > qemu-char.c | 88 > ++

[Qemu-devel] [PATCH 13/16] ipmi: Add migration capability to the IPMI device.

2013-11-12 Thread Corey Minyard
Signed-off-by: Corey Minyard io_length = 3; memory_region_init_io(&s->io, OBJECT(s), &ipmi_bt_io_ops, bt, "ipmi-bt", 3); +vmstate_register(NULL, 0, &vmstate_ipmi_bt, bt); return 0; } diff --git a/hw/ipmi/ipmi_extern.c b/hw/ipmi/ipmi_extern.c index 1cd7c11..d66797d 100644 --- a/h

[Qemu-devel] [PATCH 05/11] scsi-disk: reject ANCHOR=1 for UNMAP and WRITE SAME commands

2013-11-12 Thread Paolo Bonzini
Since we report ANC_SUP==0 in VPD page B2h, we need to return an error (ILLEGAL REQUEST/INVALID FIELD IN CDB) for all WRITE SAME requests with ANCHOR==1. Inspired by a similar patch to the LIO in-kernel target. Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-disk.c | 12 +++- 1 file chang

[Qemu-devel] [PATCH 12/16] ipmi: Add documentation

2013-11-12 Thread Corey Minyard
Add some basic documentation for the IPMI device. Signed-off-by: Corey Minyard --- qemu-options.hx | 35 +++ 1 file changed, 35 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 5bcfaa0..500d7c8 100644 --- a/qemu-options.hx +++ b/qemu-options.hx

[Qemu-devel] [PATCH 16/16] ipmi: Add SMBIOS table entry

2013-11-12 Thread Corey Minyard
Add an IPMI table entry to the SMBIOS. --- hw/ipmi/isa_ipmi.c | 29 + include/hw/i386/smbios.h | 14 ++ 2 files changed, 43 insertions(+) diff --git a/hw/ipmi/isa_ipmi.c b/hw/ipmi/isa_ipmi.c index b38c846..e40ca90 100644 --- a/hw/ipmi/isa_ipmi.c +++ b

[Qemu-devel] [PATCH 15/16] smbios: Add a function to directly add an entry

2013-11-12 Thread Corey Minyard
There was no way to directly add a table entry to the SMBIOS table, even though the BIOS supports this. So add a function to do this. This is in preparation for the IPMI handler adding it's SMBIOS table entry. Signed-off-by: Corey Minyard --- hw/i386/smbios.c | 27 +++ 1

[Qemu-devel] [PATCH 08/16] ipmi: Add a BT low-level interface

2013-11-12 Thread Corey Minyard
This provides the simulation of the BT hardware interface for IPMI. Signed-off-by: Corey Minyard --- default-configs/i386-softmmu.mak | 1 + default-configs/x86_64-softmmu.mak | 1 + hw/ipmi/Makefile.objs | 1 + hw/ipmi/ipmi_bt.c | 367 ++

[Qemu-devel] [PATCH for-1.7] acpi unit-test: add signatures and checksum verification

2013-11-12 Thread Marcel Apfelbaum
Loaded all ACPI tables from guest, making a good environment for further unit tests. Checked that ACPI tables are corrected pointed within the ACPI tree using their signatures. Verified checksum for all the tables. Signed-off-by: Marcel Apfelbaum --- To be applied on top of: [PATCH v2 2/2] acpi-

[Qemu-devel] [PATCH 06/16] ipmi: Add a PC ISA type structure

2013-11-12 Thread Corey Minyard
This provides the base infrastructure to tie IPMI low-level interfaces into a PC ISA bus. Signed-off-by: Corey Minyard --- default-configs/i386-softmmu.mak | 1 + default-configs/x86_64-softmmu.mak | 1 + hw/ipmi/Makefile.objs | 1 + hw/ipmi/isa_ipmi.c | 148

[Qemu-devel] [PATCH 11/16] ipmi: Add tests

2013-11-12 Thread Corey Minyard
Test the KCS interface with a local BMC and a BT interface with an external BMC. Signed-off-by: Corey Minyard --- tests/Makefile| 4 + tests/ipmi-bt-test.c | 440 ++ tests/ipmi-kcs-test.c | 294 + 3 files

[Qemu-devel] [PATCH 07/16] ipmi: Add a KCS low-level interface

2013-11-12 Thread Corey Minyard
This provides the simulation of the KCS hardware interface. Signed-off-by: Corey Minyard --- default-configs/i386-softmmu.mak | 1 + default-configs/x86_64-softmmu.mak | 1 + hw/ipmi/Makefile.objs | 1 + hw/ipmi/ipmi_kcs.c | 345 ++

[Qemu-devel] [PATCH 05/16] Add a base IPMI interface

2013-11-12 Thread Corey Minyard
Add the basic IPMI types and infrastructure to QEMU. Low-level interfaces and simulation interfaces will register with this; it's kind of the go-between to tie them together. Signed-off-by: Corey Minyard --- default-configs/i386-softmmu.mak | 1 + default-configs/x86_64-softmmu.mak | 1 +

[Qemu-devel] [PATCH 01/16] qemu-char: Allocate CharDriverState in qemu_chr_new_from_opts

2013-11-12 Thread Corey Minyard
This allocates the CharDriverState structure and passes it in to the open routine. This allows a coming option to automatically attempt to reconnect a chardev if the connection fails. The chardev has to be kept around so a reconnect can be done on it. Signed-off-by: Corey Minyard --- backends/

[Qemu-devel] [PATCH 14/16] pc: Postpone adding ACPI and SMBIOS to fw_cfg

2013-11-12 Thread Corey Minyard
Postpone the addition of the ACPI and SMBIOS tables until after device initialization. This allows devices to add entries to these tables. Signed-off-by: Corey Minyard --- hw/i386/pc.c | 38 ++ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH 03/16] qemu-char: remove free of chr from win_stdio_close

2013-11-12 Thread Corey Minyard
This will result in a double free on close, because it's freed in qemu_chr_delete() right after calling the close function. Signed-off-by: Corey Minyard --- qemu-char.c | 1 - 1 file changed, 1 deletion(-) diff --git a/qemu-char.c b/qemu-char.c index 23d7647..935066d 100644 --- a/qemu-char.c ++

[Qemu-devel] [PATCH 04/16] qemu-char: Close fd at end of file

2013-11-12 Thread Corey Minyard
The chardev backends that used qemu_chr_open_fd did not get their file descriptors closed at end of file or when the chardev was closed. This could result in a file descriptor leak. Signed-off-by: Corey Minyard --- qemu-char.c | 35 +-- 1 file changed, 29 insertio

[Qemu-devel] [PATCH 00/16] Add an IPMI device to QEMU

2013-11-12 Thread Corey Minyard
There are two (sets of) patches to the general code beyond the IPMI device addition. One set adds an option to qemu-char net devices to automatically try to reconnect if the connection disconnects. This lets the IPMI device connect to a remote BMC and recover if that BMC fails. The other set all

Re: [Qemu-devel] [PATCH 1/2] pc: map PCI address space as catchall region for not mapped addresses

2013-11-12 Thread Laszlo Ersek
On 11/12/13 14:58, Igor Mammedov wrote: > From: "Michael S. Tsirkin" > > With a help of negative memory region priority PCI address space > is mapped underneath RAM regions effectively catching every access > to addresses not mapped by any other region. > It simplifies PCI address space mapping i

Re: [Qemu-devel] [edk2 PATCH 0/1] OvmfPkg: grab ACPI tables from QEMU

2013-11-12 Thread Laszlo Ersek
On 11/12/13 17:05, Igor Mammedov wrote: > On Tue, 12 Nov 2013 16:11:49 +0100 > Laszlo Ersek wrote: > > >> Second, I tested the patch under the following circumstances: >> - 3.10-based host kernel, >> - qemu v1.7.0-rc0, with additional patches that shrink the "pci-hole" >> memory range to just

  1   2   >