Re: [Qemu-devel] [PATCH] Add -semihosting-config ....cmdline=string.

2014-11-20 Thread Liviu Ionescu
On 20 Nov 2014, at 15:31, Peter Maydell peter.mayd...@linaro.org wrote: I think you can avoid having to plumb the command line string into the MachineState and arm_boot_info structures, because you can just have the semihosting code look the option up by name: QemuOpts *opts =

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 v3 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen

2014-11-20 Thread Don Slutz
On 11/19/14 19:58, Eduardo Habkost wrote: On Wed, Nov 19, 2014 at 07:38:10PM -0500, Don Slutz wrote: [...] @@ -234,9 +235,33 @@ static void pc_init1(MachineState *machine, pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL); +if (xen_enabled()) { +switch

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 v3 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen

2014-11-20 Thread Don Slutz
On 11/20/14 01:04, Paolo Bonzini wrote: On 20/11/2014 01:58, Eduardo Habkost wrote: if (pc_machine-vmport == VMPORT_AUTO) { no_vmport = xen_enabled(); } else { no_vmport = (pc_machine-vmport == VMPORT_ON); } I'm still not sure why the configuration should

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 1/1] hw/i386/pc_piix.c: Also pass vmport=off for xenfv machine

2014-11-20 Thread Don Slutz
On 11/20/14 01:02, Paolo Bonzini wrote: On 19/11/2014 20:08, Don Slutz wrote: -M pc -machine accel=xen pcms-vmport is false I think this should be true. Any reason why not? Paolo Yes, QEMU will crash if xen is enabled and the guest tries to access the VMware port. (more on

Re: [Qemu-devel] [PATCH] Add -semihosting-config ....cmdline=string.

2014-11-20 Thread Peter Maydell
On 20 November 2014 15:03, Liviu Ionescu i...@livius.net wrote: On 20 Nov 2014, at 15:31, Peter Maydell peter.mayd...@linaro.org wrote: I think you can avoid having to plumb the command line string into the MachineState and arm_boot_info structures, because you can just have the semihosting

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 v3 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen

2014-11-20 Thread Paolo Bonzini
On 20/11/2014 16:07, Don Slutz wrote: The key reason is that with current xen, if vmport is enabled QEMU will crash: Thanks, that helps understanding the patch. :) Paolo

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 1/1] hw/i386/pc_piix.c: Also pass vmport=off for xenfv machine

2014-11-20 Thread Eduardo Habkost
On Wed, Nov 19, 2014 at 02:08:08PM -0500, Don Slutz wrote: On 11/19/14 13:08, Paolo Bonzini wrote: On 19/11/2014 19:07, Don Slutz wrote: -M pc -machine accel=xen should work and, if that's what you want, disable the vmport device. I think this patch is wrong. Paolo Well, I also want

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 v3 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen

2014-11-20 Thread Don Slutz
On 11/20/14 04:13, Michael S. Tsirkin wrote: On Wed, Nov 19, 2014 at 09:11:41PM -0700, Eric Blake wrote: On 11/19/2014 05:38 PM, Don Slutz wrote: c/s 9b23cfb76b3a5e9eb5cc899eaf2f46bc46d33ba4 or c/s b154537ad07598377ebf98252fb7d2aff127983b moved the testing of xen_enabled() from pc_init1()

Re: [Qemu-devel] [PATCH] Add -semihosting-config ....cmdline=string.

2014-11-20 Thread Liviu Ionescu
On 20 Nov 2014, at 17:10, Peter Maydell peter.mayd...@linaro.org wrote: something is missing with the way options are handled, this call fails with BAD_ACCESS. What's this? It's not an error code in QEMU... no, it is a system condition, EXC_BAD_ACCESS, generally caused by a bad pointer.

Re: [Qemu-devel] [PATCH v2] Add the -semihosting-config option.

2014-11-20 Thread Peter Maydell
On 19 November 2014 10:31, Peter Maydell peter.mayd...@linaro.org wrote: On 18 November 2014 20:19, Liviu Ionescu i...@livius.net wrote: The usual semihosting behaviour is to process the system calls locally and return; unfortuantelly the initial implementation dinamically changed the target

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 1/1] hw/i386/pc_piix.c: Also pass vmport=off for xenfv machine

2014-11-20 Thread Don Slutz
On 11/20/14 10:13, Eduardo Habkost wrote: On Wed, Nov 19, 2014 at 02:08:08PM -0500, Don Slutz wrote: On 11/19/14 13:08, Paolo Bonzini wrote: On 19/11/2014 19:07, Don Slutz wrote: -M pc -machine accel=xen should work and, if that's what you want, disable the vmport device. I think this patch

[Qemu-devel] [PATCH v3 0/9] raw: Prohibit dangerous writes for probed images

2014-11-20 Thread Kevin Wolf
See the commit message of patch 7 for the why and how. This series will probably be only part of the solution and doesn't mean that we should stop looking for other patches which improve different parts of the problem. See the mailing list thread Image probing: how it can be insecure, and what we

Re: [Qemu-devel] [PATCH] hw/arm/realview.c: Fix memory leak in realview_init()

2014-11-20 Thread Markus Armbruster
Nikita Belov zod...@ispras.ru writes: Variable 'ram_lo' is allocated unconditionally, but used only in some cases. When it is unused pointer will be lost at function exit, resulting in a memory leak. Free memory in this case. Valgrind output: ==16879== 240 bytes in 1 blocks are definitely

[Qemu-devel] [PATCH v3 5/9] block: Factor bdrv_probe_all() out of find_image_format()

2014-11-20 Thread Kevin Wolf
From: Markus Armbruster arm...@redhat.com Signed-off-by: Markus Armbruster arm...@redhat.com Signed-off-by: Kevin Wolf kw...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com --- block.c | 48 +++- 1

[Qemu-devel] [PATCH v3 4/9] qtests: Specify image format explicitly

2014-11-20 Thread Kevin Wolf
Signed-off-by: Kevin Wolf kw...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com --- tests/ahci-test.c | 3 ++- tests/bios-tables-test.c | 2 +- tests/drive_del-test.c| 2 +- tests/fdc-test.c | 2 +- tests/hd-geo-test.c

[Qemu-devel] [PATCH v3 1/9] qemu-io: Allow explicitly specifying format

2014-11-20 Thread Kevin Wolf
This adds a -f option to qemu-io which allows to explicitly specify the block driver to use for the given image. Signed-off-by: Kevin Wolf kw...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com ---

[Qemu-devel] [PATCH v3 7/9] raw: Prohibit dangerous writes for probed images

2014-11-20 Thread Kevin Wolf
If the user neglects to specify the image format, QEMU probes the image to guess it automatically, for convenience. Relying on format probing is insecure for raw images (CVE-2008-2004). If the guest writes a suitable header to the device, the next probe will recognize a format chosen by the

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 1/1] hw/i386/pc_piix.c: Also pass vmport=off for xenfv machine

2014-11-20 Thread Eduardo Habkost
On Thu, Nov 20, 2014 at 10:24:15AM -0500, Don Slutz wrote: [...] -M pc-2.1 -machine accel=xen pcms-vmport is true ** [...] I believe there's no consensus yet about the one marked with ** above. It boils to the question: do we need to keep guest ABI stability when using -M pc-2.1

[Qemu-devel] [PATCH v3 2/9] qemu-iotests: Use qemu-io -f $IMGFMT

2014-11-20 Thread Kevin Wolf
This patch changes $QEMU_IO so that all tests by default pass a format argument to qemu-io. There are a few cases where -f $IMGFMT is not wanted because it selects the wrong driver or json: filenames including a driver are used. They are changed to use $QEMU_IO_PROG, which doesn't include any

[Qemu-devel] [PATCH v3 9/9] qemu-iotests: Test writing non-raw image headers to raw image

2014-11-20 Thread Kevin Wolf
This is forbidden if the raw driver was probed. Signed-off-by: Kevin Wolf kw...@redhat.com --- tests/qemu-iotests/109| 132 + tests/qemu-iotests/109.out| 231 ++ tests/qemu-iotests/group

[Qemu-devel] [PATCH v3 3/9] qemu-iotests: Add qemu-io format option in Python tests

2014-11-20 Thread Kevin Wolf
Signed-off-by: Kevin Wolf kw...@redhat.com Reviewed-by: Stefan Hajnoczi stefa...@redhat.com Reviewed-by: Max Reitz mre...@redhat.com --- tests/qemu-iotests/030 | 22 +++--- tests/qemu-iotests/040 | 32 tests/qemu-iotests/055 | 18 +-

[Qemu-devel] [PATCH v3 8/9] qemu-iotests: Fix stderr handling in common.qemu

2014-11-20 Thread Kevin Wolf
The original intention was to pipe stderr of qemu into $fifo_out. However, the redirections were specified in the wrong order for this. This patch fixes it. Now qemu's output on stderr can be retrieved with _send_qemu_cmd, which applies several useful filters on the output that were missing

[Qemu-devel] [PATCH v3 6/9] block: Read only one sector for format probing

2014-11-20 Thread Kevin Wolf
The only image format driver that even potentially accesses anything after 512 bytes in its bdrv_probe() implementation is VMDK, which reads a plain-text descriptor file. In practice, the field it's looking for seems to come first and will be well within the first 512 bytes, too. Signed-off-by:

Re: [Qemu-devel] [PATCH v2] Add the -semihosting-config option.

2014-11-20 Thread Liviu Ionescu
On 20 Nov 2014, at 17:22, Peter Maydell peter.mayd...@linaro.org wrote: ... I had to move the declaration and definition of semihosting_target to gdbstub.h and gdbstub.c, because otherwise the linux-user targets won't compile. (They don't compile vl.c.) :-( please let me know when the

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 v3 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen

2014-11-20 Thread Eduardo Habkost
On Thu, Nov 20, 2014 at 10:16:37AM -0500, Don Slutz wrote: On 11/20/14 04:13, Michael S. Tsirkin wrote: On Wed, Nov 19, 2014 at 09:11:41PM -0700, Eric Blake wrote: [...] +{ 'enum': 'vmport', All other enums in .json files are named in StudlyCaps. Please name this starting with a capital

Re: [Qemu-devel] [PATCH v2] Add the -semihosting-config option.

2014-11-20 Thread Peter Maydell
On 20 November 2014 15:35, Liviu Ionescu i...@livius.net wrote: On 20 Nov 2014, at 17:22, Peter Maydell peter.mayd...@linaro.org wrote: ... I had to move the declaration and definition of semihosting_target to gdbstub.h and gdbstub.c, because otherwise the linux-user targets won't compile.

Re: [Qemu-devel] [PATCH] Add -semihosting-config ....cmdline=string.

2014-11-20 Thread Peter Maydell
On 20 November 2014 15:17, Liviu Ionescu i...@livius.net wrote: On 20 Nov 2014, at 17:10, Peter Maydell peter.mayd...@linaro.org wrote: something is missing with the way options are handled, this call fails with BAD_ACCESS. What's this? It's not an error code in QEMU... no, it is a

[Qemu-devel] Query about changed implementation of memory_region_init

2014-11-20 Thread Gaurav Sharma
Hi, After trying to re-base I see that the code implementation of memory_region_init has been changed. Initially it used to just set the various fields to some default value. Now, it is trying to do a object initialize on the MemoryRegion object. 1. Where does this initialization happen in the

[Qemu-devel] [PATCH] linux-user: Use the 5KEf processor for 64-bit emulation

2014-11-20 Thread Maciej W. Rozycki
Replace the 20Kc original MIPS64 ISA processor used for 64-bit user emulation with the 5KEf processor that implements the MIPS64r2 ISA, complementing the choice of the 24Kf processor for 32-bit emulation. Signed-off-by: Maciej W. Rozycki ma...@codesourcery.com --- Hi, For user emulation mode I

Re: [Qemu-devel] How to access guest memory from qemu device internal

2014-11-20 Thread Greg Kurz
On Thu, 20 Nov 2014 21:25:18 +0800 (GMT+08:00) Kaiyuan kaiyu...@tju.edu.cn wrote: Hello, all I added a custom device to qemu. This device is attached to sysbus by mmio and has an address register in which device should access the guest memory the register point to. I write a bare-metal

Re: [Qemu-devel] [PATCH v3 9/9] qemu-iotests: Test writing non-raw image headers to raw image

2014-11-20 Thread Max Reitz
On 2014-11-20 at 16:27, Kevin Wolf wrote: This is forbidden if the raw driver was probed. Signed-off-by: Kevin Wolf kw...@redhat.com --- tests/qemu-iotests/109| 132 + tests/qemu-iotests/109.out| 231 ++

Re: [Qemu-devel] [PATCH] geometry: fix i386 compilation

2014-11-20 Thread Kevin Wolf
Am 19.11.2014 um 16:04 hat Cornelia Huck geschrieben: On Wed, 19 Nov 2014 14:40:07 + Peter Maydell peter.mayd...@linaro.org wrote: On 19 November 2014 14:01, Ekaterina Tumanova tuman...@linux.vnet.ibm.com wrote: Signed-off-by: Ekaterina Tumanova tuman...@linux.vnet.ibm.com

Re: [Qemu-devel] [PATCH v3 9/9] qemu-iotests: Test writing non-raw image headers to raw image

2014-11-20 Thread Kevin Wolf
Am 20.11.2014 um 17:18 hat Max Reitz geschrieben: On 2014-11-20 at 16:27, Kevin Wolf wrote: This is forbidden if the raw driver was probed. Signed-off-by: Kevin Wolf kw...@redhat.com --- tests/qemu-iotests/109| 132 + tests/qemu-iotests/109.out

Re: [Qemu-devel] [PATCH] geometry: fix i386 compilation

2014-11-20 Thread Christian Borntraeger
Am 20.11.2014 um 17:18 schrieb Kevin Wolf: Am 19.11.2014 um 16:04 hat Cornelia Huck geschrieben: On Wed, 19 Nov 2014 14:40:07 + Peter Maydell peter.mayd...@linaro.org wrote: On 19 November 2014 14:01, Ekaterina Tumanova tuman...@linux.vnet.ibm.com wrote: Signed-off-by: Ekaterina

Re: [Qemu-devel] [PATCH] linux-user: Use the 5KEf processor for 64-bit emulation

2014-11-20 Thread Peter Maydell
On 20 November 2014 16:00, Maciej W. Rozycki ma...@codesourcery.com wrote: Replace the 20Kc original MIPS64 ISA processor used for 64-bit user emulation with the 5KEf processor that implements the MIPS64r2 ISA, complementing the choice of the 24Kf processor for 32-bit emulation.

[Qemu-devel] [PATCH v2] Add -semihosting-config ....cmdline=string.

2014-11-20 Thread Liviu Ionescu
A new sub-option was added to -semihosting-config to define the entire semihosting command line (cmdline=string). This string is passed down to armv7m.c; if not defined, for compatibility reasons, the -kernel -append values are used. The armv7m_init() and stellaris_init() interfaces were

Re: [Qemu-devel] [PATCH] Add -semihosting-config ....cmdline=string.

2014-11-20 Thread Liviu Ionescu
On 20 Nov 2014, at 17:39, Peter Maydell peter.mayd...@linaro.org wrote: NB: you'll want to stick this inside the !CONFIG_USER_ONLY did this. now it works for me, but please check if it compiles properly for other targets. regards, Liviu

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 v3 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen

2014-11-20 Thread Don Slutz
On 11/20/14 06:00, Paolo Bonzini wrote: On 20/11/2014 11:00, Dr. David Alan Gilbert wrote: I'm still not sure why the configuration should differ for -M pc depending on whether xen is enabled. I think this goes back to: commit 1611977c3d8fdbdac6090cbd1fcee4aed6d9 Author: Anthony PERARD

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 v3 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen

2014-11-20 Thread Eric Blake
On 11/20/2014 01:44 AM, Michael S. Tsirkin wrote: On Wed, Nov 19, 2014 at 07:38:10PM -0500, Don Slutz wrote: c/s 9b23cfb76b3a5e9eb5cc899eaf2f46bc46d33ba4 or c/s b154537ad07598377ebf98252fb7d2aff127983b moved the testing of xen_enabled() from pc_init1() to pc_machine_initfn().

Re: [Qemu-devel] [PATCH v4 0/3] chardev: Add -qmp-pretty

2014-11-20 Thread Kevin Wolf
Am 17.11.2014 um 13:31 hat Max Reitz geschrieben: This series does not add new functionality. Adding a QMP monitor with prettily formatted JSON output can be done as follows: $ qemu -chardev stdio,id=mon0 -mon chardev=mon0,mode=control,pretty=on However, this is rather cumbersome, so this

Re: [Qemu-devel] [PATCH 3/4] sdhci: Support SDHCI devices on PCI

2014-11-20 Thread Kevin O'Connor
On Tue, Nov 18, 2014 at 07:27:24AM +0100, Paolo Bonzini wrote: On 18/11/2014 05:26, Kevin O'Connor wrote: --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -53,6 +53,7 @@ /* QEMU/Bochs VGA (0x1234) */ #define PCI_VENDOR_ID_QEMU 0x1234 #define

Re: [Qemu-devel] Fwd: Re: Tunneled Migration with Non-Shared Storage

2014-11-20 Thread Gary R Hook
On 11/20/14 3:54 AM, Dr. David Alan Gilbert wrote: * Gary R Hook (grhookatw...@gmail.com) wrote: Ugh, I wish I could teach Thunderbird to understand how to reply to a newsgroup. Apologies to Paolo for the direct note. On 11/19/14 4:19 AM, Paolo Bonzini wrote: On 19/11/2014 10:35, Dr. David

[Qemu-devel] [PATCH v3 01/22] qcow2: Add two new fields to BDRVQcowState

2014-11-20 Thread Max Reitz
Add two new fields regarding refcount information (the bit width of every entry and the maximum refcount value) to the BDRVQcowState. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2-refcount.c | 2 +- block/qcow2.c | 9 +

[Qemu-devel] [PATCH v3 03/22] qcow2: Use 64 bits for refcount values

2014-11-20 Thread Max Reitz
Refcounts may have a width of up to 64 bits, so qemu should use the same width to represent refcount values internally. Since for instance qcow2_get_refcount() signals an error by returning a negative value, refcount values are generally signed to be able to represent those error values

[Qemu-devel] [PATCH v3 00/22] qcow2: Support refcount orders != 4

2014-11-20 Thread Max Reitz
As of version 3, the qcow2 file format supports different widths for refcount entries, ranging from 1 to 64 bit (only powers of two). Currently, qemu only supports 16 bit, which is the only width supported by version 2 (compat=0.10) images. This series adds support to qemu for all other valid

[Qemu-devel] [PATCH v3 16/22] qcow2: Use abort() instead of assert(false)

2014-11-20 Thread Max Reitz
Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 4e19615..e8d54ab 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2723,9 +2723,9 @@

[Qemu-devel] [PATCH v3 04/22] qcow2: Respect error in qcow2_alloc_bytes()

2014-11-20 Thread Max Reitz
qcow2_update_cluster_refcount() may fail, and qcow2_alloc_bytes() should mind that case. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2-refcount.c | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff

[Qemu-devel] [PATCH v3 05/22] qcow2: Refcount overflow and qcow2_alloc_bytes()

2014-11-20 Thread Max Reitz
qcow2_alloc_bytes() may reuse a cluster multiple times, in which case the refcount is increased accordingly. However, if this would lead to an overflow the function should instead just not reuse this cluster and allocate a new one. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric

[Qemu-devel] [PATCH v3 15/22] qcow2: Use error_report() in qcow2_amend_options()

2014-11-20 Thread Max Reitz
Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2.c | 14 ++ tests/qemu-iotests/061.out | 14 +++--- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index

[Qemu-devel] [PATCH v3 09/22] qcow2: Open images with refcount order != 4

2014-11-20 Thread Max Reitz
No longer refuse to open images with a different refcount entry width than 16 bits; only reject images with a refcount width larger than 64 bits (which is prohibited by the specification). Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2.c | 8

[Qemu-devel] [PATCH v3 06/22] qcow2: Helper for refcount array reallocation

2014-11-20 Thread Max Reitz
Add a helper function for reallocating a refcount array, independent of the refcount order. The newly allocated space is zeroed and the function handles failed reallocations gracefully. The helper function will always align the buffer size to a cluster boundary; if storing the refcounts in such

[Qemu-devel] [PATCH v3 10/22] qcow2: refcount_order parameter for qcow2_create2

2014-11-20 Thread Max Reitz
Add a refcount_order parameter to qcow2_create2(), use that value for the image header and for calculating the size required for preallocation. For now, always pass 4. This addition requires changes to the calculation of the file size for the full and falloc preallocation modes. That in turn is

[Qemu-devel] [PATCH v3 17/22] qcow2: Split upgrade/downgrade paths for amend

2014-11-20 Thread Max Reitz
If the image version should be upgraded, that is the first we should do; if it should be downgraded, that is the last we should do. So split the version change block into an upgrade part at the start and a downgrade part at the end. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric

[Qemu-devel] [PATCH v3 18/22] qcow2: Use intermediate helper CB for amend

2014-11-20 Thread Max Reitz
If there is more than one time-consuming operation to be performed for qcow2_amend_options(), we need an intermediate CB which coordinates the progress of the individual operations and passes the result to the original status callback. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric

[Qemu-devel] [PATCH v3 02/22] qcow2: Add refcount_width to format-specific info

2014-11-20 Thread Max Reitz
Add the bit width of every refcount entry to the format-specific information. In contrast to lazy_refcounts and the corrupt flag, this should be always emitted, even for compat=0.10 although it does not support any refcount width other than 16 bits. This is because if a boolean is optional, one

[Qemu-devel] [PATCH v3 20/22] qcow2: Invoke refcount order amendment function

2014-11-20 Thread Max Reitz
Make use of qcow2_change_refcount_order() to support changing the refcount order with qemu-img amend. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2.c | 44 +++- 1 file changed, 35 insertions(+), 9

[Qemu-devel] [PATCH v3 07/22] qcow2: Helper function for refcount modification

2014-11-20 Thread Max Reitz
Since refcounts do not always have to be a uint16_t, all refcount blocks and arrays in memory should not have a specific type (thus they become pointers to void) and for accessing them, two helper functions are used (a getter and a setter). Those functions are called indirectly through function

[Qemu-devel] [PATCH v3 22/22] iotests: Add test for different refcount widths

2014-11-20 Thread Max Reitz
Add a test for conversion between different refcount widths and errors specific to certain widths (i.e. snapshots with refcount_width=1). Signed-off-by: Max Reitz mre...@redhat.com --- tests/qemu-iotests/112 | 278 + tests/qemu-iotests/112.out |

[Qemu-devel] [PATCH v3 08/22] qcow2: More helpers for refcount modification

2014-11-20 Thread Max Reitz
Add helper functions for getting and setting refcounts in a refcount array for any possible refcount order, and choose the correct one during refcount initialization. Signed-off-by: Max Reitz mre...@redhat.com --- block/qcow2-refcount.c | 124 - 1

[Qemu-devel] [PATCH v3 21/22] qcow2: Point to amend function in check

2014-11-20 Thread Max Reitz
If a reference count is not representable with the current refcount order, the image check should point to qemu-img amend for increasing the refcount order. However, qemu-img amend needs write access to the image which cannot be provided if the image is marked corrupt; and the image check will not

[Qemu-devel] [PATCH v3 12/22] qcow2: Allow creation with refcount order != 4

2014-11-20 Thread Max Reitz
Add a creation option to qcow2 for setting the refcount order of images to be created, and respect that option's value. This breaks some test outputs, fix them. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2.c | 20

Re: [Qemu-devel] [PATCH v4 33/47] Postcopy: Postcopy startup in migration thread

2014-11-20 Thread Paolo Bonzini
On 20/11/2014 18:12, Dr. David Alan Gilbert wrote: Trace added, and also moved as requested - was the request to move it just to elimintate the other DPRINTF? Yes. Also what is 2/3/4? Is this just for debugging or is it part of the protocol? Debug; they're very useful for matching the

[Qemu-devel] [PATCH v3 11/22] iotests: Prepare for refcount_width option

2014-11-20 Thread Max Reitz
Some tests do not work well with certain refcount widths (i.e. you cannot create internal snapshots with refcount_width=1), so make those widths unsupported. Furthermore, add another filter to _filter_img_create in common.filter which filters out the refcount_width value. This is necessary for

[Qemu-devel] [PATCH v3 13/22] progress: Allow regressing progress

2014-11-20 Thread Max Reitz
Progress may regress; this should be displayed correctly by qemu_progress_print(). Signed-off-by: Max Reitz mre...@redhat.com --- util/qemu-progress.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/qemu-progress.c b/util/qemu-progress.c index 4ee5cd0..c0fb14d 100644 ---

[Qemu-devel] [PATCH v3 14/22] block: Add opaque value to the amend CB

2014-11-20 Thread Max Reitz
Add an opaque value which is to be passed to the bdrv_amend_options() status callback. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block.c | 4 ++-- block/qcow2-cluster.c | 14 -- block/qcow2.c | 9

[Qemu-devel] [PATCH v3 19/22] qcow2: Add function for refcount order amendment

2014-11-20 Thread Max Reitz
Add a function qcow2_change_refcount_order() which allows changing the refcount order of a qcow2 image. Signed-off-by: Max Reitz mre...@redhat.com Reviewed-by: Eric Blake ebl...@redhat.com --- block/qcow2-refcount.c | 454 + block/qcow2.h

Re: [Qemu-devel] [PATCH v4 33/47] Postcopy: Postcopy startup in migration thread

2014-11-20 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: Il 03/10/2014 19:47, Dr. David Alan Gilbert (git) ha scritto: From: Dr. David Alan Gilbert dgilb...@redhat.com Rework the migration thread to setup and start postcopy. Signed-off-by: Dr. David Alan Gilbert dgilb...@redhat.com ---

Re: [Qemu-devel] [PATCH] linux-user: Use the 5KEf processor for 64-bit emulation

2014-11-20 Thread Maciej W. Rozycki
On Thu, 20 Nov 2014, Peter Maydell wrote: For user emulation mode I think we want to default to the highest ISA level supported, for maximum user flexibility. Currently the MIPS64r2 ISA is the highest 64-bit ISA we have a real processor support for so use it and the 5KEf which is the

Re: [Qemu-devel] [PATCH v3 4/4] target-tricore: Add instructions of RCR opcode format

2014-11-20 Thread Richard Henderson
On 11/20/2014 02:28 PM, Bastian Koppelmann wrote: +uint64_t helper_madd64_ssov(CPUTriCoreState *env, target_ulong r1, +uint64_t r2, target_ulong r3) +{ +uint64_t ret_low, ret_high; +uint64_t r2_high; +int64_t t1 = sextract64(r1, 0, 32); +int64_t

Re: [Qemu-devel] [PATCH] target-ppc: explicitly save page table headers in big endian

2014-11-20 Thread Alexander Graf
On 03.11.14 16:14, Cédric Le Goater wrote: Currently, when the page tables are saved, the kvm_get_htab_header structs and the ptes are assumed being big endian and dumped as a indistinct blob in the statefile. This is no longer true when the host is little endian and this breaks

Re: [Qemu-devel] [PATCH 00/17] RFC: userfault v2

2014-11-20 Thread Andrea Arcangeli
Hi, On Fri, Oct 31, 2014 at 12:39:32PM -0700, Peter Feiner wrote: On Fri, Oct 31, 2014 at 11:29:49AM +0800, zhanghailiang wrote: Agreed, but for doing live memory snapshot (VM is running when do snapsphot), we have to do this (block the write action), because we have to save the page

Re: [Qemu-devel] [PATCH] linux-user: Use the 5KEf processor for 64-bit emulation

2014-11-20 Thread Peter Maydell
On 20 November 2014 17:21, Maciej W. Rozycki ma...@codesourcery.com wrote: It's not possible, the MIPS16 and microMIPS instruction sets are mutually exclusive as the same resource (the ISA bit or the LSB of the PC) is used to switch to either mode from the standard MIPS mode, depending on

[Qemu-devel] [Bug 1394550] Re: qemu: linux kernel too old to load a ram disk

2014-11-20 Thread Arsen.Shnurkov
** Attachment added: /boot/initramfs-genkernel-x86_64-3.17.3-gentoo-gnu-vm https://bugs.launchpad.net/qemu/+bug/1394550/+attachment/4264506/+files/initramfs-genkernel-x86_64-3.17.3-gentoo-gnu-vm -- You received this bug notification because you are a member of qemu- devel-ml, which is

[Qemu-devel] [Bug 1394550] Re: qemu: linux kernel too old to load a ram disk

2014-11-20 Thread Arsen.Shnurkov
** Attachment added: /etc/genkernel.conf https://bugs.launchpad.net/qemu/+bug/1394550/+attachment/4264504/+files/genkernel.conf -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1394550 Title:

[Qemu-devel] [Bug 1394550] Re: qemu: linux kernel too old to load a ram disk

2014-11-20 Thread Arsen.Shnurkov
** Attachment added: /boot/kernel-genkernel-x86_64-3.17.3-gentoo-gnu-vm https://bugs.launchpad.net/qemu/+bug/1394550/+attachment/4264505/+files/kernel-genkernel-x86_64-3.17.3-gentoo-gnu-vm -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed

[Qemu-devel] [Bug 1394550] Re: qemu: linux kernel too old to load a ram disk

2014-11-20 Thread Arsen.Shnurkov
** Attachment added: /etc/kernels/kernel-config-x86_64-3.17.3-gentoo-gnu-vm https://bugs.launchpad.net/qemu/+bug/1394550/+attachment/4264503/+files/kernel-config-x86_64-3.17.3-gentoo-gnu-vm -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed

Re: [Qemu-devel] [PATCH 00/17] RFC: userfault v2

2014-11-20 Thread Andrea Arcangeli
Hi, On Thu, Nov 20, 2014 at 10:54:29AM +0800, zhanghailiang wrote: Yes, you are right. This is what i really want, bypass all non-present faults and only track strict wrprotect faults. ;) So, do you plan to support that in the userfault API? Yes I think it's good idea to support

[Qemu-devel] [Bug 1357445] Re: qemu-img: 'amend -o compat=0.10' command failed with segfault on the fuzzed image

2014-11-20 Thread Max Reitz
Hi, Well, I still (on 2.2.0-rc2) receive File too large, so I guess that's the fix. Max ** Changed in: qemu Status: New = Fix Committed -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1357445

[Qemu-devel] [Bug 1357440] Re: qemu-img: Assert for 'amend' command and the fuzzed image

2014-11-20 Thread Max Reitz
Hi, This issue has been fixed in master (af3ff19b48f0bbf3a8bd35c47460358e8c6ae5e5, 2.2.0-rc2): $ ./qemu-img amend -o compat=0.10 -f qcow2 copy.img qemu-img: Error while amending options: File too large Thanks for your report, Max ** Changed in: qemu Status: New = Fix Committed -- You

[Qemu-devel] [Bug 1394550] Re: qemu: linux kernel too old to load a ram disk

2014-11-20 Thread Arsen.Shnurkov
I loaded kernel and initramfs through symlinks and make that symlinks wrong (kernel become initramfs and vice versa) ** Changed in: qemu Status: New = Invalid -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU.

[Qemu-devel] [BUGFIX][PATCH for 2.2 v4 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen

2014-11-20 Thread Don Slutz
c/s 9b23cfb76b3a5e9eb5cc899eaf2f46bc46d33ba4 or c/s b154537ad07598377ebf98252fb7d2aff127983b moved the testing of xen_enabled() from pc_init1() to pc_machine_initfn(). xen_enabled() does not return the correct value in pc_machine_initfn(). Changed vmport from a bool to an enum. Added the

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 1/1] hw/ide/core.c: Prevent SIGSEGV during migration

2014-11-20 Thread Don Slutz
On 11/19/14 07:29, Markus Armbruster wrote: Don Slutz dsl...@verizon.com writes: The other callers to blk_set_enable_write_cache() in this file already check for s-blk == NULL. Signed-off-by: Don Slutz dsl...@verizon.com --- I think this is a bugfix that should be back ported to stable

Re: [Qemu-devel] [PATCH v4 3/3] iotests: Use -qmp-pretty in 067

2014-11-20 Thread Kevin Wolf
Am 17.11.2014 um 13:31 hat Max Reitz geschrieben: 067 invokes query-block, resulting in a reference output with really long lines (which may pose a problem in email patches and always poses a problem when the output changes, because it is hard to see what has actually changed). Use -qmp-pretty

Re: [Qemu-devel] [PATCH v4 3/3] iotests: Use -qmp-pretty in 067

2014-11-20 Thread Max Reitz
On 20.11.2014 19:39, Kevin Wolf wrote: Am 17.11.2014 um 13:31 hat Max Reitz geschrieben: 067 invokes query-block, resulting in a reference output with really long lines (which may pose a problem in email patches and always poses a problem when the output changes, because it is hard to see what

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 v4 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen

2014-11-20 Thread Eduardo Habkost
On Thu, Nov 20, 2014 at 01:21:18PM -0500, Don Slutz wrote: [...] @@ -242,9 +243,16 @@ static void pc_q35_init(MachineState *machine) pc_register_ferr_irq(gsi[13]); +assert(pc_machine-vmport != ON_OFF_AUTO_MAX); +if (pc_machine-vmport == ON_OFF_AUTO_AUTO) { +

Re: [Qemu-devel] [PATCH 2/2] LICENSE: clarify

2014-11-20 Thread Christopher Covington
Hi Paolo, On 07/31/2013 02:19 AM, Paolo Bonzini wrote: 1) The GPL says that if the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. This is not true, QEMU includes parts that are v2-only. 2) Provide a

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 v4 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen

2014-11-20 Thread Don Slutz
On 11/20/14 14:05, Eduardo Habkost wrote: On Thu, Nov 20, 2014 at 01:21:18PM -0500, Don Slutz wrote: [...] @@ -242,9 +243,16 @@ static void pc_q35_init(MachineState *machine) pc_register_ferr_irq(gsi[13]); +assert(pc_machine-vmport != ON_OFF_AUTO_MAX); +if

Re: [Qemu-devel] [PATCH v4 3/3] iotests: Use -qmp-pretty in 067

2014-11-20 Thread Eric Blake
On 11/20/2014 11:56 AM, Max Reitz wrote: On 20.11.2014 19:39, Kevin Wolf wrote: Am 17.11.2014 um 13:31 hat Max Reitz geschrieben: 067 invokes query-block, resulting in a reference output with really long lines (which may pose a problem in email patches and always poses a problem when the

Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 v4 1/1] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen

2014-11-20 Thread Eric Blake
On 11/20/2014 11:21 AM, Don Slutz wrote: c/s 9b23cfb76b3a5e9eb5cc899eaf2f46bc46d33ba4 or c/s b154537ad07598377ebf98252fb7d2aff127983b moved the testing of xen_enabled() from pc_init1() to pc_machine_initfn(). xen_enabled() does not return the correct value in pc_machine_initfn().

Re: [Qemu-devel] [PATCH v3 7/9] raw: Prohibit dangerous writes for probed images

2014-11-20 Thread Dr. David Alan Gilbert
* Kevin Wolf (kw...@redhat.com) wrote: diff --git a/block/raw_bsd.c b/block/raw_bsd.c index 401b967..2ce5409 100644 --- a/block/raw_bsd.c +++ b/block/raw_bsd.c @@ -58,8 +58,58 @@ static int coroutine_fn raw_co_readv(BlockDriverState *bs, int64_t sector_num, static int coroutine_fn

Re: [Qemu-devel] [PATCH v2] Add -semihosting-config ....cmdline=string.

2014-11-20 Thread Liviu Ionescu
On 20 Nov 2014, at 18:40, Liviu Ionescu i...@livius.net wrote: A new sub-option was added to -semihosting-config to define the entire semihosting command line (cmdline=string). unfortunately the use of a sub-option is not appropriate, the command line string must be allowed to include *any*

Re: [Qemu-devel] [PATCH v2] Add -semihosting-config ....cmdline=string.

2014-11-20 Thread Eric Blake
On 11/20/2014 01:13 PM, Liviu Ionescu wrote: On 20 Nov 2014, at 18:40, Liviu Ionescu i...@livius.net wrote: A new sub-option was added to -semihosting-config to define the entire semihosting command line (cmdline=string). unfortunately the use of a sub-option is not appropriate, the

Re: [Qemu-devel] [PATCH v2] Add -semihosting-config ....cmdline=string.

2014-11-20 Thread Liviu Ionescu
On 20 Nov 2014, at 22:20, Eric Blake ebl...@redhat.com wrote: Instead, try: -semihosting-config target=native,cmdline=MessageTest --gtest_output=xml:gcm.xml,,baburiba with double comma, the output of my custom qemu shows that the command line was properly parsed: GNU ARM Eclipse QEMU

Re: [Qemu-devel] [PATCH v2 21/21] iotests: Add test for different refcount widths

2014-11-20 Thread Eric Blake
On 11/20/2014 07:03 AM, Max Reitz wrote: Some people may ask why the walks are performed in a loop without a fixed limit (because they can't find cases where allocations haven't settled at the third pass). But I doubt that'll be a serious problem. It's much easier to have such a basically

Re: [Qemu-devel] [PATCH v2 21/21] iotests: Add test for different refcount widths

2014-11-20 Thread Eric Blake
On 11/20/2014 06:48 AM, Max Reitz wrote: Sounds good, the only problem is that I'd have to hand-craft the image myself, because qemu generally uses self-references for refblocks (when allocating new refblocks, they will contain their own refcount). I think this already would be too much

[Qemu-devel] [PULL 0/9] valgrind/coverity/i386/s390x: memcheck false positives

2014-11-20 Thread Christian Borntraeger
Paolo, Peter, here is an updated version of my valgrind tree. Please review and consider for 2.3. The following changes since commit af3ff19b48f0bbf3a8bd35c47460358e8c6ae5e5: Update version for v2.2.0-rc2 release (2014-11-18 18:00:58 +) are available in the git repository at:

[Qemu-devel] [PULL 6/9] valgrind/i386: avoid false positives on KVM_GET_MSRS ioctl

2014-11-20 Thread Christian Borntraeger
struct kvm_msrs contains a pad field. Let's use a designated initializer on the info part to avoid false positives from valgrind/memcheck. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- target-i386/kvm.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[Qemu-devel] [PULL 7/9] valgrind/i386: avoid false positives on KVM_SET_VCPU_EVENTS ioctl

2014-11-20 Thread Christian Borntraeger
struct kvm_vcpu_events contains reserved fields. Let's use a designated initializer to avoid false positives in valgrind. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- target-i386/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-i386/kvm.c

[Qemu-devel] [PULL 3/9] valgrind/i386: avoid false positives on KVM_SET_PIT ioctl

2014-11-20 Thread Christian Borntraeger
struct kvm_pit_state2 contains pad fields. Let's use a designated initializer to avoid false positives from valgrind/memcheck. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- hw/i386/kvm/i8254.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Qemu-devel] [PULL 1/9] valgrind: avoid false positives in KVM_GET_DIRTY_LOG ioctl

2014-11-20 Thread Christian Borntraeger
struct kvm_dirty_log contains padding fields that trigger false positives in valgrind. Let's use a designated initializer to avoid false positives from valgrind/memcheck. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- kvm-all.c | 2 +- 1 file changed, 1 insertion(+), 1

<    1   2   3   >