Re: [Qemu-devel] [PULL 1/9] kvm: Silence warning from valgrind

2015-05-08 Thread Thomas Huth
On Fri, 8 May 2015 14:48:56 +0200 Paolo Bonzini wrote: > From: Thomas Huth > > valgrind complains here about uninitialized bytes with the following message: > > ==17814== Syscall param ioctl(generic) points to uninitialised byte(s) > ==17814==at 0x466A780: ioctl (in /usr/lib64/power8/libc

Re: [Qemu-devel] [PATCH v4] block/vdi: Use bdrv_flush after metadata updates

2015-05-08 Thread Stefan Weil
Am 09.05.2015 um 05:59 schrieb phoeagon: BTW, how do you usually measure the time to install a Linux distro within? Most distros ISOs do NOT have unattended installation ISOs in place. (True I can bake my own ISOs for this...) But do you have any ISOs made ready for this purpose? On Sat, May

Re: [Qemu-devel] [PATCH v4] block/vdi: Use bdrv_flush after metadata updates

2015-05-08 Thread phoeagon
BTW, how do you usually measure the time to install a Linux distro within? Most distros ISOs do NOT have unattended installation ISOs in place. (True I can bake my own ISOs for this...) But do you have any ISOs made ready for this purpose? On Sat, May 9, 2015 at 11:54 AM phoeagon wrote: > Thanks

Re: [Qemu-devel] [PATCH v4] block/vdi: Use bdrv_flush after metadata updates

2015-05-08 Thread phoeagon
Thanks. Dbench does not logically allocate new disk space all the time, because it's a FS level benchmark that creates file and deletes them. Therefore it also depends on the guest FS, say, a btrfs guest FS allocates about 1.8x space of that from EXT4, due to its COW nature. It does cause the FS to

Re: [Qemu-devel] [PATCH 09/34] block: Add BlockDriverState.inherits_from

2015-05-08 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > Currently, the block layer assumes that any block node can have only one > parent, and if it has a parent, that it inherits some options/flags from > this parent. > > This is not true any more: With references used in block device > creation, a single no

Re: [Qemu-devel] [PATCH 08/34] block: Add list of children to BlockDriverState

2015-05-08 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > This allows iterating over all children of a given BDS, not only > including bs->file and bs->backing_hd, but also driver-specific > ones like VMDK extents or Quorum children. > > Signed-off-by: Kevin Wolf > --- > block.c | 27 +++

Re: [Qemu-devel] [PATCH 07/34] block: Move flag inheritance to bdrv_open_inherited()

2015-05-08 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > Instead of letting every caller of bdrv_open() determine the right flags > for its child node manually and pass them to the function, pass the > parent node and the role of the newly opened child (like backing file, > protocol layer, etc.). > > Signed-of

Re: [Qemu-devel] [Consult] About SPRs information

2015-05-08 Thread Chen Gang
On 5/8/15 11:14, Peter Maydell wrote: > On 7 May 2015 at 22:05, Chen Gang wrote: >> >> Since no response, I assume that it is not suitable to send patches >> before finish printing hello world successfully (when sending patches, >> we should be sure of the patches are valuable enough). > > Er, I

Re: [Qemu-devel] [PATCH 06/34] block: Use QemuOpts in bdrv_open_common()

2015-05-08 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > Instead of manually parsing options and then deleting them from the > options QDict, just use QemuOpts like most other places that deal with > block device options. > > More options will be added there and then QemuOpts is a lot more > managable than ope

Re: [Qemu-devel] [PATCH 05/34] block: Use macro for cache option names

2015-05-08 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > blockdev.c| 24 > include/block/block.h | 8 > 2 files changed, 20 insertions(+), 12 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919

Re: [Qemu-devel] [RFC 5/8] aie: add module for Atomic Instruction Emulation

2015-05-08 Thread Emilio G. Cota
On Fri, May 08, 2015 at 17:02:11 -0400, Emilio G. Cota wrote: > +++ b/aie.c (snip) > +static inline void *aie_entry_init(unsigned long index) > +{ > +AIEEntry *entry; > + > +entry = qemu_memalign(64, sizeof(*entry)); > +tiny_set_init(&entry->ts); > +qemu_mutex_init(&entry->lock); >

[Qemu-devel] [Bug 1368815] Change abandoned on cinder (master)

2015-05-08 Thread OpenStack Infra
Change abandoned by Mike Perez (thin...@gmail.com) on branch: master Review: https://review.openstack.org/143575 Reason: No activity for over a month. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/136

Re: [Qemu-devel] [PATCH 04/34] vmdk: Use bdrv_open_image()

2015-05-08 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > Besides standardising on a single interface for opening child nodes, > this patch allows the user to specify options to individual extent > nodes. Overriding file names isn't possible with this yet, so it's of > limited usefulness, but still a step forwar

[Qemu-devel] [PULL 1/5] xhci: remove unused code

2015-05-08 Thread Michael Tokarev
From: Gonglei Value from xfer->packet.ep is assigned to ep here, but that stored value is not used before it is overwritten. Remove it. Cc: Gerd Hoffmann Signed-off-by: Gonglei Signed-off-by: Michael Tokarev --- hw/usb/hcd-xhci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/usb/hcd-

[Qemu-devel] [PULL 3/5] Remove various unused functions

2015-05-08 Thread Michael Tokarev
From: Thomas Huth The functions tpm_backend_thread_tpm_reset() and iothread_find() are completely unused, let's remove them. Signed-off-by: Thomas Huth Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael Tokarev --- backends/tpm.c | 11 --- include/sysemu/iothread.h

[Qemu-devel] [PULL 2/5] sheepdog: fix resource leak with sd_snapshot_create

2015-05-08 Thread Michael Tokarev
From: zhanghailiang Signed-off-by: zhanghailiang Reviewed-by: Markus Armbruster Signed-off-by: Michael Tokarev --- block/sheepdog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/sheepdog.c b/block/sheepdog.c index 2d5f06a..bd7cbed 100644 --- a/block/sheepdog.c +++ b/block/sheepdog

[Qemu-devel] [PULL 4/5] glib-compat.h: change assert to g_assert

2015-05-08 Thread Michael Tokarev
include/glib-compat.h defines a bunch of functions based on glib primitives, and uses assert() without including assert.h. Replace assert() with g_assert() to make the file more self-contained, and to fix compilation breakage after 28507a415a9b1e. Reported-by: Laurent Desnogues Signed-off-by: Mi

[Qemu-devel] [PULL 5/5] docs: update BLOCK_IMAGE_CORRUPTED documentation

2015-05-08 Thread Michael Tokarev
From: Alberto Garcia Label the "size" and "offset" fields in BLOCK_IMAGE_CORRUPTED as optional, and clarify that the latter refers to the host's offset into the image. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- docs/qmp/qmp-events.txt | 5 +++--

[Qemu-devel] [PULL 0/5] Trivial patches for 2015-05-09

2015-05-08 Thread Michael Tokarev
Here's a next trivial-patches tree pull request. There aren't many patches this time, but one of them (replacing assert with g_assert) is a build fix. Please consider applying. Thanks, /mjt The following changes since commit f8340b360b9bc29d48716ba8aca79df2b9544979: hw/ptimer: Do not artific

Re: [Qemu-devel] [RFC 1/8] cputlb: add physical address to CPUTLBEntry

2015-05-08 Thread Richard Henderson
On 05/08/2015 02:02 PM, Emilio G. Cota wrote: > -#if HOST_LONG_BITS == 32 && TARGET_LONG_BITS == 32 > -#define CPU_TLB_ENTRY_BITS 4 > -#else > +#if TARGET_LONG_BITS == 32 > #define CPU_TLB_ENTRY_BITS 5 > +#else > +#define CPU_TLB_ENTRY_BITS 6 > #endif Ouch. 24 of 64 wasted bytes for 64-bit? I

Re: [Qemu-devel] [PATCH 03/34] quorum: Use bdrv_open_image()

2015-05-08 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > Besides standardising on a single interface for opening child nodes, > this simplifies the .bdrv_open() implementation of the quorum block > driver by using block layer functionality for handling BlockdevRefs. > > Signed-off-by: Kevin Wolf > --- > bloc

Re: [Qemu-devel] [PATCH 02/34] qdict: Add qdict_{set, copy}_default()

2015-05-08 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > In the block layer functions that determine options for a child block > device, it's a common pattern to either copy options from the parent's > options or to set a default string if the option isn't explicitly set > yet for the child. Provide convenience

Re: [Qemu-devel] [PATCH v4] block/vdi: Use bdrv_flush after metadata updates

2015-05-08 Thread Stefan Weil
Am 08.05.2015 um 15:55 schrieb Kevin Wolf: Am 08.05.2015 um 15:14 hat Max Reitz geschrieben: On 07.05.2015 17:16, Zhe Qiu wrote: In reference to b0ad5a45...078a458e, metadata writes to qcow2/cow/qcow/vpc/vmdk are all synced prior to succeeding writes. Only when write is successful that bdrv_fl

Re: [Qemu-devel] [PATCH 01/34] qdict: Add qdict_array_entries()

2015-05-08 Thread Eric Blake
On 05/08/2015 02:06 PM, Eric Blake wrote: > On 05/08/2015 11:21 AM, Kevin Wolf wrote: >> Signed-off-by: Kevin Wolf >> --- > > Might want to include mention of what it will be used for in the commit > body. > >> include/qapi/qmp/qdict.h | 1 + >> qobject/qdict.c | 68 >> ++

Re: [Qemu-devel] [PATCH v2] qmp: Add qom_path field to query-cpus command

2015-05-08 Thread Eric Blake
On 05/08/2015 01:04 PM, Eduardo Habkost wrote: > This will allow clients to query additional information directly using > qom-get on the CPU objects. > > Reviewed-by: David Gibson > Reviewed-by: Andreas Färber > Signed-off-by: Eduardo Habkost > --- > Changes v1 -> v2: > * Renamed field from "qo

Re: [Qemu-devel] [PATCH 02/17] ipmi: Add a PC ISA type structure

2015-05-08 Thread Corey Minyard
On 04/26/2015 03:58 AM, Michael S. Tsirkin wrote: > On Thu, Apr 23, 2015 at 05:57:43PM -0500, miny...@acm.org wrote: >> From: Corey Minyard >> >> This provides the base infrastructure to tie IPMI low-level >> interfaces into a PC ISA bus. >> >> Signed-off-by: Corey Minyard >> --- >> default-conf

[Qemu-devel] [RFC 5/8] aie: add module for Atomic Instruction Emulation

2015-05-08 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- Makefile.target| 1 + aie.c | 52 include/qemu/aie.h | 48 translate-all.c| 2 ++ 4 files changed, 103 insertions(+) create mode 100644 a

[Qemu-devel] [RFC 4/8] radix-tree: add generic lockless radix tree module

2015-05-08 Thread Emilio G. Cota
This will be used by atomic instruction emulation code. Signed-off-by: Emilio G. Cota --- include/qemu/radix-tree.h | 29 ++ util/Makefile.objs| 2 +- util/radix-tree.c | 77 +++ 3 files changed, 107 insertions(+), 1 de

[Qemu-devel] [RFC 8/8] target-i386: emulate atomic instructions using AIE

2015-05-08 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target-i386/helper.h | 6 +- target-i386/mem_helper.c | 19 +++-- target-i386/translate.c | 176 --- 3 files changed, 122 insertions(+), 79 deletions(-) diff --git a/target-i386/helper.h b/target-i386/helper.h

[Qemu-devel] [RFC 2/8] softmmu: add helpers to get ld/st physical addresses

2015-05-08 Thread Emilio G. Cota
This will be used by the atomic instruction emulation code. Signed-off-by: Emilio G. Cota --- softmmu_template.h | 48 tcg/tcg.h | 5 + 2 files changed, 53 insertions(+) diff --git a/softmmu_template.h b/softmmu_template.h index 16b

[Qemu-devel] [RFC 7/8] target-arm: emulate atomic instructions using AIE

2015-05-08 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- linux-user/main.c | 89 - target-arm/helper.c| 2 + target-arm/helper.h| 2 + target-arm/op_helper.c | 5 ++ target-arm/translate.c | 172 ++--- 5 files changed, 86 insertions

[Qemu-devel] [RFC 3/8] tiny_set: add module to test for membership in a tiny set of pointers

2015-05-08 Thread Emilio G. Cota
This will be used by the atomic instruction emulation code. Signed-off-by: Emilio G. Cota --- include/qemu/tiny_set.h | 90 + 1 file changed, 90 insertions(+) create mode 100644 include/qemu/tiny_set.h diff --git a/include/qemu/tiny_set.h b/inclu

[Qemu-devel] [RFC 6/8] aie: add target helpers

2015-05-08 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- aie-helper.c | 179 ++ include/exec/cpu-defs.h | 5 ++ include/qemu/aie-helper.h | 21 ++ 3 files changed, 205 insertions(+) create mode 100644 aie-helper.c create mode 100644 include/qemu/aie-he

[Qemu-devel] [RFC 0/8] Helper-based Atomic Instruction Emulation (AIE)

2015-05-08 Thread Emilio G. Cota
Hi all, These are patches I've been working on for some time now. Since emulation of atomic instructions is recently getting attention([1], [2]), I'm submitting them for comment. [1] http://thread.gmane.org/gmane.comp.emulators.qemu/314406 [2] http://thread.gmane.org/gmane.comp.emulators.qemu/33

[Qemu-devel] [RFC 1/8] cputlb: add physical address to CPUTLBEntry

2015-05-08 Thread Emilio G. Cota
Having the physical address in the TLB entry will allow us to portably obtain the physical address of a memory access, which will prove useful when implementing a scalable emulation of atomic instructions. Signed-off-by: Emilio G. Cota --- cputlb.c| 1 + include/exec/cpu-defs.h

Re: [Qemu-devel] [PATCH 02/17] ipmi: Add a PC ISA type structure

2015-05-08 Thread Corey Minyard
On 04/26/2015 12:03 PM, Paolo Bonzini wrote: > > On 26/04/2015 11:05, Michael S. Tsirkin wrote: >>> + >>> +#define FW_CFG_IPMI_INTERFACE 0x30 >>> +#define FW_CFG_IPMI_BASE_ADDR 0x31 >>> +#define FW_CFG_IPMI_REG_SPACE 0x32 >>> +#define FW_CFG_IPMI_REG_SPACING 0x33 >>> +#define FW_CFG_IPMI_SLAV

Re: [Qemu-devel] [PATCH] util/hbitmap: Add an API to reset all set bits in hbitmap

2015-05-08 Thread Eric Blake
On 05/07/2015 07:12 PM, Wen Congyang wrote: > The function bdrv_clear_dirty_bitmap() is updated to use > faster hbitmap_reset_all() call. > > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > Acked-by: Paolo Bonzini > --- > block.c| 2 +- >

Re: [Qemu-devel] [PATCH v3 4/7] qom: add object_new_propv / object_new_proplist constructors

2015-05-08 Thread Eric Blake
On 05/08/2015 11:10 AM, Andreas Färber wrote: > Hi Daniel/Paolo, > > Am 01.05.2015 um 12:30 schrieb Daniel P. Berrange: >> It is reasonably common to want to create an object, set a >> number of properties, register it in the hierarchy and then >> mark it as complete (if a user creatable type). Th

Re: [Qemu-devel] [PATCH v2 3/5] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT

2015-05-08 Thread Eric Blake
On 05/08/2015 11:47 AM, Dimitris Aragiorgis wrote: > Building the QEMU tools fails if we #define DEBUG_BLOCK inside > block/raw-posix.c. Here instead of adding qemu-log.o in block-obj-y > so that DEBUG_BLOCK_PRINT can be used, we substitute the latter with > a simple DPRINTF(). > > Signed-off-by:

Re: [Qemu-devel] [PATCH 01/34] qdict: Add qdict_array_entries()

2015-05-08 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- Might want to include mention of what it will be used for in the commit body. > include/qapi/qmp/qdict.h | 1 + > qobject/qdict.c | 68 > +--- > 2 files changed, 65

Re: [Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-08 Thread Eric Blake
On 05/08/2015 10:22 AM, John Snow wrote: >>> I'm a bit surprised - making a function call per byte generally executes >>> more instructions than open-coding the conversion (albeit the branch >>> prediction in the hardware probably does fairly well over long strings, >>> since it is a tight and pred

[Qemu-devel] [PATCH v2] qmp: Add qom_path field to query-cpus command

2015-05-08 Thread Eduardo Habkost
This will allow clients to query additional information directly using qom-get on the CPU objects. Reviewed-by: David Gibson Reviewed-by: Andreas Färber Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Renamed field from "qom-path" to "qom_path", to keep consistency with existing CpuInf

Re: [Qemu-devel] [RFC 0/5] Slow-path for atomic instruction translation

2015-05-08 Thread Emilio G. Cota
On Wed, May 06, 2015 at 17:38:02 +0200, Alvise Rigo wrote: > This patch series provides an infrastructure for atomic > instruction implementation in QEMU, paving the way for TCG multi-threading. > The adopted design does not rely on host atomic > instructions and is intended to propose a 'legacy' s

Re: [Qemu-devel] [PATCH v2 3/6] Support Physical Presence Interface Spec

2015-05-08 Thread Stefan Berger
Stefan Berger wrote on 05/08/2015 12:15:17 PM: > From: Stefan Berger > To: qemu-devel@nongnu.org, m...@redhat.com > Cc: imamm...@redhat.com, quan...@intel.com, Stefan Berger/Watson/ > IBM@IBMUS, ke...@koconnor.net, Stefan Berger > Date: 05/08/2015 12:15 PM > Subject: [PATCH v2 3/6] Support Ph

[Qemu-devel] [PATCH v2 5/5] raw-posix: Introduce hdev_is_sg()

2015-05-08 Thread Dimitris Aragiorgis
Until now, an SG device was identified only by checking if its path started with "/dev/sg". Then, hdev_open() set bs->sg accordingly. This is very fragile, e.g. it fails with symlinks or relative paths. We should rely on the actual properties of the device instead of the specified file path. Test

[Qemu-devel] [PATCH v2 4/5] raw-posix: Use DPRINTF for DEBUG_FLOPPY

2015-05-08 Thread Dimitris Aragiorgis
Get rid of several #ifdef DEBUG_FLOPPY and substitute them with DPRINTF. Signed-off-by: Dimitris Aragiorgis --- block/raw-posix.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index fbccca8..8a38d02 100644 --- a/

Re: [Qemu-devel] [PATCH v3 7/7] qom: don't pass string table to object_get_enum method

2015-05-08 Thread Andreas Färber
Am 01.05.2015 um 12:30 schrieb Daniel P. Berrange: > Now that properties can be explicitly registered as an enum > type, there is no need to pass the string table to the > object_get_enum method. The object property registration > already has a pointer to the string table. > > In changing this met

[Qemu-devel] [PATCH v2 3/5] raw-posix: DPRINTF instead of DEBUG_BLOCK_PRINT

2015-05-08 Thread Dimitris Aragiorgis
Building the QEMU tools fails if we #define DEBUG_BLOCK inside block/raw-posix.c. Here instead of adding qemu-log.o in block-obj-y so that DEBUG_BLOCK_PRINT can be used, we substitute the latter with a simple DPRINTF(). Signed-off-by: Dimitris Aragiorgis --- block/raw-posix.c | 12 ++--

[Qemu-devel] [PATCH v2 1/5] block: Use bdrv_is_sg() everywhere

2015-05-08 Thread Dimitris Aragiorgis
Instead of checking bs->sg use bdrv_is_sg() consistently throughout the code. Signed-off-by: Dimitris Aragiorgis Reviewed-by: Paolo Bonzini --- block.c |6 +++--- block/iscsi.c |2 +- block/raw-posix.c |4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --g

[Qemu-devel] [PATCH v2 2/5] Fix migration in case of scsi-generic

2015-05-08 Thread Dimitris Aragiorgis
During migration, QEMU uses fsync()/fdatasync() on the open file descriptor for read-write block devices to flush data just before stopping the VM. However, fsync() on a scsi-generic device returns -EINVAL which causes the migration to fail. This patch skips flushing data in case of an SG device,

[Qemu-devel] [PATCH v2 0/5] Some fixes related to scsi-generic

2015-05-08 Thread Dimitris Aragiorgis
Hi all, These four patches make slight changes to the way QEMU handles SCSI generic devices to fix a number of small problems. I am sending them against the master branch, since I don't know if they can be considered bugfixes. Thanks, dimara v2: * remove duplicate check for sg inside iscsi_co_f

Re: [Qemu-devel] [PATCH v3 6/7] qom: add a object_property_add_enum helper method

2015-05-08 Thread Andreas Färber
Am 01.05.2015 um 12:30 schrieb Daniel P. Berrange: > A QOM property can be parsed as enum using the visit_type_enum() > helper method, but this forces callers to use the more complex > generic object_property_add() method when registering it. It > also requires that users of that object have access

Re: [Qemu-devel] [PATCH v4 0/27] write/create for Parallels images with reasonable performance

2015-05-08 Thread Denis V. Lunev
On 28/04/15 10:46, Denis V. Lunev wrote: This patchset provides an ability to create of/write to Parallels images and some testing of the new code. Readings and writings are optimized out and I expect the same or slightly better performance as qcow2. Changes from v4: - parallels format driver ma

[Qemu-devel] [PATCH 33/34] qemu-iotests: Test cache mode option inheritance

2015-05-08 Thread Kevin Wolf
This is doing a more complete test on setting cache modes both while opening an image (i.e. in a -drive command line) and in reopen situations. It checks that reopen can specify options for child nodes and that cache modes are correctly inherited from parent nodes where they are not specified. Sig

[Qemu-devel] [PATCH 25/34] block: Allow specifying child options in reopen

2015-05-08 Thread Kevin Wolf
If the child was defined in the same context (-drive argument or blockdev-add QMP command) as its parent, a reopen of the parent should work the same and allow changing options of the child. Signed-off-by: Kevin Wolf --- block.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-)

[Qemu-devel] [PATCH 34/34] qemu-iotests: Test reopen with node-name/driver options

2015-05-08 Thread Kevin Wolf
'node-name' and 'driver' should not be changed during a reopen operation. It is, however, valid to specify them with the same value as they already had. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/133 | 90 ++ tests/qemu-iotests/133.out | 22 +

[Qemu-devel] [PATCH 30/34] block: reopen: Extract QemuOpts for generic block layer options

2015-05-08 Thread Kevin Wolf
This patch adds a QemuOpts for generic block layer options to bdrv_reopen_prepare(). The only two options that exist currently (node-name and driver) cannot be changed, so the only thing we do is putting them right back into the QDict so that we check at the end that they are indeed unchanged. We

[Qemu-devel] [PATCH 23/34] block: Pass driver-specific options to .bdrv_refresh_filename()

2015-05-08 Thread Kevin Wolf
In order to decide whether a blkdebug: filename can be produced or a json: one is necessary, blkdebug checked whether bs->options had more options than just "config", "x-image" or "image" (the latter including nested options). That doesn't work well when generic block layer options are present. Th

[Qemu-devel] [PATCH 32/34] qemu-iotests: Try setting cache mode for children

2015-05-08 Thread Kevin Wolf
This is a basic test for specifying cache modes for child nodes on the command line. It doesn't take much time and works without O_DIRECT support. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/051 | 12 + tests/qemu-iotests/051.out | 63

[Qemu-devel] [PATCH 27/34] block: Add infrastructure for option inheritance

2015-05-08 Thread Kevin Wolf
Options are not actually inherited from the parent node yet, but this commit lays the grounds for doing so. Signed-off-by: Kevin Wolf --- block.c | 51 ++- include/block/block_int.h | 3 ++- 2 files changed, 30 insertions(+), 24 dele

[Qemu-devel] [PATCH 19/34] qcow2: Make qcow2_update_options() suitable for transactions

2015-05-08 Thread Kevin Wolf
Before we can allow updating options at runtime with bdrv_reopen(), we need to split the function into prepare/commit/abort parts. Signed-off-by: Kevin Wolf --- block/qcow2.c | 101 ++ 1 file changed, 67 insertions(+), 34 deletions(-) diff

[Qemu-devel] [PATCH 26/34] block: reopen: Document option precedence and refactor accordingly

2015-05-08 Thread Kevin Wolf
The interesting part of reopening an image is from which sources the effective options should be taken, i.e. which options take precedence over which other options. This patch documents the precedence that will be implemented in the following patches. It also refactors bdrv_reopen_queue(), so that

[Qemu-devel] [PATCH 31/34] block: Move cache options into options QDict

2015-05-08 Thread Kevin Wolf
This adds the cache mode options to the QDict, so that they can be specified for child nodes (e.g. backing.cache.direct=off). The cache modes are not removed from the flags at this point; instead, options and flags are kept in sync. If the user specifies both flags and options, the options take pr

[Qemu-devel] [PATCH 18/34] qcow2: Fix memory leak in qcow2_update_options() error path

2015-05-08 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- block/qcow2.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index abe22f3..84d6e0f 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -546,8 +546,8 @@ static int qcow2_update_options(BlockDriverState *b

[Qemu-devel] [PATCH 24/34] block: Keep "driver" in bs->options

2015-05-08 Thread Kevin Wolf
Instead of passing a separate drv argument to bdrv_open_common(), just make sure that a "driver" option is set in the QDict. This also means that a "driver" entry is consistently present in bs->options now. This is another step towards keeping all options in the QDict (which is the represenation o

[Qemu-devel] [PATCH 20/34] qcow2: Support updating driver-specific options in reopen

2015-05-08 Thread Kevin Wolf
For updating the cache sizes or disabling lazy refcounts there is a bit more to do than just changing the variables, but otherwise we're all set for changing options during bdrv_reopen(). Just implement the missing pieces and hook the functions up in bdrv_reopen(). Signed-off-by: Kevin Wolf ---

[Qemu-devel] [PATCH 29/34] qemu-iotests: Remove cache mode test without medium

2015-05-08 Thread Kevin Wolf
Specifying the cache mode for a driver without a medium is not a useful thing to do: As long as there is no medium, the cache mode doesn't make a difference, and once the 'change' command is used to insert a medium, it ignores the old cache mode and makes the new medium use cache=writethrough. Lat

[Qemu-devel] [PATCH 22/34] block: Exclude nested options only for children in append_open_options()

2015-05-08 Thread Kevin Wolf
Some drivers have nested options (e.g. blkdebug rule arrays), which don't belong to a child node and shouldn't be removed. Don't remove all options with "." in their name, but check for the complete prefixes of actually existing child nodes. Signed-off-by: Kevin Wolf --- block.c

[Qemu-devel] [PATCH 12/34] block: Allow specifying driver-specific options to reopen

2015-05-08 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- block.c | 42 +++--- block/commit.c| 4 ++-- include/block/block.h | 4 +++- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/block.c b/block.c index 95dc51e..561cefd 100644 --- a/block.c +++

[Qemu-devel] [PATCH 09/34] block: Add BlockDriverState.inherits_from

2015-05-08 Thread Kevin Wolf
Currently, the block layer assumes that any block node can have only one parent, and if it has a parent, that it inherits some options/flags from this parent. This is not true any more: With references used in block device creation, a single node can be used by multiple parents, or it can be creat

[Qemu-devel] [PATCH 16/34] qcow2: Move rest of option handling to qcow2_update_options()

2015-05-08 Thread Kevin Wolf
With this commit, the handling of driver-specific options in qcow2_open() is completely separated out into qcow2_update_options(). Signed-off-by: Kevin Wolf --- block/qcow2.c | 109 +- 1 file changed, 55 insertions(+), 54 deletions(-) diff

[Qemu-devel] [PATCH 28/34] block: Introduce bs->explicit_options

2015-05-08 Thread Kevin Wolf
bs->options doesn't only contain options that the user explicitly requested, but also option that were derived from flags, the filename or inherited from the parent node. For reopen, it is important to know the difference because reopening the parent can change inherited values in child nodes, but

[Qemu-devel] [PATCH 17/34] qcow2: Leave s unchanged on qcow2_update_options() failure

2015-05-08 Thread Kevin Wolf
On return, either all new options should be applied to BDRVQcowState (on success), or all of the old setting should be preserved (on failure). Signed-off-by: Kevin Wolf --- block/qcow2.c | 52 1 file changed, 32 insertions(+), 20 deletions(-)

[Qemu-devel] [PATCH 08/34] block: Add list of children to BlockDriverState

2015-05-08 Thread Kevin Wolf
This allows iterating over all children of a given BDS, not only including bs->file and bs->backing_hd, but also driver-specific ones like VMDK extents or Quorum children. Signed-off-by: Kevin Wolf --- block.c | 27 +++ include/block/block_int.h | 8 +++

[Qemu-devel] [PATCH 15/34] qcow2: Move qcow2_update_options() call up

2015-05-08 Thread Kevin Wolf
qcow2_update_options() only updates some variables in BDRVQcowState and doesn't really depend on other parts of it being initialised yet, so it can be moved so that it immediately follows the other half of option handling code in qcow2_open(). Signed-off-by: Kevin Wolf --- block/qcow2.c | 18 +++

[Qemu-devel] [PATCH 14/34] qcow2: Factor out qcow2_update_options()

2015-05-08 Thread Kevin Wolf
Eventually we want to be able to change options at runtime. As a first step towards that goal, separate some option handling code from the general initialisation code in qcow2_open(). Signed-off-by: Kevin Wolf --- block/qcow2.c | 135 +- 1

[Qemu-devel] [PATCH 06/34] block: Use QemuOpts in bdrv_open_common()

2015-05-08 Thread Kevin Wolf
Instead of manually parsing options and then deleting them from the options QDict, just use QemuOpts like most other places that deal with block device options. More options will be added there and then QemuOpts is a lot more managable than open-coding everything. Signed-off-by: Kevin Wolf ---

[Qemu-devel] [PATCH 21/34] block: Consider all block layer options in append_open_options

2015-05-08 Thread Kevin Wolf
The code already special-cased "node-name", which is currently the only option passed in the QDict that isn't driver-specific. Generalise the code to take all general block layer options into consideration. Signed-off-by: Kevin Wolf --- block.c | 26 ++ 1 file changed, 18

[Qemu-devel] [PATCH 13/34] qemu-io: Add command 'reopen'

2015-05-08 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- qemu-io-cmds.c | 71 ++ 1 file changed, 71 insertions(+) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 1afcfc0..ef8f3fd 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -1978,6 +1978,76 @@ static const

Re: [Qemu-devel] [PATCH v3 4/7] qom: add object_new_propv / object_new_proplist constructors

2015-05-08 Thread Andreas Färber
Am 08.05.2015 um 19:18 schrieb Paolo Bonzini: > On 08/05/2015 19:10, Andreas Färber wrote: >>>Error *err = NULL; >>>Object *obj; >>>obj = object_new_propv(TYPE_MEMORY_BACKEND_FILE, >>> "/objects", >> >> This is not an Object*. ;) I like it better as it's implem

[Qemu-devel] [PATCH 07/34] block: Move flag inheritance to bdrv_open_inherited()

2015-05-08 Thread Kevin Wolf
Instead of letting every caller of bdrv_open() determine the right flags for its child node manually and pass them to the function, pass the parent node and the role of the newly opened child (like backing file, protocol layer, etc.). Signed-off-by: Kevin Wolf --- block.c | 74

[Qemu-devel] [PATCH 04/34] vmdk: Use bdrv_open_image()

2015-05-08 Thread Kevin Wolf
Besides standardising on a single interface for opening child nodes, this patch allows the user to specify options to individual extent nodes. Overriding file names isn't possible with this yet, so it's of limited usefulness, but still a step forward. Signed-off-by: Kevin Wolf --- block/vmdk.c |

[Qemu-devel] [PATCH 11/34] block: Allow references for backing files

2015-05-08 Thread Kevin Wolf
For bs->file, using references to existing BDSes has been possible for a while already. This patch enables the same for bs->backing_hd. Signed-off-by: Kevin Wolf --- block.c | 42 -- block/mirror.c| 2 +- include/block/block.h | 3 +

[Qemu-devel] [PATCH 00/34] block: Cache mode for children, reopen overhaul and more

2015-05-08 Thread Kevin Wolf
First of all, sorry for the lengthy series that attacks more things than could fit in the subject line. However, for the most part the changes are hard to separate: Either it's just infrastructure without a user, or it's a user, but the infrastructure changes wouldn't be complete. The only indepen

[Qemu-devel] [PATCH 05/34] block: Use macro for cache option names

2015-05-08 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- blockdev.c| 24 include/block/block.h | 8 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/blockdev.c b/blockdev.c index 5eaf77e..77cbe72 100644 --- a/blockdev.c +++ b/blockdev.c @@ -391,13 +391,13 @@ st

[Qemu-devel] [PATCH 03/34] quorum: Use bdrv_open_image()

2015-05-08 Thread Kevin Wolf
Besides standardising on a single interface for opening child nodes, this simplifies the .bdrv_open() implementation of the quorum block driver by using block layer functionality for handling BlockdevRefs. Signed-off-by: Kevin Wolf --- block/quorum.c | 51 +++-

[Qemu-devel] [PATCH 10/34] block: Fix reopen flag inheritance

2015-05-08 Thread Kevin Wolf
When reopening an image, the block layer already takes care to reopen bs->file as well with recalculated inherited flags. The same must happen for any other child (most notably missing before this patch: backing files). If bs->file (or any other child) didn't originally inherit from bs, e.g. becau

[Qemu-devel] [PATCH 02/34] qdict: Add qdict_{set,copy}_default()

2015-05-08 Thread Kevin Wolf
In the block layer functions that determine options for a child block device, it's a common pattern to either copy options from the parent's options or to set a default string if the option isn't explicitly set yet for the child. Provide convenience functions so that it becomes a one-liner for each

[Qemu-devel] [PATCH 01/34] qdict: Add qdict_array_entries()

2015-05-08 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- include/qapi/qmp/qdict.h | 1 + qobject/qdict.c | 68 +--- 2 files changed, 65 insertions(+), 4 deletions(-) diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h index d68f4eb..d20db94 100644 --- a/in

Re: [Qemu-devel] [PATCH v3 4/7] qom: add object_new_propv / object_new_proplist constructors

2015-05-08 Thread Paolo Bonzini
On 08/05/2015 19:10, Andreas Färber wrote: >>Error *err = NULL; >>Object *obj; >>obj = object_new_propv(TYPE_MEMORY_BACKEND_FILE, >> "/objects", > > This is not an Object*. ;) I like it better as it's implemented below, > but cf. above for mixing this Error*

Re: [Qemu-devel] [PATCH v3 5/7] qom: make enum string tables const-correct

2015-05-08 Thread Andreas Färber
Am 01.05.2015 um 12:30 schrieb Daniel P. Berrange: > The enum string table parameters in various QOM/QAPI methods > are declared 'const char *strings[]'. This results in const > warnings if passed a variable that was declared as > >static const char * const strings[] = { }; > > Add the e

Re: [Qemu-devel] [PATCH 1/1] qtest: pre-buffer hex nibs

2015-05-08 Thread Markus Armbruster
John Snow writes: > Instead of converting each byte one-at-a-time and then sending each byte > over the wire, use sprintf() to pre-compute all of the hex nibs into a > single buffer, then send the entire buffer all at once. > > This gives a moderate speed boost to memread() and memwrite() functio

Re: [Qemu-devel] [PATCH v3 4/7] qom: add object_new_propv / object_new_proplist constructors

2015-05-08 Thread Andreas Färber
Hi Daniel/Paolo, Am 01.05.2015 um 12:30 schrieb Daniel P. Berrange: > It is reasonably common to want to create an object, set a > number of properties, register it in the hierarchy and then > mark it as complete (if a user creatable type). This requires > quite a lot of error prone, verbose, boil

Re: [Qemu-devel] [Qemu-block] [PATCH 6/7] qcow2: make qcow2_cache_put() a void function

2015-05-08 Thread Alberto Garcia
On Fri 08 May 2015 05:51:30 PM CEST, Max Reitz wrote: >> -int qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table) >> +void qcow2_cache_put(BlockDriverState *bs, Qcow2Cache *c, void **table) >> { >> int i = qcow2_cache_get_table_idx(bs, c, *table); >> >> -if (c->entrie

Re: [Qemu-devel] [Qemu-block] [PATCH 5/7] qcow2: use a hash to look for entries in the L2 cache

2015-05-08 Thread Alberto Garcia
On Fri 08 May 2015 05:46:57 PM CEST, Max Reitz wrote: > Let's assume the cache is full. Now this hash algorithm (direct mapped > cache) basically becomes futile, because the LRU algorithm (fully > associative cache) takes over That's right, although in that scenario I guess there's no good algori

Re: [Qemu-devel] [PATCH] qmp: Add qom-path field to query-cpus command

2015-05-08 Thread Eduardo Habkost
On Fri, May 08, 2015 at 04:46:42PM +0200, Andreas Färber wrote: > Am 08.05.2015 um 16:36 schrieb Eduardo Habkost: > > On Fri, May 08, 2015 at 08:51:45AM -0400, Luiz Capitulino wrote: > >> On Mon, 4 May 2015 16:09:58 -0300 > >> Eduardo Habkost wrote: > >> > >>> This will allow clients to query add

Re: [Qemu-devel] [PATCH v3 4/5] qtest: precompute hex nibs

2015-05-08 Thread John Snow
On 05/08/2015 02:25 AM, Markus Armbruster wrote: > Eric Blake writes: > >> On 05/06/2015 10:18 AM, John Snow wrote: >> To find out, add just buffering. Something like this in your patch instead of byte2hex(): for (i = 0; i < len; i++) { -qtest_send

Re: [Qemu-devel] [Qemu-block] [PATCH v3 01/10] qapi: Add transaction support to block-dirty-bitmap operations

2015-05-08 Thread John Snow
On 05/08/2015 09:17 AM, Max Reitz wrote: > On 08.05.2015 15:14, Stefan Hajnoczi wrote: >> On Thu, May 07, 2015 at 01:22:26PM -0400, John Snow wrote: >>> >>> On 05/07/2015 10:54 AM, Stefan Hajnoczi wrote: On Wed, Apr 22, 2015 at 08:04:44PM -0400, John Snow wrote: > +static void block_dirt

[Qemu-devel] [PATCH v2 3/6] Support Physical Presence Interface Spec

2015-05-08 Thread Stefan Berger
For automated management of a TPM device, implement the TCG Physical Presence Interface Specification that allows a root user on Linux (for example) to set an opcode for a sequence of TPM operations that the BIOS is supposed to execute upon reboot of the physical or virtual machine. A sequence of o

[Qemu-devel] [PATCH v2 1/6] Provide support for the CUSE TPM

2015-05-08 Thread Stefan Berger
Rather than integrating TPM functionality into QEMU directly using the TPM emulation of libtpms, we now integrate an external emulated TPM device. This device is expected to implement a Linux CUSE interface (CUSE = character device in userspace). QEMU talks to the CUSE TPM using much functionality

  1   2   3   4   >