Re: [Qemu-devel] [RFC PATCH v2 00/16] visitor+BER migration format

2014-04-25 Thread Eric Blake
On 04/24/2014 02:21 AM, Dr. David Alan Gilbert wrote: >> Sounds like a useful hack to speed up development, but not so much like >> a useful permanent API :) > > Yep, I think what I'll do is go with Eric's suggestion of the > migration-capability, > but initialise it based on the environment var

Re: [Qemu-devel] drive_del vs. device_del: what should come first?

2014-04-25 Thread Heinz Graalfs
On 23/04/14 15:01, Stefan Hajnoczi wrote: On Fri, Apr 11, 2014 at 02:47:20PM +0200, Heinz Graalfs wrote: Hello Markus, I finally managed to reproduce the problem, at least once ... The scenario was: dd if=/dev/vdx1 of=partitionone followed by a virsh detach... (with the device_del() under the

Re: [Qemu-devel] [PATCH 2/3] hw/arm/virt: Put GIC register banks on 64K boundaries

2014-04-25 Thread Rob Herring
On Thu, Apr 24, 2014 at 12:54 PM, Peter Maydell wrote: > For an AArch64 CPU which supports 64K pages, having the GIC > register banks at 4K offsets is potentially awkward. Move > them out to being at 64K offsets. (This is harmless for > AArch32 CPUs and for AArch64 CPUs with 4K pages, so it is sim

Re: [Qemu-devel] [PATCH v25 11/31] change block layer to support both QemuOpts and QEMUOptionParamter

2014-04-25 Thread Stefan Hajnoczi
On Mon, Apr 21, 2014 at 05:17:50PM -0600, Eric Blake wrote: > On 04/10/2014 11:54 AM, Chunyan Liu wrote: > > Change block layer to support both QemuOpts and QEMUOptionParameter. > > After this patch, it will change backend drivers one by one. At the end, > > QEMUOptionParameter will be removed and

[Qemu-devel] [PATCH] s390x/helper: Added format control bit to MMU translation

2014-04-25 Thread Thomas Huth
With the EDAT-1 facility, the MMU translation can stop at the segment table already, pointing to a 1 MB block. And while we're at it, move the page table entry handling to a separate function, too, as suggested by Alexander Graf. Signed-off-by: Thomas Huth --- target-s390x/cpu.h|4 +++ t

Re: [Qemu-devel] [PATCH v25 11/31] change block layer to support both QemuOpts and QEMUOptionParamter

2014-04-25 Thread Stefan Hajnoczi
On Fri, Apr 11, 2014 at 01:54:07AM +0800, Chunyan Liu wrote: > Change block layer to support both QemuOpts and QEMUOptionParameter. > After this patch, it will change backend drivers one by one. At the end, > QEMUOptionParameter will be removed and only QemuOpts is kept. > > Signed-off-by: Dong Xu

Re: [Qemu-devel] [PATCH] s390x/helper: Added format control bit to MMU translation

2014-04-25 Thread Alexander Graf
On 25.04.14 15:37, Thomas Huth wrote: With the EDAT-1 facility, the MMU translation can stop at the segment table already, pointing to a 1 MB block. And while we're at it, move the page table entry handling to a separate function, too, as suggested by Alexander Graf. Signed-off-by: Thomas Huth

Re: [Qemu-devel] [PATCH 2/3] hw/arm/virt: Put GIC register banks on 64K boundaries

2014-04-25 Thread Peter Maydell
On 25 April 2014 14:28, Rob Herring wrote: > On Thu, Apr 24, 2014 at 12:54 PM, Peter Maydell > wrote: >> For an AArch64 CPU which supports 64K pages, having the GIC >> register banks at 4K offsets is potentially awkward. Move >> them out to being at 64K offsets. (This is harmless for >> AArch32 C

Re: [Qemu-devel] target-i386: block migration and savevm if invariant tsc is exposed (v3)

2014-04-25 Thread Marcelo Tosatti
On Thu, Apr 24, 2014 at 04:21:59PM -0300, Eduardo Habkost wrote: > On Wed, Apr 23, 2014 at 06:04:45PM -0300, Marcelo Tosatti wrote: > > > > Invariant TSC documentation mentions that "invariant TSC will run at a > > constant rate in all ACPI P-, C-. and T-states". > > > > This is not the case if m

Re: [Qemu-devel] [PATCH v25 31/31] QemuOpts: cleanup tmp 'allocated' member from QemuOptsList

2014-04-25 Thread Stefan Hajnoczi
On Fri, Apr 11, 2014 at 01:54:27AM +0800, Chunyan Liu wrote: > /* Realloc dst option list and append options from an option list (list) > * to it. dst could be NULL or a malloced list. > + * Result dst has shorter lifetime then input list. s/then/than/ But I think it's helpful to be more expli

Re: [Qemu-devel] [PATCH 1/2] linux-user: Move if-elses to a switch statement

2014-04-25 Thread Huw Davies
> This makes adding more message types cleaner. > > Signed-off-by: Huw Davies > --- > linux-user/syscall.c | 51 +-- > 1 file changed, 33 insertions(+), 18 deletions(-) Ping, any advice on this set? Thanks, Huw.

Re: [Qemu-devel] [PATCH] qxl: Fix initial screenshot with spice

2014-04-25 Thread Cole Robinson
On 04/25/2014 02:39 AM, Gerd Hoffmann wrote: > Hi, > >> ui/console.c:qmp_screendump attempts to handle this by calling >> graphic_hw_update, but qxl handle's that asynchronously, and it isn't >> run until after the first screendump is performed. That's why the second >> screendump is correct. >

Re: [Qemu-devel] [PATCH v25 09/31] QemuOpts: add qemu_opts_append to replace append_option_parameters

2014-04-25 Thread Stefan Hajnoczi
On Fri, Apr 11, 2014 at 01:54:05AM +0800, Chunyan Liu wrote: > For later merge .create_opts of drv and proto_drv in qemu-img commands. > > Reviewed-by: Leandro Dorileo > Signed-off-by: Chunyan Liu > --- > include/qemu/option.h | 5 > util/qemu-option.c| 65 > +

Re: [Qemu-devel] [PATCH v25 01/31] QemuOpts: move find_desc_by_name ahead for later calling

2014-04-25 Thread Stefan Hajnoczi
On Fri, Apr 11, 2014 at 01:53:57AM +0800, Chunyan Liu wrote: > Reviewed-by: Leandro Dorileo > Reviewed-by: Eric Blake > Signed-off-by: Chunyan Liu > --- > util/qemu-option.c | 28 ++-- > 1 file changed, 14 insertions(+), 14 deletions(-) Reviewed-by: Stefan Hajnoczi

Re: [Qemu-devel] [PATCH v25 00/31] replace QEMUOptionParameter with QemuOpts

2014-04-25 Thread Stefan Hajnoczi
On Fri, Apr 11, 2014 at 01:53:56AM +0800, Chunyan Liu wrote: > This patch series is to replace QEMUOptionParameter with QemuOpts, so that > only > one Qemu Option structure is kept in QEMU code. > > --- > Changes to v24: > * fix Leandro's comments to v23 > * add patch for block/nfs.c > * re

Re: [Qemu-devel] [PATCH 0/3] monitor: Improve command completion

2014-04-25 Thread Luiz Capitulino
On Sun, 13 Apr 2014 16:25:04 +0100 Hani Benhabiles wrote: > This patch series adds a new callback to mon_cmd_t which will make adding > completion support for more commands cleaner. > > It moves some existing commands completions to using the new callback and also > fixes the completion for devi

Re: [Qemu-devel] [PATCH v9 0/4] qapi: Allow modularization of QAPI schema files

2014-04-25 Thread Luiz Capitulino
On Sun, 13 Apr 2014 21:07:53 +0200 Lluís Vilanova wrote: > Adds an include primitive to the syntax of QAPI schema files, allowing these > to > be modularized into multiple per-topic files in the future. > > Signed-off-by: Lluís Vilanova Markus, you reviewed previous versions of this series. C

Re: [Qemu-devel] [PATCH 0/2] net: Purge error_is_set()

2014-04-25 Thread Stefan Hajnoczi
On Thu, Apr 24, 2014 at 03:44:16PM +0200, Markus Armbruster wrote: > I got a private branch getting rid of it entirely. This is the second > part, covering network backends. > > Markus Armbruster (2): > net: Make qmp_query_rx_filter() with name argument more obvious > net: Don't use error_is_

Re: [Qemu-devel] [PULL 00/40] target-alpha queue

2014-04-25 Thread Peter Maydell
On 24 April 2014 20:52, Richard Henderson wrote: > Pull request for the patch series posted here > > Message-Id: <1397763195-1485-1-git-send-email-...@twiddle.net> > http://lists.gnu.org/archive/html/qemu-devel/2014-04/msg02763.html > > Since there are no changes since then, I'm just posting the p

Re: [Qemu-devel] [PULL 2/2] vga: add secondary stdvga variant

2014-04-25 Thread Peter Maydell
On 24 April 2014 11:30, Gerd Hoffmann wrote: > Add a standard vga variant which doesn't occupy any legacy > ressources and thus can easily be used as secondary (or legacy-free) This typo at least was pointed out in review. > graphics adapter. Programming must be done using the MMIO bar. thanks

[Qemu-devel] [PULL 0/6] Net pull request

2014-04-25 Thread Stefan Hajnoczi
The following changes since commit 0e96643c98eb22a5f2e11ac500852133032d38e4: Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-5' into staging (2014-04-24 16:16:57 +0100) are available in the git repository at: git://github.com/stefanha/qemu.git tags/net-pull-request for you to f

[Qemu-devel] [PULL 1/6] tap: Avoid extra iterations while closing file fd

2014-04-25 Thread Stefan Hajnoczi
From: Pankaj Gupta Avoid iterations for fd 0, 1 & 2 when we are closing file fds in child process. Signed-off-by: Pankaj Gupta Signed-off-by: Stefan Hajnoczi --- net/tap.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/net/tap.c b/net/tap.c index 8847ce1..

[Qemu-devel] [PULL 2/6] pcnet: remove duplicate assignment

2014-04-25 Thread Stefan Hajnoczi
From: Prasad Joshi Signed-off-by: Prasad Joshi Signed-off-by: Stefan Hajnoczi --- hw/net/pcnet.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c index 7cb47b3..ebe5057 100644 --- a/hw/net/pcnet.c +++ b/hw/net/pcnet.c @@ -718,7 +718,6 @@ static void pcnet_s_re

Re: [Qemu-devel] Regression (?) due to c4177479 ('spapr: make sure RMA is in first mode of first memory node')

2014-04-25 Thread Alexey Kardashevskiy
On 04/23/2014 05:04 AM, Nishanth Aravamudan wrote: > On 22.04.2014 [19:27:51 +1000], Benjamin Herrenschmidt wrote: >> On Tue, 2014-04-22 at 19:12 +1000, Alexey Kardashevskiy wrote: >>> I already have in plan to fix non-power-of-two sized memory nodes so I will >>> this too. >>> >>> What exactly is

Re: [Qemu-devel] [PATCH v25 30/31] cleanup QEMUOptionParameter

2014-04-25 Thread Stefan Hajnoczi
On Fri, Apr 11, 2014 at 01:54:26AM +0800, Chunyan Liu wrote: > Now that all backend drivers are using QemuOpts, remove all > QEMUOptionParameter related codes. > > Signed-off-by: Dong Xu Wang > Signed-off-by: Chunyan Liu > --- > block.c | 86 ++ > block/cow.c

Re: [Qemu-devel] [PATCH v9 3/4] qapi: Use an explicit input file

2014-04-25 Thread Eric Blake
On 04/13/2014 01:08 PM, Lluís Vilanova wrote: > Use an explicit input file on the command-line instead of reading from > standard input > > Signed-off-by: Lluís Vilanova > --- Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://l

[Qemu-devel] [PULL 6/6] net: Don't use error_is_set() to suppress additional errors

2014-04-25 Thread Stefan Hajnoczi
From: Markus Armbruster Using error_is_set(errp) that way can sweep programming errors under the carpet when we get called incorrectly with an error set. qmp_query_rx_filter() breaks its loop when it detects an error. It needs to set another error when the loop completes normally. Return right

[Qemu-devel] [PULL 4/6] net: xilinx_axienet.c: Add phy soft reset bit clearing

2014-04-25 Thread Stefan Hajnoczi
From: Nathan Rossi Clear the BMCR Reset when writing to registers. Signed-off-by: Nathan Rossi [ PC: * Trivial style fixes to commit message ] Signed-off-by: Peter Crosthwaite Reviewed-by: Beniamino Galvani Reviewed-by: Edgar E. Iglesias Signed-off-by: Stefan Hajnoczi --- hw/net/xilinx_ax

[Qemu-devel] [PULL 3/6] net/net.c: Remove unnecessary semicolon

2014-04-25 Thread Stefan Hajnoczi
From: Igor Ryzhov Signed-off-by: Igor Ryzhov Reviewed-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- net/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/net.c b/net/net.c index a4aadff..bc9ed6d 100644 --- a/net/net.c +++ b/net/net.c @@ -473,7 +473,7 @@ ssize_

Re: [Qemu-devel] [PATCH v25 02/31] QemuOpts: add def_value_str to QemuOptDesc

2014-04-25 Thread Stefan Hajnoczi
On Fri, Apr 11, 2014 at 01:53:58AM +0800, Chunyan Liu wrote: > Add def_value_str (default value) to QemuOptDesc, to replace function of the > default value in QEMUOptionParameter. > > Improve qemu_opts_get_* functions: if find opt, return opt->str; otherwise, > if desc->def_value_str is set, retur

[Qemu-devel] [PATCH v2 2/5] qemu-img: Consistently name Error * objects err, and not errp

2014-04-25 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qemu-img.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 4dae84a..968b4c8 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -457,12 +457,12 @@ fail: static void dump_json_image_check(ImageCheck *ch

[Qemu-devel] [PATCH v2 0/5] block: Purge error_is_set()

2014-04-25 Thread Markus Armbruster
I got a private branch getting rid of it entirely. This is the first part, covering the block subsystem. v2: * Rebased, trivial semantic conflict in 1/5 resolved * Use local_err rather than err in 2/5 [Kevin] Markus Armbruster (5): Use error_is_set() only when necessary (again) qemu-img: Con

[Qemu-devel] [PATCH v2 1/5] Use error_is_set() only when necessary (again)

2014-04-25 Thread Markus Armbruster
error_is_set(&var) is the same as var != NULL, but it takes whole-program analysis to figure that out. Unnecessarily hard for optimizers, static checkers, and human readers. Commit 84d18f0 dumbed it down to obvious, but a few more have crept in since, and documentation was overlooked. Dumb these

[Qemu-devel] [PATCH v2 3/5] nbd: Use return values instead of error_is_set(errp)

2014-04-25 Thread Markus Armbruster
Using error_is_set(errp) to check whether a function call failed is fragile: it breaks when errp is null. Check perfectly suitable return values instead when possible. errp can't be null there now, but this is more robust and more obviously correct Signed-off-by: Markus Armbruster --- block/nb

[Qemu-devel] [PATCH v2 4/5] blockdev: Clean up fragile use of error_is_set()

2014-04-25 Thread Markus Armbruster
Using error_is_set(ERRP) to find out whether a function failed is either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP may be null, because errors go undetected when it is. It's fragile when proving ERRP non-null involves a non-local argument. Else, it's unnecessarily opaque (see

[Qemu-devel] [PATCH v2 5/5] iscsi: Don't use error_is_set() to suppress additional errors

2014-04-25 Thread Markus Armbruster
Using error_is_set(errp) that way can sweep programming errors under the carpet when we get called incorrectly with an error set. Commit 24d3bd6 added a broken error path to iscsi_do_inquiry(): it first calls error_setg(), then jumps to the preexisting error label, where error_setg() gets called a

[Qemu-devel] [PULL 5/6] net: Make qmp_query_rx_filter() with name argument more obvious

2014-04-25 Thread Stefan Hajnoczi
From: Markus Armbruster With a client name, the QMP command is specified to return a list of one element. This isn't locally obvious in the code. Make it so. Signed-off-by: Markus Armbruster Signed-off-by: Stefan Hajnoczi --- net/net.c | 4 1 file changed, 4 insertions(+) diff --git a

Re: [Qemu-devel] [RFC 4/4] MemoryRegion with EOI callbacks for VFIO Platform devices

2014-04-25 Thread Antonios Motakis
Eventually we will get KVM_CAP_IRQFD_RESAMPLE support from the kernel side, so it will be possible to set an eventfd to trigger every time the guest issues an EOI. So both of these solutions would be a fall back, so I think the most maintainable and simple one should be kept for now. On Fri, Apr

[Qemu-devel] [PATCH 00/15] qmp qga: Purge error_is_set()

2014-04-25 Thread Markus Armbruster
I got a private branch getting rid of it entirely. This is the fifth part, covering QMP and the guest agent up to the point where I start messing with the QAPI code generators. That's left for the final part. Luiz, Mike, do I need to separate off the qga bits, or can this go through one of your

[Qemu-devel] [PATCH 02/15] qga: Consistently name Error ** objects errp, and not err

2014-04-25 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qga/commands-posix.c | 209 ++- qga/commands-win32.c | 115 ++-- qga/commands.c | 4 +- qga/vss-win32.c | 4 +- qga/vss-win32.h | 2 +- 5 files changed, 170 insertio

[Qemu-devel] [PATCH 01/15] qmp hmp: Consistently name Error * objects err, and not errp

2014-04-25 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- docs/writing-qmp-commands.txt | 28 hmp.c | 134 ++--- include/qapi/qmp/dispatch.h| 2 +- qapi/qmp-dispatch.c| 6 +- tests/test-qmp-input-strict.c |

[Qemu-devel] [PATCH 09/15] tests/qapi-schema: Drop superfluous error_is_set()

2014-04-25 Thread Markus Armbruster
visit_type_TestStruct() does nothing when called with an error set. Callers shouldn't do that, and no caller does. Drop the superfluous test. Signed-off-by: Markus Armbruster --- tests/test-qmp-input-visitor.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) di

[Qemu-devel] [PATCH 06/15] qga: Use return values instead of error_is_set(errp)

2014-04-25 Thread Markus Armbruster
Using error_is_set(errp) to check whether a function call failed is fragile: it breaks when errp is null. I'm not aware of actual breakage, but checking return values instead when convenient is more robust and more obviously correct. Signed-off-by: Markus Armbruster --- qga/commands-posix.c | 6

[Qemu-devel] [PATCH 05/15] error: Consistently name Error ** objects errp, and not err

2014-04-25 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- include/qapi/error.h | 27 --- util/error.c | 8 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/include/qapi/error.h b/include/qapi/error.h index c0f0c3b..7995801 100644 --- a/include/qapi/error.h ++

[Qemu-devel] [PATCH 08/15] qapi: Drop redundant, unclean error_is_set()

2014-04-25 Thread Markus Armbruster
do_qmp_dispatch()'s test for qmp_dispatch_check_obj() failure examines both the return value and the error object. The latter part is unclean; it works only when do_qmp_dispatch()'s caller passes a non-null errp argument. That's the case, but it's not locally obvious. Unclean. Cleanup would be

Re: [Qemu-devel] [PATCH v9 0/4] qapi: Allow modularization of QAPI schema files

2014-04-25 Thread Markus Armbruster
Luiz Capitulino writes: > On Sun, 13 Apr 2014 21:07:53 +0200 > Lluís Vilanova wrote: > >> Adds an include primitive to the syntax of QAPI schema files, >> allowing these to >> be modularized into multiple per-topic files in the future. >> >> Signed-off-by: Lluís Vilanova > > Markus, you review

[Qemu-devel] [PATCH 14/15] dump: Drop pointless error_is_set(), DumpState member errp

2014-04-25 Thread Markus Armbruster
In qmp_dump_guest_memory(), the error must be clear on entry, and we always bail out after setting it, directly or via dump_init(). Therefore, both error_is_set() are always false. Drop them. DumpState member errp is now write-only. Drop it, too. Signed-off-by: Markus Armbruster --- dump.c |

[Qemu-devel] [PATCH 11/15] qga: Clean up fragile use of error_is_set()

2014-04-25 Thread Markus Armbruster
Using error_is_set(ERRP) to find out whether a function failed is either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP may be null, because errors go undetected when it is. It's fragile when proving ERRP non-null involves a non-local argument. Else, it's unnecessarily opaque (see

[Qemu-devel] [PATCH 13/15] qemu-option: Clean up fragile use of error_is_set()

2014-04-25 Thread Markus Armbruster
Using error_is_set(ERRP) to find out whether to bail out due to previous error is either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP may be null, because errors go undetected when it is. It's fragile when proving ERRP non-null involves a non-local argument. Else, it's unnecessar

[Qemu-devel] [PATCH 10/15] qapi: Clean up fragile use of error_is_set()

2014-04-25 Thread Markus Armbruster
Using error_is_set(ERRP) to find out whether a function failed is either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP may be null, because errors go undetected when it is. It's fragile when proving ERRP non-null involves a non-local argument. Else, it's unnecessarily opaque (see

[Qemu-devel] [PATCH 04/15] qmp: Consistently name Error ** objects errp, and not err

2014-04-25 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qmp.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/qmp.c b/qmp.c index 87a28f7..456af05 100644 --- a/qmp.c +++ b/qmp.c @@ -41,7 +41,7 @@ NameInfo *qmp_query_name(Error **errp) return info; } -VersionInfo *qmp_qu

Re: [Qemu-devel] [PATCH v2] qmp: object-add: Validate class before creating object

2014-04-25 Thread Luiz Capitulino
On Wed, 16 Apr 2014 14:39:38 -0300 Eduardo Habkost wrote: > Currently it is very easy to crash QEMU by issuing an object-add command > using an abstract class or a class that doesn't support > TYPE_USER_CREATABLE as parameter. > > Example: with the following QMP command: > > (QEMU) object-a

[Qemu-devel] [PATCH 12/15] qga: Drop superfluous error_is_set()

2014-04-25 Thread Markus Armbruster
acquire_privilege(), execute_async() and check_suspend_mode() do nothing when called with an error set. Callers shouldn't do that, and no caller does. Drop the superfluous tests. Signed-off-by: Markus Armbruster --- qga/commands-win32.c | 10 -- 1 file changed, 10 deletions(-) diff --

[Qemu-devel] [PATCH 03/15] qga: Consistently name Error ** objects errp, and not err

2014-04-25 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qga/commands-posix.c | 10 +- qga/commands-win32.c | 10 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index e49c7da..f6af7d1 100644 --- a/qga/commands-posix.c +++ b/qga/command

Re: [Qemu-devel] [PATCH v9 0/4] qapi: Allow modularization of QAPI schema files

2014-04-25 Thread Luiz Capitulino
On Fri, 25 Apr 2014 17:09:49 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > > On Sun, 13 Apr 2014 21:07:53 +0200 > > Lluís Vilanova wrote: > > > >> Adds an include primitive to the syntax of QAPI schema files, > >> allowing these to > >> be modularized into multiple per-topic fil

[Qemu-devel] [PATCH 07/15] hmp: Guard against misuse of hmp_handle_error()

2014-04-25 Thread Markus Armbruster
Null errp argument makes no sense. Assert it's not null, to make this explicit, and guard against misuse. All current callers pass non-null errp. Signed-off-by: Markus Armbruster --- hmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hmp.c b/hmp.c index 44b19c0..7ab5bb

Re: [Qemu-devel] [PATCH v2 0/2] HMP: support specifying dump format for dump-guest-memory

2014-04-25 Thread Luiz Capitulino
On Thu, 17 Apr 2014 16:15:05 +0800 Qiao Nuohan wrote: > The last version is here: > > http://lists.nongnu.org/archive/html/qemu-devel/2014-04/msg00018.html > > ChangLog: > Changes from v7 to v8: > 1. add a patch to fix doc of dump-guest-memory > > Qiao Nuohan (2): > HMP: fix doc of dump-gues

[Qemu-devel] [PATCH 15/15] qmp: Don't use error_is_set() to suppress additional errors

2014-04-25 Thread Markus Armbruster
Using error_is_set(errp) that way can sweep programming errors under the carpet when we get called incorrectly with an error set. encrypted_bdrv_it() does it, because there's no way to make bdrv_iterate() break its loop. Actually safe, because qmp_cont() clears the error before the loop. Clean i

[Qemu-devel] [PATCH 2/2] xilinx_timer: Fix writes into TCSR register

2014-04-25 Thread Guenter Roeck
The TCSR register has only 11 valid bits. This is now used by the linux kernel to auto-detect endianness, and causes Linux 3.15-rc1 and later to hang when run under qemu-microblaze. Mask valid bits before writing the register to solve the problem. Signed-off-by: Guenter Roeck --- hw/timer/xilinx

[Qemu-devel] [PATCH 1/2] xilinx_intc: Fix writes into MER register

2014-04-25 Thread Guenter Roeck
The MER register only has two valid bits. This is now used by the linux kernel to auto-detect endianness, and causes Linux 3.15-rc1 and later to hang when run under qemu-microblaze. Mask valid bits before writing the register to solve the problem. Signed-off-by: Guenter Roeck --- hw/intc/xilinx_

Re: [Qemu-devel] [PATCH] qmp: Remove unused variable.

2014-04-25 Thread Luiz Capitulino
On Tue, 22 Apr 2014 22:44:03 +0100 Hani Benhabiles wrote: > Signed-off-by: Hani Benhabiles > --- > qmp.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/qmp.c b/qmp.c > index 87a28f7..44a6e17 100644 > --- a/qmp.c > +++ b/qmp.c > @@ -194,11 +194,10 @@ void qmp_system_

Re: [Qemu-devel] [PATCH v9 4/4] qapi: Add a primitive to include other files from a QAPI schema file

2014-04-25 Thread Eric Blake
On 04/13/2014 01:08 PM, Lluís Vilanova wrote: > The primitive uses JSON syntax, and include paths are relative to the file > using the directive: > > { 'include': 'path/to/file.json' } > > Signed-off-by: Lluís Vilanova > --- > docs/qapi-code-gen.txt | 11 + Reviewed

Re: [Qemu-devel] [PATCH] monitor: fix qmp_getfd() fd leak in error case

2014-04-25 Thread Luiz Capitulino
On Thu, 24 Apr 2014 13:58:18 +0200 Stefan Hajnoczi wrote: > qemu_chr_fe_get_msgfd() transfers ownership of the file descriptor to > the caller. Therefore all code paths in qmp_getfd() should either > register the file descriptor somewhere or close it. > > Signed-off-by: Stefan Hajnoczi Applie

Re: [Qemu-devel] [PATCH 06/15] qga: Use return values instead of error_is_set(errp)

2014-04-25 Thread Eric Blake
On 04/25/2014 09:05 AM, Markus Armbruster wrote: > Using error_is_set(errp) to check whether a function call failed is > fragile: it breaks when errp is null. I'm not aware of actual > breakage, but checking return values instead when convenient is more > robust and more obviously correct. > > Si

Re: [Qemu-devel] [PATCH] qmp: Remove unused variable.

2014-04-25 Thread Andreas Färber
Am 25.04.2014 17:40, schrieb Luiz Capitulino: > On Tue, 22 Apr 2014 22:44:03 +0100 > Hani Benhabiles wrote: > >> Signed-off-by: Hani Benhabiles >> --- >> qmp.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/qmp.c b/qmp.c >> index 87a28f7..44a6e17 100644 >> --- a/q

Re: [Qemu-devel] [PULL 2/2] vga: add secondary stdvga variant

2014-04-25 Thread Andreas Färber
Am 24.04.2014 12:30, schrieb Gerd Hoffmann: > Add a standard vga variant which doesn't occupy any legacy > ressources and thus can easily be used as secondary (or legacy-free) > graphics adapter. Programming must be done using the MMIO bar. > > Signed-off-by: Gerd Hoffmann [...] > diff --git a/h

Re: [Qemu-devel] [PATCH v2] qmp: object-add: Validate class before creating object

2014-04-25 Thread Andreas Färber
Am 25.04.2014 17:12, schrieb Luiz Capitulino: > On Wed, 16 Apr 2014 14:39:38 -0300 > Eduardo Habkost wrote: > >> Currently it is very easy to crash QEMU by issuing an object-add command >> using an abstract class or a class that doesn't support >> TYPE_USER_CREATABLE as parameter. >> >> Example:

Re: [Qemu-devel] [PATCH 05/16] pci-assign: propagate errors from get_real_id()

2014-04-25 Thread Eric Blake
On 04/10/2014 02:24 AM, Laszlo Ersek wrote: > get_real_id() has two thin wrappers (and no other callers), > get_real_vendor_id() and get_real_device_id(); it's easiest to convert > them in one fell swoop. > > Signed-off-by: Laszlo Ersek > --- > hw/i386/kvm/pci-assign.c | 45 +

Re: [Qemu-devel] [PATCH v2 0/5] block: Purge error_is_set()

2014-04-25 Thread Stefan Hajnoczi
On Fri, Apr 25, 2014 at 04:50:30PM +0200, Markus Armbruster wrote: > I got a private branch getting rid of it entirely. This is the first > part, covering the block subsystem. > > v2: > * Rebased, trivial semantic conflict in 1/5 resolved > * Use local_err rather than err in 2/5 [Kevin] > > Mark

[Qemu-devel] [PULL 01/10] block: Prevent coroutine stack overflow when recursing in bdrv_open_backing_file.

2014-04-25 Thread Stefan Hajnoczi
From: Benoît Canet In 1.7.1 qcow2_create2 reopen the file for flushing without the BDRV_O_NO_BACKING flags. As a consequence the code would recursively open the whole backing chain. These three stack arrays would pile up through the recursion and lead to a coroutine stack overflow. Convert t

[Qemu-devel] [PULL 00/10] Block patches

2014-04-25 Thread Stefan Hajnoczi
The following changes since commit 411f491e0af173cf8f39347574941bd26fbae381: Merge remote-tracking branch 'remotes/rth/tags/tgt-axp-pull-20140424' into staging (2014-04-25 13:25:22 +0100) are available in the git repository at: git://github.com/stefanha/qemu.git tags/block-pull-request fo

[Qemu-devel] [PULL 03/10] qemu-iotests: Improve and make use of QMPTestCase.wait_until_completed()

2014-04-25 Thread Stefan Hajnoczi
From: Fam Zheng This eliminates code duplication. Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/030| 50 +-- tests/qemu-iotests/056| 9 +--- tests/qemu-iotests/iotests.py | 5 +++-- 3 files changed,

[Qemu-devel] [PULL 02/10] doc: add -drive rerror=, werror= to qemu --help output

2014-04-25 Thread Stefan Hajnoczi
These options are already documented on the man page but missing from qemu --help. Signed-off-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf --- qemu-options.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index 6457034..98b4002 100644 ---

[Qemu-devel] [PULL 04/10] MAINTAINERS: Add qemu-img/io to block subsystem

2014-04-25 Thread Stefan Hajnoczi
From: Kevin Wolf qemu-img and qemu-io were not covered by any MAINTAINERS entry so far. Reported-by: Markus Armbruster Signed-off-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index c66946f..b287e

[Qemu-devel] [PULL 05/10] block: Expose host_* drivers in blockdev-add

2014-04-25 Thread Stefan Hajnoczi
From: Kevin Wolf All the functionality to use the host_device, host_cdrom and host_floppy drivers is already there, they just need to be added to the schema. The block driver names containing underscores are preexisting and cannot be changed without breaking command line compatibility. Signed-o

[Qemu-devel] [PULL 07/10] qemu-img: Consistently name Error * objects err, and not errp

2014-04-25 Thread Stefan Hajnoczi
From: Markus Armbruster Signed-off-by: Markus Armbruster Signed-off-by: Stefan Hajnoczi --- qemu-img.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 4dae84a..968b4c8 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -457,12 +457,12 @@

[Qemu-devel] [PULL 06/10] Use error_is_set() only when necessary (again)

2014-04-25 Thread Stefan Hajnoczi
From: Markus Armbruster error_is_set(&var) is the same as var != NULL, but it takes whole-program analysis to figure that out. Unnecessarily hard for optimizers, static checkers, and human readers. Commit 84d18f0 dumbed it down to obvious, but a few more have crept in since, and documentation w

[Qemu-devel] [PULL 08/10] nbd: Use return values instead of error_is_set(errp)

2014-04-25 Thread Stefan Hajnoczi
From: Markus Armbruster Using error_is_set(errp) to check whether a function call failed is fragile: it breaks when errp is null. Check perfectly suitable return values instead when possible. errp can't be null there now, but this is more robust and more obviously correct Signed-off-by: Markus

[Qemu-devel] [PULL 10/10] iscsi: Don't use error_is_set() to suppress additional errors

2014-04-25 Thread Stefan Hajnoczi
From: Markus Armbruster Using error_is_set(errp) that way can sweep programming errors under the carpet when we get called incorrectly with an error set. Commit 24d3bd6 added a broken error path to iscsi_do_inquiry(): it first calls error_setg(), then jumps to the preexisting error label, where

[Qemu-devel] [PATCH] virtio-rng: support multiple virtio-rng devices

2014-04-25 Thread Amos Kong
Current hwrng core supports to register multiple hwrng devices, and there is only one device really works in the same time. QEMU alsu supports to have multiple virtio-rng backends. This patch changes virtio-rng driver to support multiple virtio-rng devices. ]# cat /sys/class/misc/hw_random/rng_av

[Qemu-devel] [PULL 09/10] blockdev: Clean up fragile use of error_is_set()

2014-04-25 Thread Stefan Hajnoczi
From: Markus Armbruster Using error_is_set(ERRP) to find out whether a function failed is either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP may be null, because errors go undetected when it is. It's fragile when proving ERRP non-null involves a non-local argument. Else, it's

[Qemu-devel] [Bug 1312561] [NEW] libstdc++-6.dll is missing from your computer

2014-04-25 Thread Rupert Russell
Public bug reported: qemu-w64-setup-20140418.exe Windows 7 64 bit PC. qemu-system-armw -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda c:\11\rasimg\test.vhd qemu-system-armw.exe - System Error The program

[Qemu-devel] [Bug 1312668] [NEW] x86 cpu nx feature: guest reboots after migrate exec

2014-04-25 Thread svkh
Public bug reported: Using instruction on http://www.linux-kvm.org/page/Migration I save VM state to external file and try load it, but VM starts, shows saved screen and reboots immediatly. Cmdline for vm state saving: $ sudo ./i386-softmmu/qemu-system-i386 -machine accel=kvm,kernel_irqchip=on

Re: [Qemu-devel] [PATCH 0/3] disas/libvixl: update to upstream 1.3

2014-04-25 Thread Richard Henderson
On 04/25/2014 12:15 AM, Christoffer Dall wrote: >> > Possible options: >> > (a) apply these patches, and live with the bisection >> > break on 32 bit hosts >> > (b) squash all these patches together into a single >> > commit, avoiding the bisection break but losing the >> > ability

Re: [Qemu-devel] [PATCH] improve emulation correctness

2014-04-25 Thread Richard Henderson
On 04/25/2014 01:13 AM, Dmitry Poletaev wrote: > There is a set of test, that checks QEMU CPU for similar behavior with real > hardware (http://roberto.greyhats.it/projects/pills.html). Test > reg/pill2579.c can detect, that program is execute in emulated environment. > It is related with behavi

[Qemu-devel] [PATCH] improve emulation correctness

2014-04-25 Thread poletaev
There is a set of test, that checks QEMU CPU for similar behavior with real hardware (http://roberto.greyhats.it/projects/pills.html). Test reg/pill2579.c can detect, that program is execute in emulated environment. It is related with behavior of rcl instruction. If the number of shifted bits more

[Qemu-devel] [PATCH] SMI handler should set the CPL to zero and save and restore it on rsm.

2014-04-25 Thread Kevin O'Connor
The current SMI interrupt handler is being run with the same CPL as the code it interrupts. If the existing code is running with CPL=3, then the SMI handler can cause spurious exceptions. The System Management Mode (SMM) should always run at the highest protection level. Signed-off-by: Kevin O'C

Re: [Qemu-devel] [PATCH] improve emulation correctness

2014-04-25 Thread Peter Maydell
On 25 April 2014 09:13, Dmitry Poletaev wrote: > There is a set of test, that checks QEMU CPU for similar behavior with real > hardware (http://roberto.greyhats.it/projects/pills.html). Test > reg/pill2579.c can detect, that program is execute in emulated environment. > It is related with behav

Re: [Qemu-devel] [PATCH] improve emulation correctness

2014-04-25 Thread Eric Blake
On 04/24/2014 02:35 AM, poletaev wrote: > There is a set of test, that checks QEMU CPU for similar behavior with real > hardware (http://roberto.greyhats.it/projects/pills.html). Test > reg/pill2579.c can detect, that program is execute in emulated environment. > It is related with behavior of rcl

Re: [Qemu-devel] [PATCH] target-arm: Implement XScale cache lockdown operations as NOPs

2014-04-25 Thread Peter Maydell
On 19 March 2014 21:13, Peter Maydell wrote: > XScale defines some implementation-specific coprocessor registers > for doing cache lockdown operations. Since QEMU doesn't model a > cache no proper implementation is possible, but NOP out the > registers so that guest code like u-boot that tries to

Re: [Qemu-devel] [PATCH V3 2/5] vl.c: copy QEMUMachine's fields to MachineClass

2014-04-25 Thread Andreas Färber
Am 09.04.2014 19:34, schrieb Marcel Apfelbaum: > In order to eliminate the QEMUMachine indirection, > add its fields directly to MachineClass. > Do not remove yet qemu_machine field because it is Either "not yet" or "field yet" - I went for the former. > still in use by sparpr. sPAPR - fixed. >

[Qemu-devel] [PATCH 1/6] block: Create bdrv_inherited_flags()

2014-04-25 Thread Kevin Wolf
Instead of having bdrv_open_flags() as a function that creates flags for several unrelated places and then adding open-coded flags on top, create a new function that derives the flags for bs->file from the flags for bs. Signed-off-by: Kevin Wolf --- block.c | 28 ++-- 1 f

[Qemu-devel] [PATCH 2/6] block: Create bdrv_backing_flags()

2014-04-25 Thread Kevin Wolf
Instead of manipulation flags inline, move the derivation of the flags of a backing file into a new function next to the existing functions that derive flags for bs->file and for the block driver open function. Signed-off-by: Kevin Wolf --- block.c | 23 +-- 1 file changed, 1

[Qemu-devel] [PATCH 0/6] block: bdrv_open() fixes and cleanups

2014-04-25 Thread Kevin Wolf
Kevin Wolf (6): block: Create bdrv_inherited_flags() block: Create bdrv_backing_flags() block: Remove BDRV_O_COPY_ON_READ for bs->file block: Unlink temporary files in raw-posix/win32 Revert "block: another bdrv_append fix" block: Fix open_flags in bdrv_reopen() block.c

[Qemu-devel] [PATCH 5/6] Revert "block: another bdrv_append fix"

2014-04-25 Thread Kevin Wolf
This reverts commit 3a389e7926750cba5c83f662b1941888b2bebc04. The commit was wrong and what it tried to fix just works today without any change. What the commit tried to fix: When creating live snapshots, the new image file is opened with BDRV_O_NO_BACKING because the whole backing chain

[Qemu-devel] [PATCH 3/6] block: Remove BDRV_O_COPY_ON_READ for bs->file

2014-04-25 Thread Kevin Wolf
Copy on Read makes sense on the format level where backing files are implemented, but it's not required on the protocol level. While it shouldn't actively break anything to have COR enabled on both layers, needless serialisation and allocation checks may impact performance. Signed-off-by: Kevin Wo

[Qemu-devel] [PATCH 4/6] block: Unlink temporary files in raw-posix/win32

2014-04-25 Thread Kevin Wolf
Instead of having unlink() calls in the generic block layer, where we aren't even guarateed to have a file name, move them to those block drivers that are actually used and that always have a filename. Gets us rid of some #ifdefs as well. The patch also converts bs->is_temporary to a new BDRV_O_TE

[Qemu-devel] [PATCH 6/6] block: Fix open_flags in bdrv_reopen()

2014-04-25 Thread Kevin Wolf
Use the same function as bdrv_open() for determining what the right flags for bs->file are. Without doing this, a reopen means that bs->file loses BDRV_O_CACHE_WB or BDRV_O_UNMAP if bs doesn't have it as well. Signed-off-by: Kevin Wolf --- block.c | 5 - 1 file changed, 4 insertions(+), 1 de

Re: [Qemu-devel] [GSoC] Wanted: small warmup tasks

2014-04-25 Thread Marc Marí
2014-04-25 14:25 GMT+02:00 Andreas Färber : > > Am 25.04.2014 11:22, schrieb Peter Crosthwaite: > > On Fri, Apr 25, 2014 at 5:55 PM, Marc Marí wrote: > >> I'm now looking at the conditional fprintf's. I'll need a bit of help later > >> in sending the patches :D. > > For starters, please use plain

Re: [Qemu-devel] [PATCH v2] qmp: object-add: Validate class before creating object

2014-04-25 Thread Luiz Capitulino
On Fri, 25 Apr 2014 17:57:12 +0200 Andreas Färber wrote: > Am 25.04.2014 17:12, schrieb Luiz Capitulino: > > On Wed, 16 Apr 2014 14:39:38 -0300 > > Eduardo Habkost wrote: > > > >> Currently it is very easy to crash QEMU by issuing an object-add command > >> using an abstract class or a class th

<    1   2   3   >