Re: [Qemu-devel] [PATCH] libcacard: remove useless initializers

2014-05-11 Thread Alon Levy
On 05/08/2014 08:19 PM, Michael Tokarev wrote: libcacard has many functions which initializes local variables at declaration time, which are always assigned some values later (often right after declaration). Clean up these initializers. How is this an improvement? Doesn't the compiler ignore

Re: [Qemu-devel] [PATCH] libcacard: g_malloc cleanups

2014-05-11 Thread Alon Levy
On 05/08/2014 06:54 PM, Michael Tokarev wrote: This patch replaces g_malloc() in libcacard into g_new() or g_new0() where appropriate (removing some init-to-zero surrounding code), g_malloc+memcpy into g_memdup() and the like. Reviewed-by: Alon Levy al...@redhat.com just one comment below.

Re: [Qemu-devel] [PATCH v2] Add remove_boot_device_path() function for hot-unplug device

2014-05-11 Thread Marcel Apfelbaum
On Sun, 2014-05-11 at 11:07 +0800, lijun wrote: On 04/22/2014 05:21 PM, Marcel Apfelbaum wrote: On Wed, 2014-04-16 at 22:20 +0800, Jun Li wrote: Add remove_boot_device_path() function to remove bootindex when hot-unplug a device. This patch fixed virtio-blk/virtio-net/scsi-disk/scsi-generic

Re: [Qemu-devel] [PULL 0/4] libcacard-standalone (glib compat libcacard) series for 2014-05-08

2014-05-11 Thread Michael Tokarev
09.05.2014 18:53, Peter Maydell пишет: On 8 May 2014 09:30, Michael Tokarev m...@tls.msk.ru wrote: Here's a pull request for glib pre-2.31 compatibility layer and libcacard cleanups on top of it. It has been submitted for review previously: v1:

Re: [Qemu-devel] [PATCH] libcacard: remove useless initializers

2014-05-11 Thread Michael Tokarev
11.05.2014 11:58, Alon Levy wrote: On 05/08/2014 08:19 PM, Michael Tokarev wrote: libcacard has many functions which initializes local variables at declaration time, which are always assigned some values later (often right after declaration). Clean up these initializers. How is this an

Re: [Qemu-devel] [PATCH] libcacard: g_malloc cleanups

2014-05-11 Thread Michael Tokarev
11.05.2014 12:03, Alon Levy wrote: [] diff --git a/libcacard/cac.c b/libcacard/cac.c index 74ef3e3..122129e 100644 --- a/libcacard/cac.c +++ b/libcacard/cac.c @@ -310,16 +310,11 @@ static VCardAppletPrivate * cac_new_pki_applet_private(const unsigned char *cert,

Re: [Qemu-devel] uvesafb doesn't work with seabios

2014-05-11 Thread Bernhard Walle
Am 10.05.14 17:07, schrieb Kevin O'Connor: Can you run the original SeaVGABIOS image and provide the output with the following added to the qemu command line: -chardev stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios Since it's quite much debugging info, I uploaded it to

Re: [Qemu-devel] [PATCH] monitor: Add info qom-tree subcommand.

2014-05-11 Thread Hani Benhabiles
On Wed, May 07, 2014 at 01:01:12PM +0200, Paolo Bonzini wrote: Il 05/05/2014 20:33, Luiz Capitulino ha scritto: +data = object_property_get_qobject(obj, info-name, NULL); +if (!data) { +list = list-next; +continue; You could use

Re: [Qemu-devel] [PATCH] monitor: Add info qom-tree subcommand.

2014-05-11 Thread Hani Benhabiles
On Wed, May 07, 2014 at 05:39:36PM +0200, Andreas Färber wrote: Hi Hani, Am 27.04.2014 12:29, schrieb Hani Benhabiles: Signed-off-by: Hani Benhabiles h...@linux.com --- Not sure whether the qobject stringifying functions could fit or be of some use elsewhere. Thus, I kept them as

Re: [Qemu-devel] uvesafb doesn't work with seabios

2014-05-11 Thread Kevin O'Connor
On Sun, May 11, 2014 at 01:42:57PM +0200, Bernhard Walle wrote: Am 10.05.14 17:07, schrieb Kevin O'Connor: Also, it looks like uvesafb can call x86emu. Older versions of x86emu are known to not emulate some instructions properly, and it has caused problems for SeaVGABIOS. The most recent

[Qemu-devel] [PATCH] block/nfs: use per-object vars and make it modular

2014-05-11 Thread Michael Tokarev
nfs block module uses libnfs and uses pkg-config to determine its build information. Somehow it used only --libs, not --cflags, and added those libs into global $LIBS, instead of using per-object variable. Use both --libs and --cflags, use them as per-object variable, and finally make

Re: [Qemu-devel] My OS hangup in KVM for some reasons, how can I debug?

2014-05-11 Thread Jun Koi
On Fri, May 9, 2014 at 11:24 AM, Jun Koi junkoi2...@gmail.com wrote: On Thu, May 8, 2014 at 4:28 PM, Jun Koi junkoi2...@gmail.com wrote: Hi, I have an weird OS that I am trying to boot in KVM. however, it just hang in the middle, without a good reason. The same OS boots fine in

Re: [Qemu-devel] [PATCH qom-next 1/4] qom: Implement info qom-composition HMP command

2014-05-11 Thread Hani Benhabiles
On Thu, May 08, 2014 at 04:21:14PM +0200, Andreas Färber wrote: To complement qdev's bus-oriented info qtree, info qom-composition prints a hierarchical view of the machine composition tree. Signed-off-by: Andreas Färber afaer...@suse.de --- include/monitor/qdev.h | 1 + monitor.c

Re: [Qemu-devel] [PATCH 3/4] block: replace fprintf(stderr, ...) with error_report() in block/

2014-05-11 Thread Le Tan
2014-05-10 21:18 GMT+08:00 Peter Crosthwaite peter.crosthwa...@xilinx.com: On Sat, May 10, 2014 at 9:55 AM, Le Tan tamlokv...@gmail.com wrote: Replace fprintf(stderr,...) with error_report() in files block/*, block.c, block-migration.c and blockdev.c. The trailing \ns of the @fmt argument have

Re: [Qemu-devel] [PATCH qom-next 2/4] qom: Implement qom-list HMP command

2014-05-11 Thread Hani Benhabiles
On Thu, May 08, 2014 at 04:21:15PM +0200, Andreas Färber wrote: Implement it as a wrapper for QMP qom-list, but mimic the behavior of scripts/qmp/qom-list in making the path argument optional and listing the root if absent, to hint users what kind of path to pass. Signed-off-by: Andreas

Re: [Qemu-devel] uvesafb doesn't work with seabios

2014-05-11 Thread Bernhard Walle
Am 2014-05-11 14:37, schrieb Kevin O'Connor: On Sun, May 11, 2014 at 01:42:57PM +0200, Bernhard Walle wrote: Am 10.05.14 17:07, schrieb Kevin O'Connor: Also, it looks like uvesafb can call x86emu. Older versions of x86emu are known to not emulate some instructions properly, and it has caused

Re: [Qemu-devel] [PATCH qom-next 3/4] qom: Implement qom-get HMP command

2014-05-11 Thread Hani Benhabiles
On Thu, May 08, 2014 at 04:21:16PM +0200, Andreas Färber wrote: Reimplement it based on qmp_qom_get() to avoid converting QObjects back to strings. Inspired-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Andreas Färber afaer...@suse.de --- hmp-commands.hx | 13 + hmp.c

Re: [Qemu-devel] [PATCH qom-next 4/4] qom: Implement qom-set HMP command

2014-05-11 Thread Hani Benhabiles
On Thu, May 08, 2014 at 04:21:17PM +0200, Andreas Färber wrote: Re-implemented based on qmp_qom_set() to facilitate argument parsing. Signed-off-by: Andreas Färber afaer...@suse.de --- hmp-commands.hx | 13 + hmp.c | 18 ++ hmp.h | 1 + 3

[Qemu-devel] [PATCH] kvm: Fix enable_cap helpers on older gcc

2014-05-11 Thread Alexander Graf
Commit 40f1ee27aa1 introduced handy helpers for enable_cap calls on vcpu and vm level. Unfortunately some older gcc versions (4.7.1, 4.6) seem to choke on signedness detection in inline created variables: target-ppc/kvm.c: In function 'kvmppc_booke_watchdog_enable': target-ppc/kvm.c:1302:21:

[Qemu-devel] [Bug 1318281] [NEW] linux-user: x86_64 target fails to call sys_futex()

2014-05-11 Thread Jiajie Hu
Public bug reported: I'm building the latest QEMU (06b4f00d53637f2c16a62c2cbaa30bffb045cf88) on ARM to run some x86_64 executables in user mode. This is my configuration: ./configure \ --prefix=/root/qemu-x86_64 \ --target-list=x86_64-linux-user \ --disable-system \ --disable-tools The

[Qemu-devel] [PATCH] KVM: PPC: Don't secretly add 1T segment feature to CPU

2014-05-11 Thread Alexander Graf
When we select a CPU type that does not support 1TB segments, we should not expose 1TB just because KVM supports 1TB segments. User configuration always wins over feature availability. Signed-off-by: Alexander Graf ag...@suse.de --- target-ppc/kvm.c | 8 +--- 1 file changed, 5 insertions(+),

[Qemu-devel] [RFC v2 0/4] AMBA platform device passthrough

2014-05-11 Thread Alvise Rigo
These patches are the next iteration of [Qemu-devel] [RFC 0/4] AMBA platform device passthrough and are based on the latest version of VFIO for platform devices [RFC PATCH v5 00/11] VFIO support for platform devices and the initial patch series [Qemu-devel] [RFC v2 0/6] KVM platform device

[Qemu-devel] [RFC v2 1/4] Add EXEC_FLAG to VFIO DMA mappings

2014-05-11 Thread Alvise Rigo
The flag is mandatory for the ARM SMMU so we always add it if the MMIO handles it. Signed-off-by: Alvise Rigo a.r...@virtualopensystems.com --- hw/vfio/common.c | 9 + hw/vfio/vfio-common.h | 1 + linux-headers/linux/vfio.h | 2 ++ 3 files changed, 12 insertions(+) diff

[Qemu-devel] [RFC v2 2/4] Add AMBA devices support to VFIO

2014-05-11 Thread Alvise Rigo
The impossibility to add more then one compatibility property to the device tree node was not permitting to bind AMBA devices. Now we can add an arbitrary number of compatibility property values divided by the character ;. If the compatibility string contains the substring arm,primecell, a clock

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

2014-05-11 Thread Alvise Rigo
The user can specify the location of the memory region (register) used by the guest driver to clear the pending interrupt; if enabled, this mechanism will overlap to the default one (timer based). The region is provided as command line property intclr-region of the vfio-platform device. The

[Qemu-devel] [RFC v2 4/4] Always use eventfd as notifying mechanism

2014-05-11 Thread Alvise Rigo
When eventfd is not configured the method event_notifier_init fallbacks to the pipe/pipe2 system call, causing an error in VFIO_DEVICE_SET_IRQS since we pass to the kernel a file descriptor which is not created by eventfd. Signed-off-by: Alvise Rigo a.r...@virtualopensystems.com ---

Re: [Qemu-devel] [PATCH v2] block/raw-posix: Try both FIEMAP and SEEK_HOLE

2014-05-11 Thread Christoph Hellwig
On Tue, May 06, 2014 at 09:00:54PM +0200, Max Reitz wrote: The current version of raw-posix always uses ioctl(FS_IOC_FIEMAP) if FIEMAP is available; lseek with SEEK_HOLE/SEEK_DATA are not even compiled in in this case. However, there may be implementations which support the latter but not the

[Qemu-devel] [PATCH v4 0/2] Named GPIOs

2014-05-11 Thread Peter Crosthwaite
This series implements Named GPIOs on the qdev level. Patch 1 is the feature presentation. Second patch I give a useful example of the feature's use (an SSI cleanup). Changed since v3: Addressed PMM v2 review Changed since v2: Re-ordered function args (PMM review) Changed since v1: use QLIST (AF

[Qemu-devel] [PATCH v4 1/2] qdev: Implement named GPIOs

2014-05-11 Thread Peter Crosthwaite
Implement named GPIOs on the Device layer. Listifies the existing GPIOs stuff using string keys. Legacy un-named GPIOs are preserved by using a NULL name string - they are just a single matchable element in the name list. Signed-off-by: Peter Crosthwaite peter.crosthwa...@xilinx.com --- Changed

[Qemu-devel] [PATCH v4 2/2] ssi: Name the CS GPIO.

2014-05-11 Thread Peter Crosthwaite
To get it out of the default GPIO list. This allows child devices to use the un-named GPIO namespace without having to be SSI aware. That is, there is no more need for machines to know about the obscure policy where GPIO 0 is the SSI chip-select and GPIO 1..N are the concrete class GPIOs (defined

Re: [Qemu-devel] [PATCH v3 1/2] qdev: Implement named GPIOs

2014-05-11 Thread Peter Crosthwaite
On Sat, May 10, 2014 at 2:52 AM, Peter Maydell peter.mayd...@linaro.org wrote: On 8 May 2014 07:59, Peter Crosthwaite peter.crosthwa...@xilinx.com wrote: Implement named GPIOs on the Device layer. Listifies the existing GPIOs stuff using string keys. Legacy un-named GPIOs are preserved by using

Re: [Qemu-devel] [PATCH 3/4] block: replace fprintf(stderr, ...) with error_report() in block/

2014-05-11 Thread Peter Crosthwaite
On Sun, May 11, 2014 at 11:27 PM, Le Tan tamlokv...@gmail.com wrote: 2014-05-10 21:18 GMT+08:00 Peter Crosthwaite peter.crosthwa...@xilinx.com: On Sat, May 10, 2014 at 9:55 AM, Le Tan tamlokv...@gmail.com wrote: Replace fprintf(stderr,...) with error_report() in files block/*, block.c,

[Qemu-devel] [PATCH v19 00/16] Drop in_use from BlockDriverState and enable point-in-time snapshot exporting over NBD

2014-05-11 Thread Fam Zheng
v19: Rebase to master, resolve several contextual conflicts. Patch 05 has the only code change difference from v18 to preserve. assert(bs-backing_hd == NULL); v18: Address reviewing comments from Jeff and Eric. Rebased to current master. Side by side diff from v17:

[Qemu-devel] [PATCH v19 01/16] vmdk: Optimize cluster allocation

2014-05-11 Thread Fam Zheng
This drops the unnecessary bdrv_truncate() from, and also improves, cluster allocation code path. Before, when we need a new cluster, get_cluster_offset truncates the image to bdrv_getlength() + cluster_size, and returns the offset of added area, i.e. the image length before truncating. This is

[Qemu-devel] [PATCH v19 04/16] block: Replace in_use with operation blocker

2014-05-11 Thread Fam Zheng
This drops BlockDriverState.in_use with op_blockers: - Call bdrv_op_block_all in place of bdrv_set_in_use(bs, 1). - Call bdrv_op_unblock_all in place of bdrv_set_in_use(bs, 0). - Check bdrv_op_is_blocked() in place of bdrv_in_use(bs). The specific types are used, e.g. in place of

[Qemu-devel] [PATCH v19 02/16] block: Add BlockOpType enum

2014-05-11 Thread Fam Zheng
This adds the enum of all the operations that can be taken on a block device. Signed-off-by: Fam Zheng f...@redhat.com Reviewed-by: Benoit Canet ben...@irqsave.net Reviewed-by: Jeff Cody jc...@redhat.com --- include/block/block.h | 19 +++ 1 file changed, 19 insertions(+) diff

[Qemu-devel] [PATCH v19 03/16] block: Introduce op_blockers to BlockDriverState

2014-05-11 Thread Fam Zheng
BlockDriverState.op_blockers is an array of lists with BLOCK_OP_TYPE_MAX elements. Each list is a list of blockers of an operation type (BlockOpType), that marks this BDS as currently blocked for a certain type of operation with reason errors stored in the list. The rule of usage is: * BDS user

[Qemu-devel] [PATCH v19 05/16] block: Move op_blocker check from block_job_create to its caller

2014-05-11 Thread Fam Zheng
It makes no sense to check for any blocker on bs, we are here only because of the mechanical conversion from in_use to op_blockers. Remove it now, and let the callers check specific operation types. Backup and mirror already have it, add checker to stream and commit. Signed-off-by: Fam Zheng

[Qemu-devel] [PATCH v19 08/16] block: Parse backing option to reference existing BDS

2014-05-11 Thread Fam Zheng
Now it's safe to allow reference for backing_hd in the interface. Signed-off-by: Fam Zheng f...@redhat.com --- block.c | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index 8155e68..bb7031f 100644 --- a/block.c +++ b/block.c @@

[Qemu-devel] [PATCH v19 09/16] block: Support dropping active in bdrv_drop_intermediate

2014-05-11 Thread Fam Zheng
Dropping intermediate could be useful both for commit and stream, and BDS refcnt plus bdrv_swap could do most of the job nicely. It also needs to work with op blockers. Signed-off-by: Fam Zheng f...@redhat.com --- block.c| 139 -

[Qemu-devel] [PATCH v19 06/16] block: Add bdrv_set_backing_hd()

2014-05-11 Thread Fam Zheng
This is the common but non-trivial steps to assign or change the backing_hd of BDS. Signed-off-by: Fam Zheng f...@redhat.com --- block.c | 36 +++- include/block/block.h | 1 + 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/block.c

[Qemu-devel] [PATCH v19 10/16] stream: Use bdrv_drop_intermediate and drop close_unused_images

2014-05-11 Thread Fam Zheng
This reuses the new bdrv_drop_intermediate. Signed-off-by: Fam Zheng f...@redhat.com --- block/stream.c | 42 +- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/block/stream.c b/block/stream.c index dd0b4ac..1b348a2 100644 ---

[Qemu-devel] [PATCH v19 11/16] commit: Use bdrv_drop_intermediate

2014-05-11 Thread Fam Zheng
Signed-off-by: Fam Zheng f...@redhat.com --- block/mirror.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 6a53d79..b4b12d0 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -493,14 +493,10 @@ immediate_exit: if

[Qemu-devel] [PATCH v19 12/16] qmp: Add command 'blockdev-backup'

2014-05-11 Thread Fam Zheng
Similar to drive-backup, but this command uses a device id as target instead of creating/opening an image file. Also add blocker on target bs, since the target is also a named device now. Add check and report error for bs == target which became possible but is an illegal case with introduction

[Qemu-devel] [PATCH v19 07/16] block: Add backing_blocker in BlockDriverState

2014-05-11 Thread Fam Zheng
This makes use of op_blocker and blocks all the operations except for commit target, on each BlockDriverState-backing_hd. The asserts for op_blocker in bdrv_swap are removed because with this change, the target of block commit has at least the backing blocker of its child, so the assertion is not

[Qemu-devel] [PATCH v19 13/16] block: Allow backup on referenced named BlockDriverState

2014-05-11 Thread Fam Zheng
Drive backup is a read only operation on source bs. We want to allow this specific case to enable image-fleecing. Note that when image-fleecing job starts, the job still add its blocker to source bs, and any other operation on it will be blocked by that. Signed-off-by: Fam Zheng f...@redhat.com

[Qemu-devel] [PATCH v19 15/16] qemu-iotests: Test blockdev-backup in 055

2014-05-11 Thread Fam Zheng
This applies cases on drive-backup on blockdev-backup, except cases with target format and mode. Also add a case to check source == target. Signed-off-by: Fam Zheng f...@redhat.com --- tests/qemu-iotests/055 | 275 ++--- tests/qemu-iotests/055.out |

[Qemu-devel] [PATCH v19 16/16] qemu-iotests: Image fleecing test case 089

2014-05-11 Thread Fam Zheng
This tests the workflow of creating a lightweight point-in-time snapshot with blockdev-backup command, and exporting it with built-in NBD server. It's tested that any post-snapshot writing to the original device doesn't change data seen in NBD target. Signed-off-by: Fam Zheng f...@redhat.com ---

[Qemu-devel] [PATCH v19 14/16] block: Add blockdev-backup to transaction

2014-05-11 Thread Fam Zheng
Signed-off-by: Fam Zheng f...@redhat.com --- blockdev.c | 48 qapi-schema.json | 3 +++ 2 files changed, 51 insertions(+) diff --git a/blockdev.c b/blockdev.c index 287a2d8..1a12e24 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1411,6

Re: [Qemu-devel] My OS hangup in KVM for some reasons, how can I debug?

2014-05-11 Thread Fam Zheng
On Thu, 05/08 16:28, Jun Koi wrote: Hi, I have an weird OS that I am trying to boot in KVM. however, it just hang in the middle, without a good reason. The same OS boots fine in physical machine, and this OS comes with no source code. The OS boots in one physical machine doesn't mean it

[Qemu-devel] [PATCH] rules.mak: Rewrite unnest-vars

2014-05-11 Thread Fam Zheng
The macro unnest-vars is the most important, complicated but hard to track magic in QEMU's build system. Rewrite it in a (hopefully) clearer way, with more comments, to make it easier to understand and maintain. Remove DSO_CFLAGS and module-objs-m that are not used. A bonus fix of this version

Re: [Qemu-devel] uvesafb doesn't work with seabios

2014-05-11 Thread Kevin O'Connor
On Sun, May 11, 2014 at 04:19:55PM +0200, Bernhard Walle wrote: Am 2014-05-11 14:37, schrieb Kevin O'Connor: On Sun, May 11, 2014 at 01:42:57PM +0200, Bernhard Walle wrote: Am 10.05.14 17:07, schrieb Kevin O'Connor: Also, it looks like uvesafb can call x86emu. Older versions of x86emu are