[Qemu-devel] [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 ebl...@redhat.com Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 10 ++

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 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 need a pointer to the overlay of a BDS. This will allow QMP commands

Re: [Qemu-devel] [RFC 4/5] qmp: add query-acpi-ospm-status command

2014-05-30 Thread Eric Blake
On 05/30/2014 09:45 AM, Igor Mammedov wrote: +- { execute: query-acpi-ospm-status } +- { 'return': [ { 'device': 'd1', 'slot': 0, 'source': 1, 'status': 0}, Should 'status' be represented as an enum type, rather than an open-coded integer? it takes values from ACPI spec, which potentially

Re: [Qemu-devel] [Xen-devel] [RFC PATCH 0/2] support xen HVM direct kernel boot

2014-05-30 Thread Konrad Rzeszutek Wilk
On Thu, May 29, 2014 at 11:23:22AM +0800, Chunyan Liu wrote: Following previous discussion: https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg03843.html I spent lot of time to understand xen xc_hvm_build, hvmloader code, and qemu pc_memory_init, xen_ram_init code, and wrote

[Qemu-devel] [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 ben...@irqsave.net Reviewed-by: Eric Blake

Re: [Qemu-devel] [Xen-devel] [v4][PATCH 2/5] xen, gfx passthrough: create intel isa bridge

2014-05-30 Thread Konrad Rzeszutek Wilk
On Fri, May 30, 2014 at 04:59:26PM +0800, Tiejun Chen wrote: ISA bridge is needed since Intel gfx drive will probe it instead of Dev31:Fun0 to make graphics device passthrough work easy for VMM, that only need to expose ISA bridge to let driver know the real hardware underneath. The

Re: [Qemu-devel] [Xen-devel] [v4][PATCH 1/5] xen, gfx passthrough: basic graphics passthrough support

2014-05-30 Thread Konrad Rzeszutek Wilk
On Fri, May 30, 2014 at 04:59:25PM +0800, Tiejun Chen wrote: basic gfx passthrough support: - add a vga type for gfx passthrough - retrieve VGA bios from sysfs, then load it to guest at 0xC - register/unregister legacy VGA I/O ports and MMIOs for passthrough GFX The original patch is

Re: [Qemu-devel] [Xen-devel] [v4][PATCH 4/5] xen, gfx passthrough: create host bridge to passthrough

2014-05-30 Thread Konrad Rzeszutek Wilk
On Fri, May 30, 2014 at 04:59:28PM +0800, Tiejun Chen wrote: Implement that pci host bridge to specific to passthrough. Actually this just inherit the standard one. Signed-off-by: Tiejun Chen tiejun.c...@intel.com Reviewed-by: Konrad Rzeszutek Wilk konrad.w...@oracle.com --- v4: * Fix

Re: [Qemu-devel] [Xen-devel] [v4][PATCH 3/5] xen, gfx passthrough: support Intel IGD passthrough with VT-D

2014-05-30 Thread Konrad Rzeszutek Wilk
On Fri, May 30, 2014 at 04:59:27PM +0800, Tiejun Chen wrote: Some registers of Intel IGD are mapped in host bridge, so it needs to passthrough these registers of physical host bridge to guest because emulated host bridge in guest doesn't have these mappings. The original patch is from

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

2014-05-30 Thread Kevin Wolf
Am 30.05.2014 um 14:08 hat Benoît Canet geschrieben: The Wednesday 28 May 2014 à 16:37:35 (+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] [Xen-devel] [v4][PATCH 5/5] xen, gfx passthrough: add opregion mapping

2014-05-30 Thread Konrad Rzeszutek Wilk
On Fri, May 30, 2014 at 04:59:29PM +0800, Tiejun Chen wrote: The OpRegion shouldn't be mapped 1:1 because the address in the host can't be used in the guest directly. This patch traps read and write access to the opregion of the Intel GPU config space (offset 0xfc). The original patch is

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

2014-05-30 Thread Max Reitz
On 30.05.2014 08:56, Markus Armbruster wrote: Max Reitz mre...@redhat.com writes: On 28.05.2014 16:25, Markus Armbruster wrote: 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

Re: [Qemu-devel] Question about gen_jmp_tb

2014-05-30 Thread Richard Henderson
On 05/30/2014 01:56 AM, Jack Biggs wrote: Hi all, I'm trying to add some arbitrary code to the end of each translation block, and I wanted to confirm my suspicion that each translation block ends in a jmp instruction, and that each translation block ends (or jumps to another TB) with

Re: [Qemu-devel] [PATCH 1/2] qcow2: Fix memory leak in copy_sectors()

2014-05-30 Thread Max Reitz
On 30.05.2014 13:40, Kevin Wolf wrote: Am 29.05.2014 um 00:19 hat Max Reitz geschrieben: If bs-drv is NULL, iov.iov_base should not be leaked. Signed-off-by: Max Reitz mre...@redhat.com Funny how such things go unnoticed for months and then three people fix it independently in the same week.

[Qemu-devel] [PATCH 0/3] block: Use g_new() friends more

2014-05-30 Thread Markus Armbruster
This series is on top of Kevin's block: Handle failure for potentially large allocations. PATCH 1+2 convert some allocations. While preparing them, I stumbled over some useless casts, which led to PATCH 3. I posted a tree-wide version of PATCH 1 some time ago, and was told to split it up. This

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

2014-05-30 Thread Markus Armbruster
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 be neater in places, especially where we do v

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

2014-05-30 Thread Markus Armbruster
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; @@ type T; @@ - (T *)

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

2014-05-30 Thread Markus Armbruster
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 Coccinelle, with two manual changes on top: * Add

Re: [Qemu-devel] [PATCH 2/2] qcow2: Return useful error code in refcount_init()

2014-05-30 Thread Kevin Wolf
Am 29.05.2014 um 00:19 hat Max Reitz geschrieben: If bdrv_pread() returns an error, it is very unlikely that it was ENOMEM. In this case, the return value should be passed along; as bdrv_pread() will always either return the number of bytes read or a negative value (the error code), the

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 need a

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 leon.al...@imgtec.com --- target-mips/mips-defs.h | 28

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 - conditional

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 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 leon.al...@imgtec.com --- disas/mips.c|8 target-mips/translate.c | 16 2 files changed, 24 insertions(+), 0 deletions(-) diff --git a/disas/mips.c

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 leon.al...@imgtec.com --- disas/mips.c|9 - target-mips/translate.c | 29 +++-- 2

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 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 edgar.igles...@gmail.com wrote: From: Edgar E. Iglesias edgar.igles...@xilinx.com Signed-off-by: Edgar E. Iglesias edgar.igles...@xilinx.com --- target-arm/cpu.h | 1 + target-arm/helper-a64.c| 1 + target-arm/helper.c| 6

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(t2,

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) == MIPS_HFLAG_SM) +

[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 aggel...@ethz.ch --- Previously part of TZ patchset but now includes handling for SBOP/SBZP bits in ARMv5/v6/v7. Not sure whether

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 != 0

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.

[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 the

[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 ebl...@redhat.com Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/block.c b/block.c index

[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 ben...@irqsave.net Reviewed-by: Eric Blake

[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 ebl...@redhat.com Signed-off-by: Jeff Cody jc...@redhat.com --- block.c | 10 ++

[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

[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 long

[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 jc...@redhat.com --- qmp-commands.hx | 58 + 1 file changed, 58 insertions(+) diff --git a/qmp-commands.hx b/qmp-commands.hx

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

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 commands

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 ben...@irqsave.net --- tests/qemu-iotests/041| 34 +-- tests/qemu-iotests/096| 222

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

2014-05-30 Thread Markus Armbruster
Eric Blake ebl...@redhat.com 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

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

[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

[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 arm...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block-migration.c | 9 - block.c | 3 +-- block/qcow2.c

[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 arm...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block.c | 12 +--- 1 file changed, 5

[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 arm...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block.c b/block.c index 9517108..6639d09 100644 ---

[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 arm...@redhat.com Reviewed-by: Max Reitz

[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

[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,

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

[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 ebl...@redhat.com Reviewed-by: Benoit Canet ben...@irqsave.net Signed-off-by: Jeff Cody

[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 arm...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com --- block.c | 11 ---

[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

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, +

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()

[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 arm...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block.c | 16

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 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

[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()

[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 arm...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- qemu-img.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index

[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 arm...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/raw-posix.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c

[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 arm...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com --- 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 +++

[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 mutually

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 default to

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 that as 2

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 sense, but perhaps

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 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 marce...@redhat.com ---

[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

[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 ehabk...@redhat.com --- Cc: Anthony Liguori aligu...@amazon.com Cc: Luiz Capitulino lcapitul...@redhat.com --- backends/rng-random.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/backends/rng-random.c

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

2014-05-30 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost ehabk...@redhat.com --- Cc: Marcel Apfelbaum marce...@redhat.com Cc: Andreas Färber afaer...@suse.de --- 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 ---

[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 ehabk...@redhat.com --- Cc: Anthony Liguori aligu...@amazon.com Cc: Amos Kong ak...@redhat.com --- 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

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

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 leon.al...@imgtec.com --- target-mips/translate.c | 195 --- 1

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

[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 mtosa...@redhat.com Index: qemu/hw/timer/mc146818rtc.c

[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 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 mtosa...@redhat.com Index: qemu/Makefile.target === --- qemu.orig/Makefile.target +++ qemu/Makefile.target @@ -37,6 +37,9

[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

[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 r...@twiddle.net --- 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 -

[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 s...@weilnetz.de Signed-off-by: Richard Henderson r...@twiddle.net --- tcg/i386/tcg-target.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcg/i386/tcg-target.c

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

2014-05-30 Thread Richard Henderson
Signed-off-by: Richard Henderson r...@twiddle.net --- 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

[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] 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 ehabk...@redhat.com --- kvm-all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kvm-all.c b/kvm-all.c index

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 ehabk...@redhat.com --- kvm-all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[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 ehabk...@redhat.com Cc: Andreas Färber afaer...@suse.de Cc: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Cc:

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

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 MachineState {

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. The

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 ehabk...@redhat.com: 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 ---

[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 ag...@suse.de Cc: qemu-...@nongnu.org Cc: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Marcel Apfelbaum marce...@redhat.com Cc: Andreas Färber

[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 ehabk...@redhat.com --- Changes v1 - v2: * Add property only to the

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

2014-05-30 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost ehabk...@redhat.com --- 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)

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 file

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 jc...@redhat.com --- qmp-commands.hx | 58 + 1 file changed, 58 insertions(+)

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 r...@twiddle.net --- tcg/tci/tcg-target.c | 76 +--- tcg/tci/tcg-target.h | 2 +- tci.c| 322 --- 3 files changed, 207 insertions(+),

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 file itself

[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

<    1   2   3   4   >