Re: [Qemu-devel] [PATCH v5 04/14] qapi: Adjust names of implicit types

2016-03-10 Thread Markus Armbruster
Eric Blake writes: > On 03/10/2016 06:39 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> The original choice of ':obj-' as the prefix for implicit types >>> made it obvious that we weren't going to clash with any user-defined >>> names. But now we want to create structs for implicit

[Qemu-devel] [PATCH] input-linux: switch over to -object

2016-03-10 Thread Gerd Hoffmann
This patches makes input-linux use -object instead a new command line switch. So, instead of the switch ... -input-linux /dev/input/event$nr ... you must create an object this way: -object input-linux,id=$name,evdev=/dev/input/event$nr Bonus is that you can hot-add and hot-remove them

Re: [Qemu-devel] [PATCH] Introduce "xen-load-devices-state"

2016-03-10 Thread Markus Armbruster
Eric Blake writes: > On 03/10/2016 03:23 AM, Changlong Xie wrote: [...] >> +++ b/qapi-schema.json >> @@ -4122,3 +4122,21 @@ >> ## >> { 'enum': 'ReplayMode', >>'data': [ 'none', 'record', 'play' ] } >> + >> +## >> +# @xen-load-devices-state: >> +# >> +# Load the state of all devices from fil

Re: [Qemu-devel] [PATCH 1/2] i386: Prepare for interrupt remapping

2016-03-10 Thread Jan Kiszka
Hi Peter, On 2016-03-10 06:18, Peter Xu wrote: > Hi, Jan/Rita, > > Have not gone deeper... Got several comments and questions inline. > > On Wed, Mar 09, 2016 at 12:58:41AM +0530, Rita Sinha wrote: > > [...] > >> +static AddressSpace *get_dma_address_space(void) >> +{ >> +return &PC_MACHIN

Re: [Qemu-devel] [PATCH 2/2] i386: Interrupt remapping support for VT-d

2016-03-10 Thread Jan Kiszka
On 2016-03-10 06:28, Peter Xu wrote: > On Wed, Mar 09, 2016 at 12:58:17AM +0530, Rita Sinha wrote: >> From: Jan Kiszka >> >> Still a bit hacky, unconditionally enabled (must become opt-in, not >> available with in-kernel irqchip), not reporting faults properly - but >> it works! And revealed a Lin

Re: [Qemu-devel] [PATCH v1] migration: skip sending ram pages released by virtio-balloon driver.

2016-03-10 Thread Li, Liang Z
> On 3/10/2016 3:19 PM, Roman Kagan wrote: > > On Fri, Mar 04, 2016 at 02:32:47PM +0530, Jitendra Kolhe wrote: > >> Even though the pages which are returned to the host by > >> virtio-balloon driver are zero pages, the migration algorithm will > >> still end up scanning the entire page ram_find_and

Re: [Qemu-devel] [PATCH] Replacing (and removing) get_ticks_per_sec() function with NANOSECONDS_PER_SECOND Signed-off-by: Rutuja Shah

2016-03-10 Thread rutuja shah
Thanks Eric. I will keep these points in mind while sending patches. Regards Rutuja Shah On Fri, Mar 11, 2016 at 2:40 AM, Eric Blake wrote: > On 03/10/2016 12:30 PM, rutu.shah...@gmail.com wrote: >> From: Rutuja Shah >> > > Your commit message body was botched, cramming everything into the > su

Re: [Qemu-devel] [PATCH v4 1/5] replay: character devices

2016-03-10 Thread Pavel Dovgalyuk
> From: Paolo Bonzini [mailto:pbonz...@redhat.com] > On 10/03/2016 12:55, Pavel Dovgalyuk wrote: > > gdbstub which also acts as a backend is not recorded to allow controlling > > the replaying through gdb. > > Perhaps the monitor too? Right. I'll check that it works. > Overall the patch is nice

Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU

2016-03-10 Thread Neo Jia
On Fri, Mar 11, 2016 at 04:46:23AM +, Tian, Kevin wrote: > > From: Neo Jia [mailto:c...@nvidia.com] > > Sent: Friday, March 11, 2016 12:20 PM > > > > On Thu, Mar 10, 2016 at 11:10:10AM +0800, Jike Song wrote: > > > > > > >> Is it supposed to be the caller who should set > > > >> up IOMMU by DM

Re: [Qemu-devel] [PATCH v1] migration: skip sending ram pages released by virtio-balloon driver.

2016-03-10 Thread Jitendra Kolhe
On 3/10/2016 3:19 PM, Roman Kagan wrote: On Fri, Mar 04, 2016 at 02:32:47PM +0530, Jitendra Kolhe wrote: Even though the pages which are returned to the host by virtio-balloon driver are zero pages, the migration algorithm will still end up scanning the entire page ram_find_and_save_block() -> r

[Qemu-devel] [RFC PATCH v2 8/9] xics, xics_kvm: Handle CPU unplug correctly

2016-03-10 Thread Bharata B Rao
XICS is setup for each CPU during initialization. Provide a routine to undo the same when CPU is unplugged. While here, move ss->cs management into xics from xics_kvm since there is nothing KVM specific in it. Also ensure xics reset doesn't set irq for CPUs that are already unplugged. This allows

[Qemu-devel] [RFC PATCH v2 9/9] spapr: CPU hot unplug support

2016-03-10 Thread Bharata B Rao
Remove the CPU core device by removing the underlying CPU thread devices. Hot removal of CPU for sPAPR guests is achieved by sending the hot unplug notification to the guest. Release the vCPU object after CPU hot unplug so that vCPU fd can be parked and reused. Signed-off-by: Bharata B Rao --- h

[Qemu-devel] [RFC PATCH v2 7/9] spapr: CPU hotplug support

2016-03-10 Thread Bharata B Rao
Set up device tree entries for the hotplugged CPU core and use the exising RTAS event logging infrastructure to send CPU hotplug notification to the guest. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 64 ++ hw/ppc/spapr_cpu_core.c

[Qemu-devel] [RFC PATCH v2 3/9] cpu: Reclaim vCPU objects

2016-03-10 Thread Bharata B Rao
From: Gu Zheng In order to deal well with the kvm vcpus (which can not be removed without any protection), we do not close KVM vcpu fd, just record and mark it as stopped into a list, so that we can reuse it for the appending cpu hot-add request if possible. It is also the approach that kvm guys

[Qemu-devel] [RFC PATCH v2 6/9] spapr: CPU core device

2016-03-10 Thread Bharata B Rao
Add sPAPR specific CPU core device that is based on generic CPU core device. Creating this core device will result in creation of all the CPU thread devices that are part of this core. Introduce sPAPRMachineClass.dr_cpu_enabled to indicate support for CPU core hotplug. Initialize boot time CPUs as

[Qemu-devel] [RFC PATCH v2 4/9] cpu: Add a sync version of cpu_remove()

2016-03-10 Thread Bharata B Rao
This sync API will be used by the CPU hotplug code to wait for the CPU to completely get removed before flagging the failure to the device_add command. Sync version of this call is needed to correctly recover from CPU realization failures when ->plug() handler fails. Signed-off-by: Bharata B Rao

[Qemu-devel] [RFC PATCH v2 5/9] cpu: Abstract CPU core type

2016-03-10 Thread Bharata B Rao
Add an abstract CPU core type that could be used by machines that want to define and hotplug CPUs in core granularity. Signed-off-by: Bharata B Rao --- hw/cpu/Makefile.objs | 1 + hw/cpu/core.c | 87 +++ include/hw/cpu/core.h | 31 +++

[Qemu-devel] [RFC PATCH v2 0/9] Core based CPU hotplug for PowerPC sPAPR

2016-03-10 Thread Bharata B Rao
Hi, This is the next version of "Core based CPU hotplug for PowerPC sPAPR" that was posted at https://lists.gnu.org/archive/html/qemu-ppc/2016-03/msg00081.html device_add semantics For -smp 16,sockets=1,cores=2,threads=8,maxcpus=32 (qemu) device_add spapr-cpu-core,id=core2,co

[Qemu-devel] [RFC PATCH v2 2/9] exec: Do vmstate unregistration from cpu_exec_exit()

2016-03-10 Thread Bharata B Rao
cpu_exec_init() does vmstate_register for the CPU device. This needs to be undone from cpu_exec_exit(). This change is needed to support CPU hot removal. Signed-off-by: Bharata B Rao --- exec.c | 9 + 1 file changed, 9 insertions(+) diff --git a/exec.c b/exec.c index 49ae593..8ddca6b 10

[Qemu-devel] [RFC PATCH v2 1/9] exec: Remove cpu from cpus list during cpu_exec_exit()

2016-03-10 Thread Bharata B Rao
CPUState *cpu gets added to the cpus list during cpu_exec_init(). It should be removed from cpu_exec_exit(). cpu_exec_exit() is called from generic CPU::instance_finalize and some archs like PowerPC call it from CPU unrealizefn. So ensure that we dequeue the cpu only once. Now -1 value for cpu->c

Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU

2016-03-10 Thread Tian, Kevin
> From: Neo Jia [mailto:c...@nvidia.com] > Sent: Friday, March 11, 2016 12:20 PM > > On Thu, Mar 10, 2016 at 11:10:10AM +0800, Jike Song wrote: > > > > >> Is it supposed to be the caller who should set > > >> up IOMMU by DMA api such as dma_map_page(), after calling > > >> vgpu_dma_do_translate()?

Re: [Qemu-devel] info qtree command cause qemu ABORT!

2016-03-10 Thread hitmoon
在 2016年03月11日 11:14, Peter Maydell 写道: On 11 March 2016 at 10:08, hitmoon wrote: Peter: first launch following command: arm-softmmu/qemu-system-arm -M versatilepb -kernel ~/Qemu-ARM/vmlinuz-3.2.0-4-versatile -initrd ~/Qemu-ARM/initrd.img-3.2.0-4-versatile -hda ~/debian_wheezy_armel_standar

Re: [Qemu-devel] [RFC PATCH v2 3/3] VFIO: Type1 IOMMU mapping support for vGPU

2016-03-10 Thread Neo Jia
On Thu, Mar 10, 2016 at 11:10:10AM +0800, Jike Song wrote: > > >> Is it supposed to be the caller who should set > >> up IOMMU by DMA api such as dma_map_page(), after calling > >> vgpu_dma_do_translate()? > >> > > > > Don't think you need to call dma_map_page here. Once you have the pfn > > ava

Re: [Qemu-devel] [PULL 0/8] VFIO updates 2016-03-10

2016-03-10 Thread Alex Williamson
On Fri, 11 Mar 2016 08:24:51 +0700 Peter Maydell wrote: > On 10 March 2016 at 23:55, Alex Williamson wrote: > > The following changes since commit a648c137383d84bc4f95696e5293978d9541a26e: > > > > Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160309-1' > > into staging (2016-03-

Re: [Qemu-devel] [PULL 3/8] vfio: Generalize region support

2016-03-10 Thread Alex Williamson
On Thu, 10 Mar 2016 13:46:06 -0700 Eric Blake wrote: > On 03/10/2016 09:34 AM, Alex Williamson wrote: > > >>> +trace_vfio_msix_fixup(vdev->vbasedev.name, > >>> + vdev->msix->table_bar, > >>> region->mmaps[0].offset, > >>> + r

Re: [Qemu-devel] info qtree command cause qemu ABORT!

2016-03-10 Thread Peter Maydell
On 11 March 2016 at 10:08, hitmoon wrote: > Peter: > > first launch following command: > > arm-softmmu/qemu-system-arm -M versatilepb -kernel > ~/Qemu-ARM/vmlinuz-3.2.0-4-versatile -initrd > ~/Qemu-ARM/initrd.img-3.2.0-4-versatile -hda > ~/debian_wheezy_armel_standard.qcow2 -append 'root=/dev/sda

[Qemu-devel] info qtree command cause qemu ABORT!

2016-03-10 Thread hitmoon
Peter: first launch following command: arm-softmmu/qemu-system-arm -M versatilepb -kernel ~/Qemu-ARM/vmlinuz-3.2.0-4-versatile -initrd ~/Qemu-ARM/initrd.img-3.2.0-4-versatile -hda ~/debian_wheezy_armel_standard.qcow2 -append 'root=/dev/sda1' Then execute 'info qtree' in the monitor, qemu a

[Qemu-devel] [Bug 1246890] Re: AC97 sound card crashes QEMU

2016-03-10 Thread John Arbuckle
Turns out this problem was with another program called AudioJack. It interferes with QEMU and prevents sound from working. Uninstalling AudioJack made the AC97 sound card work again under Mac OS 10.6. ** Changed in: qemu Status: New => Fix Committed -- You received this bug notification b

Re: [Qemu-devel] [RFC qemu 0/4] A PV solution for live migration optimization

2016-03-10 Thread Li, Liang Z
> > Hi, > I'm just catching back up on this thread; so without reference to any > particular previous mail in the thread. > > 1) How many of the free pages do we tell the host about? > Your main change is telling the host about all the > free pages. Yes, all the guest's free pages.

[Qemu-devel] [PATCH v4 4/4] hw/input/adb.c: implement QKeyCode support

2016-03-10 Thread Programmingkid
Remove the old pc_to_adb_keycode array and replace it with QKeyCode support. Signed-off-by: John Arbuckle --- Some of the keys do not translate as logically as we would think they would. For example the Q_KEY_CODE_CTRL_R does not work with ADB_KEY_RIGHT_CONTROL. The wrong key would show up in the

[Qemu-devel] [PATCH v4 3/4] adb-keys.h: initial commit

2016-03-10 Thread Programmingkid
This commit implements the adb-keys.h file. It holds information on adb keycode values. Signed-off-by: John Arbuckle --- * v4 changes Replaced an 'a' with 'an'. Replaced __ADBKEYS__ with ADB_KEYS_H. Added additional information comment with link. Changed license to GNU GPL v2 or later. * v3 chan

[Qemu-devel] [PATCH v4 2/4] qapi-schema.json: Add power and keypad equal keys

2016-03-10 Thread Programmingkid
Add the power and keypad equal keys. These keys are found on a real Macintosh keyboard. Signed-off-by: John Arbuckle --- qapi-schema.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qapi-schema.json b/qapi-schema.json index 362c9d8..cbc3576 100644 --- a/qapi-schema.jso

[Qemu-devel] [PATCH v4 1/4] ui/cocoa.m: switch to QKeyCode

2016-03-10 Thread Programmingkid
This patch removes the pc/xt keycode map and replaces it with the QKeyCode keymap. Signed-off-by: John Arbuckle --- v3 changes Removed the LARGEST_KEYCODE marco. Changed macToQKeyCodeMap to mac_to_qkeycode_map. ui/cocoa.m | 317 +++-- 1 fi

[Qemu-devel] [PATCH v4 0/4] Implement some QKeyCode support

2016-03-10 Thread Programmingkid
This patchset adds QKeyCode support the adb and cocoa code. Note: you do not need to be on a Mac to test out the adb.c, qapi-schema.json, and adb-keys.h files. Only the cocoa.m file changes are Mac specific. If you are using Linux as a guest, then the xev command is what you could use to test ou

Re: [Qemu-devel] [PATCH v1] migration: skip sending ram pages released by virtio-balloon driver.

2016-03-10 Thread Jitendra Kolhe
On 3/10/2016 10:57 PM, Eric Blake wrote: On 03/10/2016 01:57 AM, Jitendra Kolhe wrote: +++ b/qapi-schema.json @@ -544,11 +544,14 @@ # been migrated, pulling the remaining pages along as needed. NOTE: If # the migration fails during postcopy the VM will fail. (since 2.5)

[Qemu-devel] [PATCH v2] usb: fix unbounded stack warning for xhci_dma_write_u32s

2016-03-10 Thread Peter Xu
All the callers for xhci_dma_write_u32s() are using mostly 5 * uint32_t in len. To avoid unbound stack warning for the function, make it statically allocated, and assert when it's not big enough in the future. Signed-off-by: Peter Xu --- hw/usb/hcd-xhci.c | 6 -- 1 file changed, 4 insertions

Re: [Qemu-devel] [PATCH] usb: fix unbounded stack warning for xhci_dma_write_u32s

2016-03-10 Thread Peter Xu
On Thu, Mar 10, 2016 at 10:21:45AM +0100, Gerd Hoffmann wrote: > On Do, 2016-03-10 at 15:56 +0800, Peter Xu wrote: > > As mentioned in previous thread, because all the callers of > > xhci_dma_write_u32s() are using const size in "len". The maximum > > currently is 5 * sizeof(uint32_t) = 20 bytes >

Re: [Qemu-devel] [PATCH] quorum: Fix crash in quorum_aio_cb()

2016-03-10 Thread Wen Congyang
On 03/10/2016 08:13 PM, Alberto Garcia wrote: > quorum_aio_cb() emits the QUORUM_REPORT_BAD event if there's > an I/O error in a Quorum child. However sacb->aiocb must be > correctly initialized for this to happen. read_quorum_children() and > read_fifo_child() are not doing this, which results in

Re: [Qemu-devel] [PATCH] Introduce "xen-load-devices-state"

2016-03-10 Thread Changlong Xie
On 03/11/2016 04:31 AM, Eric Blake wrote: On 03/10/2016 03:23 AM, Changlong Xie wrote: From: Wen Congyang Introduce a "xen-load-devices-state" QAPI command that can be used to load the state of all devices, but not the RAM or the block devices of the VM. We only have hmp commands savevm/loadv

Re: [Qemu-devel] [PULL 0/8] VFIO updates 2016-03-10

2016-03-10 Thread Peter Maydell
On 10 March 2016 at 23:55, Alex Williamson wrote: > The following changes since commit a648c137383d84bc4f95696e5293978d9541a26e: > > Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160309-1' into > staging (2016-03-10 02:51:14 +) > > are available in the git repository at: > > >

Re: [Qemu-devel] [PATCH v12 1/3] Add new block driver interface to add/delete a BDS's child

2016-03-10 Thread Changlong Xie
On 03/10/2016 10:57 PM, Alberto Garcia wrote: On Thu 10 Mar 2016 03:49:39 AM CET, Changlong Xie wrote: From: Wen Congyang In some cases, we want to take a quorum child offline, and take another child online. Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Si

Re: [Qemu-devel] [PATCH v3 10/12] i.MX: Add the Freescale SPI Controller

2016-03-10 Thread Peter Maydell
On 11 March 2016 at 02:26, Jean-Christophe DUBOIS wrote: > Le 10/03/2016 11:31, Peter Maydell a écrit : >> Calling qemu_set_irq() from a reset function is generally >> a bad idea. > > > Could I assume that all irq lines are set automatically to 0 on reset? The way this works is that an irq line h

Re: [Qemu-devel] [PATCH v3 12/12] i.MX: Add sabrelite i.MX6 emulation.

2016-03-10 Thread Peter Maydell
On 11 March 2016 at 02:24, Jean-Christophe DUBOIS wrote: > Le 10/03/2016 11:38, Peter Maydell a écrit : >> >> On 2 March 2016 at 05:27, Jean-Christophe Dubois >> wrote: >>> >>> The sabrelite supports one SPI FLASH memory on SPI1 >>> >>> Signed-off-by: Jean-Christophe Dubois >>> --- >>> >>> + >>>

Re: [Qemu-devel] [Qemu-ppc] [PATCH 72/77] ppc: A couple more dummy POWER8 Book4 regs

2016-03-10 Thread Cédric Le Goater
On 03/10/2016 07:01 PM, Thomas Huth wrote: > On 09.03.2016 22:17, Thomas Huth wrote: >> On 09.03.2016 21:04, Cédric Le Goater wrote: > >>> I have been maintaining a port of Ben's patchset on the latest qemu for >>> other >>> parts which should come after pnv is merged so I have a framework t

Re: [Qemu-devel] [PATCH] Replacing (and removing) get_ticks_per_sec() function with NANOSECONDS_PER_SECOND Signed-off-by: Rutuja Shah

2016-03-10 Thread Eric Blake
On 03/10/2016 12:30 PM, rutu.shah...@gmail.com wrote: > From: Rutuja Shah > Your commit message body was botched, cramming everything into the subject line. Be sure you have a one-line summary (preferably shorter than 60 characters), then a blank line, before the rest of your description and S-

[Qemu-devel] [PATCH] Replacing (and removing) get_ticks_per_sec() function with NANOSECONDS_PER_SECOND Signed-off-by: Rutuja Shah

2016-03-10 Thread rutu . shah . 26
From: Rutuja Shah --- audio/audio.c | 2 +- audio/noaudio.c | 4 ++-- audio/spiceaudio.c| 2 +- audio/wavaudio.c | 2 +- backends/baum.c | 2 +- block/qed.c | 2 +- cpus.c| 6 +++--- hw/acpi/core.c

[Qemu-devel] [PATCH] Replaced get_ticks_per_sec calls with NANOSECONDS_PER_SECOND

2016-03-10 Thread rutuja shah
Hi, As there are no callers to get_ticks_per_sec() function, definition of this function could be removed completely? --- backends/baum.c | 2 +- block/qed.c | 2 +- cpus.c| 6 +++--- hw/acpi/core.c| 4 ++-- hw/arm/omap1.c| 14

Re: [Qemu-devel] [PATCH v5 13/14] qapi: Allow anonymous base for flat union

2016-03-10 Thread Eric Blake
On 03/10/2016 01:22 PM, Markus Armbruster wrote: > Eric Blake writes: > >> Rather than requiring all flat unions to explicitly create >> a separate base struct, we can allow the qapi schema to specify >> the common members via an inline dictionary. This is similar to >> how commands can specify a

Re: [Qemu-devel] [PULL 3/8] vfio: Generalize region support

2016-03-10 Thread Eric Blake
On 03/10/2016 09:34 AM, Alex Williamson wrote: >>> +trace_vfio_msix_fixup(vdev->vbasedev.name, >>> + vdev->msix->table_bar, >>> region->mmaps[0].offset, >>> + region->mmaps[0].offset + >>> region->mmaps[0].size); >> Sorry th

Re: [Qemu-devel] [PATCH v1 21/21] error: ensure errno detail is printed with error_abort

2016-03-10 Thread Markus Armbruster
"Daniel P. Berrange" writes: > On Thu, Mar 10, 2016 at 09:55:37AM +0100, Markus Armbruster wrote: >> "Daniel P. Berrange" writes: >> >> > When &error_abort is passed in, the error reporting code >> > will print the current error message and then abort() the >> > process. Unfortunately at the ti

Re: [Qemu-devel] [PATCH v5 00/14] easier unboxed visits/qapi implicit types

2016-03-10 Thread Markus Armbruster
I finished review. I'll look over it tomorrow to decide whether I can take it with minor tweaks, or whether we need v6. I'm hopeful :)

Re: [Qemu-devel] [PATCH v2 2/4] monitor: Separate QUORUM_REPORT_BAD events according to the node name

2016-03-10 Thread Eric Blake
On 03/10/2016 04:55 AM, Alberto Garcia wrote: > The QUORUM_REPORT_BAD event is emitted whenever there's an I/O error > in a child of a Quorum device. This event is emitted at a maximum rate > of 1 per second. This means that an error in one of the children will > mask errors in the other children i

Re: [Qemu-devel] [PATCH] Introduce "xen-load-devices-state"

2016-03-10 Thread Eric Blake
On 03/10/2016 03:23 AM, Changlong Xie wrote: > From: Wen Congyang > > Introduce a "xen-load-devices-state" QAPI command that can be used to load > the state of all devices, but not the RAM or the block devices of the > VM. > > We only have hmp commands savevm/loadvm, and qmp commands > xen-save-

Re: [Qemu-devel] [PATCH v1] hw: fix error reporting for missing option ROMs

2016-03-10 Thread Eric Blake
On 03/10/2016 10:28 AM, Daniel P. Berrange wrote: > If QEMU fails to load any of the VGA ROMs, it prints a message > to stderr and then carries on as if everything was fine, despite > the VGA interface not being functional. This extends the the > rom_add_file() method to accept a 'Error **errp' par

Re: [Qemu-devel] [PATCH v5 13/14] qapi: Allow anonymous base for flat union

2016-03-10 Thread Markus Armbruster
Eric Blake writes: > Rather than requiring all flat unions to explicitly create > a separate base struct, we can allow the qapi schema to specify > the common members via an inline dictionary. This is similar to > how commands can specify an inline anonymous type for its 'data'. > We already have

Re: [Qemu-devel] [PATCH v5 07/14] qapi: Utilize implicit struct visits

2016-03-10 Thread Eric Blake
On 03/10/2016 12:05 PM, Markus Armbruster wrote: > Eric Blake writes: > >> Rather than generate inline per-member visits, take advantage >> of the 'visit_type_FOO_members()' function for both event and >> command marshalling. This is possible now that implicit >> structs can be visited like any

Re: [Qemu-devel] [PATCH v5 06/14] qapi-event: Slightly shrink generated code

2016-03-10 Thread Eric Blake
On 03/10/2016 11:50 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Slightly rearrange the code in gen_event_send() for less generated >> output, by initializing 'emit' sooner, deferring an assertion >> to qdict_put_obj, and dropping a now-unused 'obj' local variable. >> >> While at it, do

Re: [Qemu-devel] [PATCH v3 09/12] FIFO: Add a FIFO32 implementation

2016-03-10 Thread Jean-Christophe DUBOIS
Le 10/03/2016 11:25, Peter Maydell a écrit : On 2 March 2016 at 05:27, Jean-Christophe Dubois wrote: This one is build on top of the existing FIFO8 Signed-off-by: Jean-Christophe Dubois --- Changes since v1: * None Changes since v2: * Added copyright * define Fifo32 as a struct contai

Re: [Qemu-devel] [PATCH v3 10/12] i.MX: Add the Freescale SPI Controller

2016-03-10 Thread Jean-Christophe DUBOIS
Le 10/03/2016 11:31, Peter Maydell a écrit : On 2 March 2016 at 05:27, Jean-Christophe Dubois wrote: Signed-off-by: Jean-Christophe Dubois --- + +static void imx_spi_reset(DeviceState *dev) +{ +IMXSPIState *s = IMX_SPI(dev); +int i; + +DPRINTF("\n"); + +memset(s->regs, 0, size

Re: [Qemu-devel] [PATCH v3 12/12] i.MX: Add sabrelite i.MX6 emulation.

2016-03-10 Thread Jean-Christophe DUBOIS
Le 10/03/2016 11:38, Peter Maydell a écrit : On 2 March 2016 at 05:27, Jean-Christophe Dubois wrote: The sabrelite supports one SPI FLASH memory on SPI1 Signed-off-by: Jean-Christophe Dubois --- + +{ +/* Add the sst25vf016b NOR FLASH memory to first SPI */ +Object *spi_de

[Qemu-devel] [PATCH v3 06/10] acl: delete existing ACL implementation

2016-03-10 Thread Daniel P. Berrange
The 'qemu_acl' type was a previous non-QOM based attempt to provide an authorization facility in QEMU. Because it is non-QOM based it cannot be created via the command line and requires special monitor commands to manipulate it. The new QAuthZ and QAuthZSimple QOM classes provide a superset of the

Re: [Qemu-devel] [PATCH v5 07/14] qapi: Utilize implicit struct visits

2016-03-10 Thread Markus Armbruster
Eric Blake writes: > Rather than generate inline per-member visits, take advantage > of the 'visit_type_FOO_members()' function for both event and > command marshalling. This is possible now that implicit > structs can be visited like any other. > > Generated code shrinks accordingly; events ini

[Qemu-devel] [PATCH v3 08/10] nbd: allow an ACL to be set with nbd-server-start QMP command

2016-03-10 Thread Daniel P. Berrange
As with the previous patch to qemu-nbd, the nbd-server-start QMP command also needs to be able to specify an ACL when enabling TLS encryption. First the client must create a QAuthZ object instance using the 'object-add' command: { 'execute': 'object-add', 'arguments': { 'qom-t

[Qemu-devel] [PATCH v3 09/10] chardev: add support for ACLs for TLS clients

2016-03-10 Thread Daniel P. Berrange
Currently any client which can complete the TLS handshake is able to use a chardev server. The server admin can turn on the 'verify-peer' option for the x509 creds to require the client to provide a x509 certificate. This means the client will have to acquire a certificate from the CA before they a

[Qemu-devel] [PATCH v3 10/10] vnc: allow specifying a custom ACL object name

2016-03-10 Thread Daniel P. Berrange
The VNC server has historically had support for ACLs to check both the SASL username and the TLS x509 distinguished name. The VNC server was responsible for creating the initial ACL, and the client app was then responsible for populating it with rules using the HMP 'acl_add' command. This is not s

[Qemu-devel] [PATCH v3 04/10] util: add QAuthZ object as an authorization base class

2016-03-10 Thread Daniel P. Berrange
The current qemu_acl module provides a simple access control list facility inside QEMU, which is used via a set of monitor commands acl_show, acl_policy, acl_add, acl_remove & acl_reset. Note there is no ability to create ACLs - the network services (eg VNC server) were expected to create ACLs tha

[Qemu-devel] [PATCH v3 07/10] qemu-nbd: add support for ACLs for TLS clients

2016-03-10 Thread Daniel P. Berrange
Currently any client which can complete the TLS handshake is able to use the NBD server. The server admin can turn on the 'verify-peer' option for the x509 creds to require the client to provide a x509 certificate. This means the client will have to acquire a certificate from the CA before they are

[Qemu-devel] [PATCH v3 05/10] util: add QAuthZSimple object type for a simple access control list

2016-03-10 Thread Daniel P. Berrange
Add a QAuthZSimple object type that implements the QAuthZ interface. This simple built-in implementation maintains a trivial access control list with a sequence of match rules and a final default policy. This replicates the functionality currently provided by the qemu_acl module. To create an inst

[Qemu-devel] [PATCH v3 01/10] qdict: implement a qdict_crumple method for un-flattening a dict

2016-03-10 Thread Daniel P. Berrange
The qdict_flatten() method will take a dict whose elements are further nested dicts/lists and flatten them by concatenating keys. The qdict_crumple() method aims to do the reverse, taking a flat qdict, and turning it into a set of nested dicts/lists. It will apply nesting based on the key name, wi

[Qemu-devel] [PATCH v3 03/10] qom: support arbitrary non-scalar properties with -object

2016-03-10 Thread Daniel P. Berrange
The current -object command line syntax only allows for creation of objects with scalar properties, or a list with a fixed scalar element type. Objects which have properties that are represented as structs in the QAPI schema cannot be created using -object. This is a design limitation of the way t

[Qemu-devel] [PATCH v3 02/10] qapi: allow QmpInputVisitor to auto-cast types

2016-03-10 Thread Daniel P. Berrange
Currently the QmpInputVisitor assumes that all scalar values are directly represented as their final types. ie it assumes an 'int' is using QInt, and a 'bool' is using QBool. This extends it so that QString is optionally permitted for any of the non-string scalar types. This behaviour is turned on

[Qemu-devel] [PATCH v3 00/10] Provide a QOM-based authorization API

2016-03-10 Thread Daniel P. Berrange
Many years ago I was responsible for adding the 'qemu_acl' type and associated HMP commands. Looking back at it now, it is quite a poor facility with a couple of bad limitations. First, the responsibility for creating the ACLs was left with the QEMU network service (VNC server was only thing ever d

Re: [Qemu-devel] [PATCH v5 06/14] qapi-event: Slightly shrink generated code

2016-03-10 Thread Markus Armbruster
Eric Blake writes: > Slightly rearrange the code in gen_event_send() for less generated > output, by initializing 'emit' sooner, deferring an assertion > to qdict_put_obj, and dropping a now-unused 'obj' local variable. > > While at it, document a FIXME related to the potential for a > compiler n

[Qemu-devel] [PATCH v3] block/gluster: add support for SEEK_DATA/SEEK_HOLE

2016-03-10 Thread Niels de Vos
GlusterFS 3.8 contains support for SEEK_DATA and SEEK_HOLE. This makes it possible to detect sparse areas in files. Signed-off-by: Niels de Vos --- Tested by compiling and running "qemu-img map gluster://..." with a build of the current master branch of glusterfs. Using a Fedora cloud image (in

Re: [Qemu-devel] [PATCH v3 25/27] migration: add support for encrypting data with TLS

2016-03-10 Thread Dr. David Alan Gilbert
* Daniel P. Berrange (berra...@redhat.com) wrote: > This extends the migration_set_incoming_channel and > migration_set_outgoing_channel methods so that they > will automatically wrap the QIOChannel in a > QIOChannelTLS instance if TLS credentials are configured > in the migration parameters. Revi

[Qemu-devel] KVM Forum 2016: Call For Participation

2016-03-10 Thread Paolo Bonzini
= KVM Forum 2016: Call For Participation August 24-26, 2016 - Westin Harbor Castle - Toronto, Canada (All submissions must be received before midnight May 1, 2016) = KVM

Re: [Qemu-devel] [Qemu-ppc] [PATCH 72/77] ppc: A couple more dummy POWER8 Book4 regs

2016-03-10 Thread Thomas Huth
On 09.03.2016 22:17, Thomas Huth wrote: > On 09.03.2016 21:04, Cédric Le Goater wrote: >> I have been maintaining a port of Ben's patchset on the latest qemu for >> other >> parts which should come after pnv is merged so I have a framework to test >> such >> sub-patchsets. I also have time

Re: [Qemu-devel] [PATCH v4 2/8] pc: move igd support code to igd.c

2016-03-10 Thread Kay, Allen M
> -Original Message- > From: Tian, Kevin > Sent: Wednesday, March 09, 2016 9:56 PM > To: Gerd Hoffmann > Cc: Alex Williamson ; Stefano Stabellini > ; xen-de...@lists.xensource.com; igvt- > g...@ml01.01.org; Michael S. Tsirkin ; open list:All patches > CC here ; Kay, Allen M > Subject: R

Re: [Qemu-devel] [PATCH v3 24/27] migration: define 'tls-creds' and 'tls-hostname' migration parameters

2016-03-10 Thread Daniel P. Berrange
On Thu, Mar 10, 2016 at 05:42:45PM +, Dr. David Alan Gilbert wrote: > * Daniel P. Berrange (berra...@redhat.com) wrote: > > Define two new migration parameters to be used with TLS encryption. > > The 'tls-creds' parameter provides the ID of an instance of the > > 'tls-creds' object type, or rat

Re: [Qemu-devel] [PATCH v3 24/27] migration: define 'tls-creds' and 'tls-hostname' migration parameters

2016-03-10 Thread Dr. David Alan Gilbert
* Daniel P. Berrange (berra...@redhat.com) wrote: > Define two new migration parameters to be used with TLS encryption. > The 'tls-creds' parameter provides the ID of an instance of the > 'tls-creds' object type, or rather a subclass such as 'tls-creds-x509'. > Providing these credentials will enab

Re: [Qemu-devel] [PATCH v2 0/6] external backup api

2016-03-10 Thread Paolo Bonzini
On 10/03/2016 18:37, Stefan Hajnoczi wrote: > I suggest giving the new NBD command a "type" argument: > 0 - SCSI mapped/anchored values according to SCSI Get LBA Status > 1 - Dirty/clean, useful for incremental backup and other blocking tracking > cases > > This way we don't impinge on SCSI sem

[Qemu-devel] [PATCH v1] hw: fix error reporting for missing option ROMs

2016-03-10 Thread Daniel P. Berrange
If QEMU fails to load any of the VGA ROMs, it prints a message to stderr and then carries on as if everything was fine, despite the VGA interface not being functional. This extends the the rom_add_file() method to accept a 'Error **errp' parameter. The VGA device realizefn() impls can now pass in t

Re: [Qemu-devel] [PATCH v2 00/18] Multiple fixes & improvements to QIOChannel & Win32

2016-03-10 Thread Paolo Bonzini
On 10/03/2016 18:26, Daniel P. Berrange wrote: > This series started out as an attempt to fix the Win32 problems > identified by Andrew Baumann > >https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg01343.html > > It turned into a significantly larger cleanup of some chardev > and osdep

Re: [Qemu-devel] [PATCH v2 0/6] external backup api

2016-03-10 Thread Stefan Hajnoczi
On Mon, Feb 29, 2016 at 9:42 AM, Paolo Bonzini wrote: > > > On 29/02/2016 09:54, Paolo Bonzini wrote: >> >> >> On 29/02/2016 09:14, Markus Armbruster wrote: >>> I completely agree with you that Get LBA Status cannot just reflect the >>> top layer. But that's not what I meant to propose. Let me t

[Qemu-devel] [PATCH v2 15/18] char: remove socket_try_connect method

2016-03-10 Thread Daniel P. Berrange
The qemu_chr_open_socket_fd() method multiplexes three different actions into one method. The socket_try_connect() method is one of its callers, but it only ever want one specific action performed. By inlining that action into socket_try_connect() we see that there is not in fact any failure scenar

[Qemu-devel] [PATCH v2 14/18] char: remove qemu_chr_finish_socket_connection method

2016-03-10 Thread Daniel P. Berrange
The qemu_chr_finish_socket_connection method is multiplexing two different actions into one method. Each caller of it though, only wants one specific action. The code is shorter & clearer if we thus remove the method and just inline the specific actions where needed. Signed-off-by: Daniel P. Berra

[Qemu-devel] [PATCH v2 17/18] osdep: add wrappers for socket functions

2016-03-10 Thread Daniel P. Berrange
The windows socket functions look identical to the normal POSIX sockets functions, but instead of setting errno, the caller needs to call WSAGetLastError(). QEMU has tried to deal with this incompatibility by defining a socket_error() method that callers must use that abstracts the difference betwe

[Qemu-devel] [PATCH v2 04/18] io: bind to socket before creating QIOChannelSocket

2016-03-10 Thread Daniel P. Berrange
In the QIOChannelSocket test we create a socket file descriptor and then try to create a QIOChannelSocket. This works on Linux, but fails on Win32 because it is not valid to call getsockname() on an unbound socket. Reviewed-by: Paolo Bonzini Signed-off-by: Daniel P. Berrange --- tests/test-io-c

[Qemu-devel] [PATCH v2 10/18] io: introduce qio_channel_create_socket_watch

2016-03-10 Thread Daniel P. Berrange
From: Paolo Bonzini Sockets are not in the same namespace as file descriptors on Windows. As an initial step, introduce separate APIs for file descriptor and socket watches. Signed-off-by: Paolo Bonzini --- include/io/channel-watch.h | 20 +++- io/channel-socket.c| 6 +

Re: [Qemu-devel] [PATCH] Replaced get_ticks_per_sec calls with NANOSECONDS_PER_SECOND

2016-03-10 Thread Paolo Bonzini
On 10/03/2016 18:22, rutuja shah wrote: > Hi, > As there are no callers to get_ticks_per_sec() function, definition of > this function could be removed completely? Yes, please. > diff --git a/backends/baum.c b/backends/baum.c > index c11320e..20b49f2 100644 > --- a/backends/baum.c > +++ b/backe

[Qemu-devel] [PATCH v2 11/18] io: use qemu_accept to ensure SOCK_CLOEXEC is set

2016-03-10 Thread Daniel P. Berrange
The QIOChannelSocket code mistakenly uses the bare accept() function which does not set SOCK_CLOEXEC. Signed-off-by: Daniel P. Berrange --- io/channel-socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io/channel-socket.c b/io/channel-socket.c index 775bb9f..9b5f2d8

[Qemu-devel] [PATCH v2 18/18] osdep: remove use of socket_error() from all code

2016-03-10 Thread Daniel P. Berrange
Now that QEMU wraps the Win32 sockets methods to automatically set errno upon failure, there is no reason for callers to use the socket_error() method. They can rely on accessing errno even on Win32. Remove all use of socket_error() from general code, leaving it as a static method in oslib-win32.c

[Qemu-devel] [PATCH v2 16/18] char: remove qemu_chr_open_socket_fd method

2016-03-10 Thread Daniel P. Berrange
The qemu_chr_open_socket_fd method takes care of either doing a synchronous socket connect, or creating a listener socket. Part of the work when creating the listener socket is to register a watch for incoming clients. The caller of qemu_chr_open_socket_fd may not want this watch created, as it mig

[Qemu-devel] [PATCH v2 06/18] io: set correct error object in background reader test thread

2016-03-10 Thread Daniel P. Berrange
The reader thread was accidentally setting the error pointer intended for the writer thread. If both threads set errors this would result in QEMU abort'ing due to the error already being set. Reviewed-by: Paolo Bonzini Signed-off-by: Daniel P. Berrange --- tests/io-channel-helpers.c | 2 +- 1 f

[Qemu-devel] [PATCH v2 12/18] io: remove checking of EWOULDBLOCK

2016-03-10 Thread Daniel P. Berrange
Since we now canonicalize WSAEWOULDBLOCK into EAGAIN there is no longer any need to explicitly check EWOULDBLOCK for Win32. Signed-off-by: Daniel P. Berrange --- io/channel-command.c | 6 ++ io/channel-file.c| 6 ++ io/channel-socket.c | 6 ++ 3 files changed, 6 insertions(+), 1

[Qemu-devel] [PATCH v2 13/18] io: implement socket watch for win32 using WSAEventSelect+select

2016-03-10 Thread Daniel P. Berrange
From: Paolo Bonzini On Win32 we cannot directly poll on socket handles. Instead we create a Win32 event object and associate the socket handle with the event. When the event signals readyness we then have to use select to determine which events are ready. Creating Win32 events is moderately heavy

[Qemu-devel] [PATCH v2 08/18] io: fix copy+paste mistake in socket error message

2016-03-10 Thread Daniel P. Berrange
s/write/read/ in the error message reported after readmsg() fails Reviewed-by: Paolo Bonzini Signed-off-by: Daniel P. Berrange --- io/channel-socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io/channel-socket.c b/io/channel-socket.c index bf66a78..5f087e6 100644 ---

[Qemu-devel] [PATCH v2 02/18] io: use bind() to check for IPv4/6 availability

2016-03-10 Thread Daniel P. Berrange
Currently the test-io-channel-socket.c test uses getifaddrs to see if an IPv4/6 address is present on any host NIC, as a way to determine if IPv4/6 sockets can be used. This is problematic because getifaddrs is not available on Win32. Rather than testing indirectly via getifaddrs, just create a so

[Qemu-devel] [PATCH v2 09/18] io: pass HANDLE to g_source_add_poll on Win32

2016-03-10 Thread Daniel P. Berrange
From: Paolo Bonzini Reviewed-by: Daniel P. Berrange Signed-off-by: Paolo Bonzini --- io/channel-watch.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/io/channel-watch.c b/io/channel-watch.c index 931fa4d..5373605 100644 --- a/io/channel-watch.c +++ b/io/cha

[Qemu-devel] [PATCH v2 03/18] io: initialize sockets in test program

2016-03-10 Thread Daniel P. Berrange
The win32 sockets layer requires that socket_init() is called otherwise nothing will work. Reviewed-by: Paolo Bonzini Signed-off-by: Daniel P. Berrange --- tests/test-io-channel-socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-s

  1   2   3   >