Re: [Qemu-devel] [PATCH v1 14/16] target-arm: A64: Emulate the SMC insn

2014-05-30 Thread Edgar E. Iglesias
On Fri, May 30, 2014 at 11:50:23AM -0500, Greg Bellows wrote: > On 30 May 2014 02:28, Edgar E. Iglesias wrote: > > > From: "Edgar E. Iglesias" > > > > Signed-off-by: Edgar E. Iglesias > > --- > > target-arm/cpu.h | 1 + > > target-arm/helper-a64.c| 1 + > > target-arm/helper.c

Re: [Qemu-devel] [PATCH v1 05/16] target-arm: Add ESR_EL2 and 3

2014-05-30 Thread Edgar E. Iglesias
On Fri, May 30, 2014 at 09:12:52AM -0500, Greg Bellows wrote: >On 30 May 2014 02:28, Edgar E. Iglesias <[1]edgar.igles...@gmail.com> >wrote: > > From: "Edgar E. Iglesias" <[2]edgar.igles...@xilinx.com> > Signed-off-by: Edgar E. Iglesias <[3]edgar.igles...@xilinx.com> > --- >

Re: [Qemu-devel] [PATCH] target-arm: Prepare cpreg writefns/readfns for EL3/SecExt

2014-05-30 Thread Peter Crosthwaite
On Fri, May 16, 2014 at 10:43 PM, Fabian Aggeler wrote: > This patch changes some readfns/writefns to use raw_write > and raw_read functions, wich use the fieldoffset specified "which" > in ARMCPRegInfo instead of directly accessing the field. > This will simplify patches for EL3 & Security Exte

Re: [Qemu-devel] [PATCH 2/2] tcg/optimize: Remember garbage high bits for 32-bit ops

2014-05-30 Thread Aurelien Jarno
On Fri, May 23, 2014 at 11:57:11AM -0700, Richard Henderson wrote: > For a 64-bit host, the high bits of a register after a 32-bit operation > are undefined. Adjust the temps mask for all 32-bit ops to reflect that. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 33 ++

Re: [Qemu-devel] [PATCH 1/2] tcg/optimize: Move updating of gen_opc_buf into tcg_opt_gen_mov*

2014-05-30 Thread Aurelien Jarno
On Fri, May 23, 2014 at 11:57:10AM -0700, Richard Henderson wrote: > No functional change, just reduce a bit of redundancy. > > Signed-off-by: Richard Henderson > --- > tcg/optimize.c | 117 > +++-- > 1 file changed, 56 insertions(+), 61 delet

[Qemu-devel] [PATCH] fix configure: duplicate/incorrect order of -lrt

2014-05-30 Thread Rick Liu
>From 55a9abb88c53ace0791a01269ad0690c7ddcdcf7 Mon Sep 17 00:00:00 2001 From: Rick Liu Date: Fri, 30 May 2014 14:10:20 -0700 Subject: [PATCH] fix configure: duplicate/incorrect order of -lrt '-lrt' flag duplicationi/incorrect order would cause 'undefined reference to clock_gettime' error during c

[Qemu-devel] [Bug 1324724] Re: make install fails if running strip

2014-05-30 Thread Peter Chubb
The libexec case doesn't actually work, which is why IO switched to a separate variable. One of the reasons I said the patch is probably wrong. I suspect we need something like $(STRIP) $(addprefix $(DESTDIR)/$(BINDIR), $(notdir ${TOOLS))) And I didn't see the problem on x86_64, only on armhf. I

[Qemu-devel] [Bug 1314857] Re: seg fault in ivshmem when using ioeventfd=on

2014-05-30 Thread Serge Hallyn
** Changed in: qemu-kvm (Ubuntu) Importance: Undecided => Medium ** Changed in: qemu-kvm (Ubuntu) Status: New => Confirmed -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1314857 Title: se

Re: [Qemu-devel] [PATCH 09/21] target-mips: redefine Integer Multiply and Divide instructions

2014-05-30 Thread Aurelien Jarno
On Fri, May 30, 2014 at 03:47:47PM +0100, Leon Alrae wrote: > Use "R6_" prefix in front of all new Multiply / Divide instructions for > easier differentiation between R6 and preR6. > > Signed-off-by: Leon Alrae > --- > disas/mips.c| 16 ++ > target-mips/translate.c | 351 > ++

Re: [Qemu-devel] [PATCH 10/21] target-mips: move CLO, DCLO, CLZ, DCLZ, SDBBP and free special2 in R6

2014-05-30 Thread Aurelien Jarno
On Fri, May 30, 2014 at 03:47:48PM +0100, Leon Alrae wrote: > Also consider OPC_SPIM instruction as deleted in R6 because it is overlaping > with MIPS32R6 SDBBP. > > Signed-off-by: Leon Alrae > --- > disas/mips.c|5 ++ > target-mips/translate.c | 120 > -

Re: [Qemu-devel] [PATCH 11/21] target-mips: Status.UX/SX/KX enable 32-bit address wrapping

2014-05-30 Thread Aurelien Jarno
On Fri, May 30, 2014 at 03:47:49PM +0100, Leon Alrae wrote: > In R6 the special behaviour for data references is also specified for Kernel > and Supervisor mode. Therefore MIPS_HFLAG_UX is replaced by generic > MIPS_HFLAG_X > indicating whether 64-bit mode is enabled in current operating mode. I

Re: [Qemu-devel] [PATCH 12/21] target-mips: add ALIGN, DALIGN, BITSWAP and DBITSWAP instructions

2014-05-30 Thread Aurelien Jarno
On Fri, May 30, 2014 at 03:47:50PM +0100, Leon Alrae wrote: > From: Yongbok Kim > > Signed-off-by: Yongbok Kim > Signed-off-by: Leon Alrae > --- > disas/mips.c|4 ++ > target-mips/helper.h|2 + > target-mips/op_helper.c | 16 +++ > target-mips/translate.c | 103 +

Re: [Qemu-devel] [patch 3/3] mc146818rtc: add "rtc" link to "/machine" (v2)

2014-05-30 Thread Eric Blake
On 05/30/2014 03:59 PM, Marcelo Tosatti wrote: Your subject line is harder than necessary. 'git am' would put the "(v2)" suffix into qemu.git (it only strips the [...] prefix). The proper way to generate a v2 is with 'git send-email -v2', which produces [PATCH v2] as the subject line prefix. >

Re: [Qemu-devel] [PATCH v3 4/8] qdev: add qdev_alias_all_properties()

2014-05-30 Thread Peter Crosthwaite
On Fri, May 30, 2014 at 9:17 PM, Stefan Hajnoczi wrote: > The qdev_alias_all_properties() function creates QOM alias properties > for each qdev property on a DeviceState. This is useful for parent > objects that wish to forward property accesses to their children. > > Signed-off-by: Stefan Hajnoc

Re: [Qemu-devel] [patch 3/3] mc146818rtc: add "rtc" link to "/machines"

2014-05-30 Thread Paolo Bonzini
Il 30/05/2014 22:11, mtosa...@redhat.com ha scritto: Add a link to rtc under /machines providing a stable location for management apps to query "date" field. {"execute":"qom-get","arguments":{"path":"/machine/rtc","property":"date"} } Suggested by Paolo Bonzini. Signed-off-by: Marcelo Tosatti

Re: [Qemu-devel] [patch 2/3] mc146818rtc: add rtc_reset_reinjection QMP command

2014-05-30 Thread Paolo Bonzini
Il 30/05/2014 22:11, mtosa...@redhat.com ha scritto: + +static QLIST_HEAD(, RTCState) rtc_devices = +QLIST_HEAD_INITIALIZER(rtc_devices); + +void qmp_rtc_reset_reinjection(Error **errp) +{ +RTCState *s; + +QLIST_FOREACH(s, &rtc_devices, link) { +s->irq_coalesced = 0; +} +}

[Qemu-devel] [patch 3/3] mc146818rtc: add "rtc" link to "/machine" (v2)

2014-05-30 Thread Marcelo Tosatti
v2: - fix changelog to mention "machine" not "machines - remove TARGET_I386 ifdef - Add a link to rtc under /machine providing a stable location for management apps to query "date" field. {"execute":"qom-get","arguments":{"path":"/machine/rtc","property":"date"}} Suggeste

[Qemu-devel] [PATCHv3 RESEND] block: introduce BDRV_O_SEQUENTIAL

2014-05-30 Thread Peter Lieven
this patch introduces a new flag to indicate that we are going to sequentially read from a file and do not plan to reread/reuse the data after it has been read. The current use of this flag is to open the source(s) of a qemu-img convert process. If a protocol from block/raw-posix.c is used posix_

[Qemu-devel] [PATCH RESEND] migration: catch unknown flags in ram_load

2014-05-30 Thread Peter Lieven
if a saved vm has unknown flags in the memory data qemu currently simply ignores this flag and continues which yields in an unpredictable result. this patch catches all unknown flags and aborts the loading of the vm. CC: qemu-sta...@nongnu.org Signed-off-by: Peter Lieven Reviewed-by: Eric Blake

[Qemu-devel] [PATCHv2] block/iscsi: handle BUSY condition

2014-05-30 Thread Peter Lieven
this patch adds handling of BUSY status reponse from an iSCSI target. Currently, we fail with -EIO in case of SCSI_STATUS_BUSY while the obvious reaction would be to retry the operation after some time. The retry time is randomly choosen from a range with exponential growth increasing with each ret

Re: [Qemu-devel] [PATCH v3 12/12] block: add QAPI command to allow live backing file change

2014-05-30 Thread Eric Blake
On 05/30/2014 11:35 AM, Jeff Cody wrote: > This allows a user to make a live change to the backing file recorded in > an open image. > > The image file to modify can be specified 2 ways: > > 1) 'device' string, and image filename > 2) image node-name > > Note: this does not cause the backing fil

Re: [Qemu-devel] [PATCH 2/3] tci: Convert to new ldst opcodes

2014-05-30 Thread Stefan Weil
Am 30.05.2014 22:21, schrieb Richard Henderson: > Signed-off-by: Richard Henderson > --- > tcg/tci/tcg-target.c | 76 +--- > tcg/tci/tcg-target.h | 2 +- > tci.c| 322 > --- > 3 files changed, 207 insertions(+), 193 delet

Re: [Qemu-devel] [PATCH v3 11/12] block: Add QMP documentation for block-stream

2014-05-30 Thread Eric Blake
On 05/30/2014 11:35 AM, Jeff Cody wrote: > The QMP command 'block-stream' was missing QMP documentation. Add > that documentation. > > Signed-off-by: Jeff Cody > --- > qmp-commands.hx | 58 > + > 1 file changed, 58 insertions(+) > Revie

Re: [Qemu-devel] [PATCH v3 10/12] block: add backing-file option to block-stream

2014-05-30 Thread Eric Blake
On 05/30/2014 11:35 AM, Jeff Cody wrote: > On some image chains, QEMU may not always be able to resolve the > filenames properly, when updating the backing file of an image > after a block job. > > For instance, certain relative pathnames may fail, or drives may > have been specified originally by

[Qemu-devel] [PATCH v2 2/2] spapr: Add kvm-type property

2014-05-30 Thread Eduardo Habkost
The kvm-type machine option was left out when MachineState was introduced, preventing the kvm-type option from being used. Add the missing property to the sPAPR machine class, so it can be used. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Add property only to the sPAPR machine class

[Qemu-devel] [PATCH v2 1/2] spapr: Create SPAPRMachine struct

2014-05-30 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- hw/ppc/spapr.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 57e9578..30764aa 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -84,7 +84,20 @@ #define HTAB_SIZE(spapr)(1ULL << ((spapr)->ht

[Qemu-devel] [PATCH v2 0/2] Restore kvm-type option support on -machine pseries

2014-05-30 Thread Eduardo Habkost
Second try, now changing only the pseries machine code at hw/ppc/spapr.c. Cc: Alexander Graf Cc: qemu-...@nongnu.org Cc: Aneesh Kumar K.V Cc: Paolo Bonzini Cc: Marcel Apfelbaum Cc: Andreas Färber Eduardo Habkost (2): spapr: Create SPAPRMachine struct spapr: Add kvm-type property hw/ppc

Re: [Qemu-devel] [PATCH] machine: Add kvm-type property

2014-05-30 Thread Alexander Graf
> Am 30.05.2014 um 22:57 schrieb Eduardo Habkost : > >> On Fri, May 30, 2014 at 10:46:56PM +0200, Paolo Bonzini wrote: >> Il 30/05/2014 22:41, Eduardo Habkost ha scritto: >>> diff --git a/include/hw/boards.h b/include/hw/boards.h >>> index 2d2e2be..44956d6 100644 >>> --- a/include/hw/boards.h >>

Re: [Qemu-devel] [PATCH v3 09/12] block: add ability for block-stream to use node-name

2014-05-30 Thread Eric Blake
On 05/30/2014 11:35 AM, Jeff Cody wrote: > This adds the ability for block-stream to use node-name arguments > for base, to specify the backing image to stream from. > > Both 'base' and 'base-node-name' are optional, but mutually exclusive. > Either can be specified, but not both together. > > Th

Re: [Qemu-devel] [PATCH] machine: Add kvm-type property

2014-05-30 Thread Eduardo Habkost
On Fri, May 30, 2014 at 10:46:56PM +0200, Paolo Bonzini wrote: > Il 30/05/2014 22:41, Eduardo Habkost ha scritto: > >diff --git a/include/hw/boards.h b/include/hw/boards.h > >index 2d2e2be..44956d6 100644 > >--- a/include/hw/boards.h > >+++ b/include/hw/boards.h > >@@ -111,6 +111,7 @@ struct Machin

Re: [Qemu-devel] [PATCH] machine: Add kvm-type property

2014-05-30 Thread Paolo Bonzini
Il 30/05/2014 22:41, Eduardo Habkost ha scritto: diff --git a/include/hw/boards.h b/include/hw/boards.h index 2d2e2be..44956d6 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -111,6 +111,7 @@ struct MachineState { bool mem_merge; bool usb; char *firmware; +char *k

[Qemu-devel] [PATCH] machine: Add kvm-type property

2014-05-30 Thread Eduardo Habkost
The kvm-type machine option was left out when MachineState was introduced, preventing the kvm-type option from being used. Add the missing property. Signed-off-by: Eduardo Habkost Cc: Andreas Färber Cc: Aneesh Kumar K.V Cc: Alexander Graf Cc: Marcel Apfelbaum --- Tested in a x86 machine only.

Re: [Qemu-devel] [PATCH] kvm: Ensure negative return value on kvm_init() error handling path

2014-05-30 Thread Paolo Bonzini
Il 30/05/2014 22:26, Eduardo Habkost ha scritto: We need to ensure ret < 0 when going through the error path, or QEMU may try to run the half-initialized VM and crash. Signed-off-by: Eduardo Habkost --- kvm-all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kvm-all.c

[Qemu-devel] [PATCH] kvm: Ensure negative return value on kvm_init() error handling path

2014-05-30 Thread Eduardo Habkost
We need to ensure ret < 0 when going through the error path, or QEMU may try to run the half-initialized VM and crash. Signed-off-by: Eduardo Habkost --- kvm-all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kvm-all.c b/kvm-all.c index 721a390..4e19eff 100644 --- a/kvm

[Qemu-devel] [PATCH 0/3] tcg patch queue

2014-05-30 Thread Richard Henderson
First two have been posted before; the last is the final conversion from "old" to "new" ldst opcodes. r~ Richard Henderson (3): tcg-i386: Fix win64 qemu store tci: Convert to new ldst opcodes tcg: Remove TCG_TARGET_HAS_new_ldst tcg/aarch64/tcg-target.h | 2 - tcg/arm/tcg-target.h

[Qemu-devel] [PATCH 2/3] tci: Convert to new ldst opcodes

2014-05-30 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c | 76 +--- tcg/tci/tcg-target.h | 2 +- tci.c| 322 --- 3 files changed, 207 insertions(+), 193 deletions(-) diff --git a/tcg/tci/tcg-target.c b/tcg/tci/tcg-target

[Qemu-devel] [PATCH 1/3] tcg-i386: Fix win64 qemu store

2014-05-30 Thread Richard Henderson
The first non-register argument isn't placed at offset 0. Cc: qemu-sta...@nongnu.org Reviewed-by: Stefan Weil Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index d910

[Qemu-devel] [PATCH 3/3] tcg: Remove TCG_TARGET_HAS_new_ldst

2014-05-30 Thread Richard Henderson
Since all backends have been converted, remove the compatibility code. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 2 - tcg/arm/tcg-target.h | 2 - tcg/i386/tcg-target.h| 2 - tcg/ia64/tcg-target.h| 2 - tcg/mips/tcg-target.h| 2 - tcg/optimize.c

[Qemu-devel] [patch 2/3] mc146818rtc: add rtc_reset_reinjection QMP command

2014-05-30 Thread mtosatti
It is necessary to reset RTC interrupt reinjection backlog if guest time is synchronized via a different mechanism, such as QGA's guest-set-time command. Failing to do so causes both corrections to be applied (summed), resulting in an incorrect guest time. Signed-off-by: Marcelo Tosatti Index:

[Qemu-devel] [patch 1/3] generate device configuration file header

2014-05-30 Thread mtosatti
Required to use device CONFIG_ options from C code. To be used by next patch. Signed-off-by: Marcelo Tosatti Index: qemu/Makefile.target === --- qemu.orig/Makefile.target +++ qemu/Makefile.target @@ -37,6 +37,9 @@ STPFILES= config

[Qemu-devel] [patch 0/3] add QMP command to reset rtc interrupt backlog (v2)

2014-05-30 Thread mtosatti
It is necessary to reset RTC interrupt backlog if guest time is synchronized via a different mechanism, such as QGA's guest-set-time command. Failing to do so causes both corrections to be applied (summed), resulting in an incorrect guest time.

[Qemu-devel] [patch 3/3] mc146818rtc: add "rtc" link to "/machines"

2014-05-30 Thread mtosatti
Add a link to rtc under /machines providing a stable location for management apps to query "date" field. {"execute":"qom-get","arguments":{"path":"/machine/rtc","property":"date"} } Suggested by Paolo Bonzini. Signed-off-by: Marcelo Tosatti Index: qemu/hw/timer/mc146818rtc.c =

Re: [Qemu-devel] [PATCH 08/21] target-mips: move PREF, CACHE, LLD and SCD instructions

2014-05-30 Thread Aurelien Jarno
On Fri, May 30, 2014 at 03:47:46PM +0100, Leon Alrae wrote: > The encoding of PREF, CACHE, LLD and SCD instruction changed in MIPS32R6. > Additionally, the hint codes in PREF instruction greater than or > equal to 24 generate Reserved Instruction Exception. > > Signed-off-by: Leon Alrae > --- >

Re: [Qemu-devel] [PATCH 07/21] target-mips: signal RI Exception on DSP and Loongson instructions

2014-05-30 Thread Aurelien Jarno
On Fri, May 30, 2014 at 03:47:45PM +0100, Leon Alrae wrote: > Move DSP and Loongson instruction to *_legacy functions as they have been > removed in R6. > > Signed-off-by: Leon Alrae > --- > target-mips/translate.c | 195 > --- > 1 files changed, 98

Re: [Qemu-devel] [PATCH 06/21] target-mips: split decode_opc_special* into *_r6 and *_legacy

2014-05-30 Thread Aurelien Jarno
On Fri, May 30, 2014 at 03:47:44PM +0100, Leon Alrae wrote: > For better code readability and to avoid 'if' statements for all R6 and preR6 > instructions whose opcodes are the same - decode_opc_special* functions are > split into functions with _r6 and _legacy suffixes. > > *_r6 functions will co

[Qemu-devel] [PATCH 2/3] rng-egd: Free old chr_name value before setting new one

2014-05-30 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- Cc: Anthony Liguori Cc: Amos Kong --- backends/rng-egd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/backends/rng-egd.c b/backends/rng-egd.c index 25bb3b4..2962795 100644 --- a/backends/rng-egd.c +++ b/backends/rng-egd.c @@ -169,6 +169,7 @@ static void

[Qemu-devel] [PATCH 3/3] hw/machine: Free old values of string properties

2014-05-30 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- Cc: Marcel Apfelbaum Cc: Andreas Färber --- hw/core/machine.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index cbba679..df612bb 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -24,6 +24,7 @@ stat

[Qemu-devel] [PATCH 1/3] rng-random: NULL check not needed before g_free()

2014-05-30 Thread Eduardo Habkost
g_free() is NULL-safe. Signed-off-by: Eduardo Habkost --- Cc: Anthony Liguori Cc: Luiz Capitulino --- backends/rng-random.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/backends/rng-random.c b/backends/rng-random.c index 136499d..601d9dc 100644 --- a/backends/rng-ran

[Qemu-devel] [PATCH 0/3] Fix leaks on object_property_add_str() setters

2014-05-30 Thread Eduardo Habkost
Most setters using object_property_add_str() don't free the old values. Change them to free old values before replacing them with new ones. Eduardo Habkost (3): rng-random: NULL check not needed before g_free() rng-egd: Free old chr_name value before setting new one hw/machine: Free old valu

Re: [Qemu-devel] [PATCH V2 4/4] hw/machine: qemu machine opts as properties to QemuMachineState

2014-05-30 Thread Eduardo Habkost
On Mon, May 26, 2014 at 03:40:58PM +0300, Marcel Apfelbaum wrote: > Make machine's QemuOpts QOM properties of machine. The properties > are automatically filled in. This opens the possiblity to create > opts per machine rather than global. > > Signed-off-by: Marcel Apfelbaum > --- > hw/core/mach

Re: [Qemu-devel] [PATCH V2 4/4] hw/machine: qemu machine opts as properties to QemuMachineState

2014-05-30 Thread Eduardo Habkost
On Mon, May 26, 2014 at 03:40:58PM +0300, Marcel Apfelbaum wrote: [...] > +static void machine_initfn(Object *obj) > +{ > +object_property_add_str(obj, "accel", > +machine_get_accel, machine_set_accel, NULL); > +object_property_add_bool(obj, "kernel_irqchip", > +

Re: [Qemu-devel] [PATCH V6 8/8] block: Use graph node name as reference in bdrv_file_open().

2014-05-30 Thread Benoît Canet
The Friday 30 May 2014 à 13:10:56 (-0600), Eric Blake wrote : > On 01/24/2014 07:48 AM, Kevin Wolf wrote: > > Revisiting this: > > >> However, first of all I'd like to hear the opinions of at least Eric and > >>> Max on what BlockRef should really refer to. I think node names make > >>> most sens

Re: [Qemu-devel] [v3 03/12] block: Add overlay BDS pointer into the BlockDriverState struct

2014-05-30 Thread Eric Blake
On 05/30/2014 10:36 AM, Jeff Cody wrote: >> Question - can one bds ever belong to more than one chain? That is, >> could I create a guest that uses: >>/ disk1 >> base < >>\ disk2 >> > While an image itself may be a backing file to more than one overlay > image, QEMU would open th

Re: [Qemu-devel] [PATCH V6 8/8] block: Use graph node name as reference in bdrv_file_open().

2014-05-30 Thread Eric Blake
On 01/24/2014 07:48 AM, Kevin Wolf wrote: Revisiting this: >> However, first of all I'd like to hear the opinions of at least Eric and >>> Max on what BlockRef should really refer to. I think node names make >>> most sense, but perhaps it's a bit inconvenient and the command line >>> should defau

[Qemu-devel] [PATCH v3 07/12] block: Accept node-name arguments for block-commit

2014-05-30 Thread Jeff Cody
This modifies the block operation block-commit so that it will accept node-name arguments for either 'top' or 'base' BDS. The filename and node-name are mutually exclusive to each other; i.e.: "top" and "top-node-name" are mutually exclusive (enforced) "base" and "base-node-name" are mutua

[Qemu-devel] [PATCH v3 08/10] block: Drop superfluous aligning of bdrv_getlength()'s value

2014-05-30 Thread Markus Armbruster
It returns a multiple of the sector size. Signed-off-by: Markus Armbruster Reviewed-by: Max Reitz --- block.c | 1 - block/qcow2.c | 1 - 2 files changed, 2 deletions(-) diff --git a/block.c b/block.c index 8ebfb79..41837b4 100644 --- a/block.c +++ b/block.c @@ -1260,7 +1260,6 @@ void bd

[Qemu-devel] [PATCH v3 01/10] raw-posix: Fix raw_getlength() to always return -errno on error

2014-05-30 Thread Markus Armbruster
We got a merry mix of -1 and -errno here. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- block/raw-posix.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index 6586a0c..9221de5 100644 --- a/bl

[Qemu-devel] [PATCH v3 06/10] block: Use bdrv_nb_sectors() in img_convert()

2014-05-30 Thread Markus Armbruster
Instead of bdrv_getlength(). Replace variable output_length by output_sectors. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- qemu-img.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 1ad899e..8d996ba 100644 --- a/qemu-im

[Qemu-devel] [PATCH v3 00/10] Clean up around bdrv_getlength()

2014-05-30 Thread Markus Armbruster
Issues addressed in this series: * BlockDriver method bdrv_getlength() generally returns -errno, but some implementations return -1 instead. Fix them [PATCH 1]. * Frequent conversions between sectors and bytes complicate the code needlessly. Clean up some [PATCH 2-7]. * bdrv_getlength() al

[Qemu-devel] [PATCH v3 10/12] block: add backing-file option to block-stream

2014-05-30 Thread Jeff Cody
On some image chains, QEMU may not always be able to resolve the filenames properly, when updating the backing file of an image after a block job. For instance, certain relative pathnames may fail, or drives may have been specified originally by file descriptor (e.g. /dev/fd/???), or a relative pr

Re: [Qemu-devel] [PATCH 3/3] block: Drop some superfluous casts from void *

2014-05-30 Thread Max Reitz
On 30.05.2014 18:30, Markus Armbruster wrote: They clutter the code. Unfortunately, I can't figure out how to make Coccinelle drop all of them, so I have to settle for common special cases: @@ type T; T *pt; void *pv; @@ - pt = (T *)pv; + pt = pv; @@

[Qemu-devel] [PATCH v3 05/10] block: Use bdrv_nb_sectors() in bdrv_co_get_block_status()

2014-05-30 Thread Markus Armbruster
Instead of bdrv_getlength(). Replace variables length, length2 by total_sectors, nb_sectors2. Bonus: use total_sectors instead of the slightly unclean bs->total_sectors. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- block.c | 16 1 file changed, 8 insertions(+),

Re: [Qemu-devel] [PATCH 2/3] block: Use g_new() & friends to avoid multiplying sizes

2014-05-30 Thread Max Reitz
On 30.05.2014 18:30, Markus Armbruster wrote: g_new(T, n) is safer than g_malloc(sizeof(*v) * n) for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. Perhaps a conversion to g_malloc_n() would

Re: [Qemu-devel] [PULL 6/8] machine: Make -machine opts properties of MachineState

2014-05-30 Thread Eduardo Habkost
On Wed, May 28, 2014 at 07:29:01PM +0200, Andreas Färber wrote: [...] > +static void machine_initfn(Object *obj) > +{ > +object_property_add_str(obj, "accel", > +machine_get_accel, machine_set_accel, NULL); > +object_property_add_bool(obj, "kernel_irqchip", > +

[Qemu-devel] [PATCH v3 12/12] block: add QAPI command to allow live backing file change

2014-05-30 Thread Jeff Cody
This allows a user to make a live change to the backing file recorded in an open image. The image file to modify can be specified 2 ways: 1) 'device' string, and image filename 2) image node-name Note: this does not cause the backing file itself to be reopened; it merely changes the backing file

[Qemu-devel] [PATCH v3 10/10] block: Avoid bdrv_get_geometry() where errors should be detected

2014-05-30 Thread Markus Armbruster
bdrv_get_geometry() hides errors. Use bdrv_nb_sectors() or bdrv_getlength() instead where that's obviously inappropriate. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- block.c | 11 --- block/qapi.c | 14 ++ qemu-img.c | 59

[Qemu-devel] [PATCH v3 06/12] block: make 'top' argument to block-commit optional

2014-05-30 Thread Jeff Cody
Now that active layer block-commit is supported, the 'top' argument no longer needs to be mandatory. Change it to optional, with the default being the active layer in the device chain. Reviewed-by: Eric Blake Reviewed-by: Benoit Canet Signed-off-by: Jeff Cody --- blockdev.c | 5 +

Re: [Qemu-devel] [PATCH 1/3] block: Use g_new() & friends where that makes obvious sense

2014-05-30 Thread Max Reitz
On 30.05.2014 18:30, Markus Armbruster wrote: g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. Patch created with Cocc

[Qemu-devel] [PATCH v3 03/12] block: Add overlay BDS pointer into the BlockDriverState struct

2014-05-30 Thread Jeff Cody
Now that node-names can reference an individual BlockDriverState without needing to navigate downwards from the 'device' level, in order to find the top-most image (active layer) we need a pointer to the overlay of a BDS. This will allow QMP commands to reference an image solely by its node-name,

[Qemu-devel] [PATCH v3 02/10] block: New bdrv_nb_sectors()

2014-05-30 Thread Markus Armbruster
A call to retrieve the image size converts between bytes and sectors several times: * BlockDriver method bdrv_getlength() returns bytes. * refresh_total_sectors() converts to sectors, rounding up, and stores in total_sectors. * bdrv_getlength() converts total_sectors back to bytes (now rounded

[Qemu-devel] [PATCH v3 09/10] qemu-img: Make img_convert() get image size just once per image

2014-05-30 Thread Markus Armbruster
Chiefly so I don't have to do the error checking in quadruplicate in the next commit. Moreover, replacing the frequently updated bs_sectors by an array assigned just once makes the code easier to understand. Signed-off-by: Markus Armbruster Reviewed-by: Max Reitz --- qemu-img.c | 32 ++

[Qemu-devel] [PATCH v3 03/10] block: Use bdrv_nb_sectors() in bdrv_make_zero()

2014-05-30 Thread Markus Armbruster
Instead of bdrv_getlength(). Variable target_size is initially in bytes, then changes meaning to sectors. Ugh. Replace by target_sectors. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- block.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bloc

[Qemu-devel] [PATCH v3 04/10] block: Use bdrv_nb_sectors() in bdrv_aligned_preadv()

2014-05-30 Thread Markus Armbruster
Instead of bdrv_getlength(). Eliminate variable len. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- block.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block.c b/block.c index 9517108..6639d09 100644 --- a/block.c +++ b/block.c @@ -3081,15 +3081,1

[Qemu-devel] [PATCH v3 07/10] block: Use bdrv_nb_sectors() where sectors, not bytes are wanted

2014-05-30 Thread Markus Armbruster
Instead of bdrv_getlength(). Aside: a few of these callers don't handle errors. I didn't investigate whether they should. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- block-migration.c | 9 - block.c | 3 +-- block/qcow2.c | 2 +- block/vmdk.c | 5 ++

[Qemu-devel] [PATCH v3 08/12] block: extend block-commit to accept a string for the backing file

2014-05-30 Thread Jeff Cody
On some image chains, QEMU may not always be able to resolve the filenames properly, when updating the backing file of an image after a block commit. For instance, certain relative pathnames may fail, or drives may have been specified originally by file descriptor (e.g. /dev/fd/???), or a relative

Re: [Qemu-devel] [PATCH v5 0/3] Quorum maintaince operations

2014-05-30 Thread Max Reitz
On 30.05.2014 13:18, Benoît Canet wrote: These are the last bits required to make quorum usable in production. v5: rebase on latest Stefan's block branch [Kevin] v4: update patchset to stefan's block branch drop Max reviewed by because the series changes Benoît Ca

Re: [Qemu-devel] [PATCH v2 02/10] block: New bdrv_nb_sectors()

2014-05-30 Thread Markus Armbruster
Eric Blake writes: > On 05/28/2014 08:25 AM, Markus Armbruster wrote: >> A call to retrieve the image size converts between bytes and sectors >> several times: >> >> * BlockDriver method bdrv_getlength() returns bytes. >> >> * refresh_total_sectors() converts to sectors, rounding up, and stores

Re: [Qemu-devel] [PATCH v5 3/3] qemu-iotests: Add 096 new test for drive-mirror-replace.

2014-05-30 Thread Max Reitz
On 30.05.2014 13:18, Benoît Canet wrote: Tests for drive-mirror-replace whose purpose is to enable quorum file mirroring and replacement after failure. Signed-off-by: Benoit Canet --- tests/qemu-iotests/041| 34 +-- tests/qemu-iotests/096| 222 +++

Re: [Qemu-devel] [PATCH v3 03/12] block: Add overlay BDS pointer into the BlockDriverState struct

2014-05-30 Thread Eric Blake
On 05/30/2014 11:35 AM, Jeff Cody wrote: > Now that node-names can reference an individual BlockDriverState without > needing to navigate downwards from the 'device' level, in order to find > the top-most image (active layer) we need a pointer to the overlay of a > BDS. > > This will allow QMP com

Re: [Qemu-devel] [PATCH v5 2/3] block: Add drive-mirror-replace command

2014-05-30 Thread Max Reitz
On 30.05.2014 13:18, Benoît Canet wrote: When a quorum file is totally destroyed (broken NAS or SAN) the user can start a drive-mirror job on the quorum block backend and then replace the broken quorum file with drive-mirror-replace given it has a node-name. Signed-off-by: Benoit Canet --- bl

[Qemu-devel] [PATCH v3 11/12] block: Add QMP documentation for block-stream

2014-05-30 Thread Jeff Cody
The QMP command 'block-stream' was missing QMP documentation. Add that documentation. Signed-off-by: Jeff Cody --- qmp-commands.hx | 58 + 1 file changed, 58 insertions(+) diff --git a/qmp-commands.hx b/qmp-commands.hx index a1c88d1..f4a2

[Qemu-devel] [PATCH v3 09/12] block: add ability for block-stream to use node-name

2014-05-30 Thread Jeff Cody
This adds the ability for block-stream to use node-name arguments for base, to specify the backing image to stream from. Both 'base' and 'base-node-name' are optional, but mutually exclusive. Either can be specified, but not both together. The argument for "device" is now optional as well, so lon

[Qemu-devel] [PATCH v3 01/12] block: Auto-generate node_names for each BDS entry

2014-05-30 Thread Jeff Cody
Currently, node_name is only filled in when done so explicitly by the user. If no node_name is specified, then the node name field is not populated. If node_names are automatically generated when not specified, that means that all block job operations can be done by reference to the unique node_n

[Qemu-devel] [PATCH v3 04/12] block: add helper function to find the active layer of any BDS

2014-05-30 Thread Jeff Cody
This helper function will find the active (top-most) layer of a specified BDS. This returns either the active layer, or NULL if the passed BDS is NULL. Reviewed-by: Eric Blake Signed-off-by: Jeff Cody --- block.c | 10 ++ include/block/block.h | 1 + 2 files changed, 11

[Qemu-devel] [PATCH v3 02/12] block: add helper function to determine if a BDS is in a chain

2014-05-30 Thread Jeff Cody
This is a small helper function, to determine if 'base' is in the chain of BlockDriverState 'top'. It returns true if it is in the chain, and false otherwise. If either argument is NULL, it will also return false. Reviewed-by: Benoit Canet Reviewed-by: Eric Blake Signed-off-by: Jeff Cody ---

[Qemu-devel] [PATCH v3 05/12] block: simplify bdrv_find_base()

2014-05-30 Thread Jeff Cody
This simplifies the function bdrv_find_base(), while keeping the same functionality. Reviewed-by: Eric Blake Signed-off-by: Jeff Cody --- block.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/block.c b/block.c index 7eb3279..96b90d9 100644 --- a/block.c +

[Qemu-devel] [PATCH v3 00/12] Modify block jobs to use node-names

2014-05-30 Thread Jeff Cody
Note: this is a resend - forgot "PATCH" in the subject in the last mailing. This is v3 of "block: Modify block-commit to use node-names". Changes: * Add Eric's reviewed-by * Addressed Eric's review comments * Dropped HMP changes * Added helper function for setting the overlay, and set t

Re: [Qemu-devel] [v3 00/12] Modify block jobs to use node-names

2014-05-30 Thread Jeff Cody
On Fri, May 30, 2014 at 11:35:02AM -0400, Jeff Cody wrote: > This is v3 of "block: Modify block-commit to use node-names". > Forgot the "PATCH" in the email subject... resending with the right subject, still v3. Sorry.

Re: [Qemu-devel] [PATCH 13/21] target-mips: add Compact Branches

2014-05-30 Thread Richard Henderson
On 05/30/2014 07:47 AM, Leon Alrae wrote: > +switch (opc) { > +case OPC_BLEZALC: /* OPC_BGEZALC, OPC_BGEUC */ > +if (rs == 0 && rt != 0) { > +/* OPC_BLEZALC */ > +tcg_gen_setcondi_tl(TCG_COND_LE, bcond, t1, 0); > +} else if (rs

[Qemu-devel] [PATCH] target-arm: set SBOP/SBZP bits of SCTLR

2014-05-30 Thread Fabian Aggeler
ARM ARM v7 specifies SBOP/SBZP bits for v5/v6/v7. This patch sets these bits on every sctlr_write(). In ARMv8 most of them are RES0/RES1. Signed-off-by: Fabian Aggeler --- Previously part of TZ patchset but now includes handling for SBOP/SBZP bits in ARMv5/v6/v7. Not sure whether using the SCTLR_

Re: [Qemu-devel] [PATCH 11/21] target-mips: Status.UX/SX/KX enable 32-bit address wrapping

2014-05-30 Thread Richard Henderson
On 05/30/2014 07:47 AM, Leon Alrae wrote: > -if (env->CP0_Status & (1 << CP0St_UX)) { > -env->hflags |= MIPS_HFLAG_UX; > + > +if env->hflags & MIPS_HFLAG_KSU) == MIPS_HFLAG_UM) && > + (env->CP0_Status & (1 << CP0St_UX))) || > +(((env->hflags & MIPS_HFLAG_KSU) ==

Re: [Qemu-devel] [PATCH 09/21] target-mips: redefine Integer Multiply and Divide instructions

2014-05-30 Thread Richard Henderson
On 05/30/2014 07:47 AM, Leon Alrae wrote: > +case R6_OPC_MUL: > +{ > +TCGv_i32 t2 = tcg_temp_new_i32(); > +TCGv_i32 t3 = tcg_temp_new_i32(); > +tcg_gen_trunc_tl_i32(t2, t0); > +tcg_gen_trunc_tl_i32(t3, t1); > +tcg_gen_muls2_i32

Re: [Qemu-devel] [PATCH v1 14/16] target-arm: A64: Emulate the SMC insn

2014-05-30 Thread Greg Bellows
On 30 May 2014 02:28, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Signed-off-by: Edgar E. Iglesias > --- > target-arm/cpu.h | 1 + > target-arm/helper-a64.c| 1 + > target-arm/helper.c| 6 ++ > target-arm/helper.h| 1 + > target-arm/internals.

Re: [Qemu-devel] [PATCH 03/21] target-mips: add SELEQZ and SELNEZ instructions

2014-05-30 Thread Richard Henderson
On 05/30/2014 07:47 AM, Leon Alrae wrote: > +case OPC_SELNEZ: > +tcg_gen_movcond_tl(TCG_COND_EQ, cpu_gpr[rd], t0, t1, t1, t2); > +opn = "selnez"; > +break; I find it easier to reason about these things with conditions that match the instruction. For instance, SELNEZ is

Re: [Qemu-devel] [PATCH 04/21] target-mips: move LL and SC instructions

2014-05-30 Thread Aurelien Jarno
On Fri, May 30, 2014 at 03:47:42PM +0100, Leon Alrae wrote: > The encoding of LL and SC instruction has changed in MIPS32 Release 6. > > Signed-off-by: Leon Alrae > --- > disas/mips.c|9 - > target-mips/translate.c | 29 +++-- > 2 files changed,

Re: [Qemu-devel] [PATCH 03/21] target-mips: add SELEQZ and SELNEZ instructions

2014-05-30 Thread Aurelien Jarno
On Fri, May 30, 2014 at 03:47:41PM +0100, Leon Alrae wrote: > Signed-off-by: Leon Alrae > --- > disas/mips.c|8 > target-mips/translate.c | 16 > 2 files changed, 24 insertions(+), 0 deletions(-) > > diff --git a/disas/mips.c b/disas/mips.c > index 210

Re: [Qemu-devel] [PATCH v2 10/20] qcow1: Handle failure for potentially large allocations

2014-05-30 Thread Kevin Wolf
Am 30.05.2014 um 14:43 hat Benoît Canet geschrieben: > The Wednesday 28 May 2014 à 16:37:43 (+0200), Kevin Wolf wrote : > > Some code in the block layer makes potentially huge allocations. Failure > > is not completely unexpected there, so avoid aborting qemu and handle > > out-of-memory situations

Re: [Qemu-devel] [PATCH 02/21] target-mips: signal RI Exception on instructions removed in R6

2014-05-30 Thread Aurelien Jarno
On Fri, May 30, 2014 at 03:47:40PM +0100, Leon Alrae wrote: > Signal Reserved Instruction Exception on instructions that do not exist in R6. > In this commit the following groups of preR6 instructions are marked as > deleted: > - Floating Point Paired Single > - Floating Point Compare > - conditio

Re: [Qemu-devel] [PATCH 01/21] target-mips: introduce MIPS64R6 ISA and a new generic CPU

2014-05-30 Thread Aurelien Jarno
On Fri, May 30, 2014 at 03:47:39PM +0100, Leon Alrae wrote: > Define ISA_MIPS64R6 and add MIPS64R6-generic core supporting new ISA. > Additionally define ISA_MIPS64R3 and ISA_MIPS64R5 to fill the gap. > > Signed-off-by: Leon Alrae > --- > target-mips/mips-defs.h | 28 +++--

Re: [Qemu-devel] [v3 03/12] block: Add overlay BDS pointer into the BlockDriverState struct

2014-05-30 Thread Jeff Cody
On Fri, May 30, 2014 at 10:00:09AM -0600, Eric Blake wrote: > On 05/30/2014 09:35 AM, Jeff Cody wrote: > > Now that node-names can reference an individual BlockDriverState without > > needing to navigate downwards from the 'device' level, in order to find > > the top-most image (active layer) we ne

  1   2   3   4   >