[Qemu-devel] [PULL 3/7] gtk: fix unchecked vc dereference

2016-06-03 Thread Gerd Hoffmann
Spotted by Coverity. Cc: Paolo Bonzini Signed-off-by: Gerd Hoffmann Message-id: 1463737748-1062-1-git-send-email-kra...@redhat.com --- ui/gtk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/gtk.c b/ui/gtk.c index 7572cec..01b8216 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @

[Qemu-devel] [PULL 0/7] ui patch queue

2016-06-03 Thread Gerd Hoffmann
g (2016-06-02 14:26:57 +0100) are available in the git repository at: git://git.kraxel.org/qemu tags/pull-ui-20160603-1 for you to fetch changes up to c5ce83334465ee5acb6789a2f22d125273761c9e: vnc: add configurable keyboard delay (2016-06-03 08:2

[Qemu-devel] [PULL 5/7] vnc: Add support for color map

2016-06-03 Thread Gerd Hoffmann
From: Alexander Graf Our current VNC code does not handle color maps (aka non-true-color) at all and aborts if a client requests them. There are 2 major issues with this: 1) A VNC viewer on an 8-bit X11 system may request color maps 2) RealVNC _always_ starts requesting color maps, then moves

[Qemu-devel] [PULL 6/7] sdl2: skip init without outputs

2016-06-03 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Tested-by: Cole Robinson Message-id: 1464790116-32405-1-git-send-email-kra...@redhat.com --- ui/sdl2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/sdl2.c b/ui/sdl2.c index 909038f..30d2a3c 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -794,6 +794,9 @@ void

[Qemu-devel] [PULL 4/7] SDL2: add bgrx pixel format

2016-06-03 Thread Gerd Hoffmann
From: Pavel Dovgalyuk This patch adds support of b8g8r8x8 pixel format for SDL2. Signed-off-by: Pavel Dovgalyuk Message-id: 20160517072848.4540.34695.stgit@PASHA-ISP Signed-off-by: Gerd Hoffmann --- ui/sdl2-2d.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/sdl2-2d.c b/ui/sdl2-2d.

[Qemu-devel] [PULL 1/7] ui: egl: Replace fprintf with error_report

2016-06-03 Thread Gerd Hoffmann
From: Cole Robinson Signed-off-by: Cole Robinson Reviewed-by: Eric Blake Reviewed-by: Marc-André Lureau Message-id: c880920f6e40a506394d89dbbe1f67c63d359c17.1463588606.git.crobi...@redhat.com Signed-off-by: Gerd Hoffmann --- ui/egl-helpers.c | 27 ++- 1 file changed,

Re: [Qemu-devel] [RFC PATCH v1 2/3] spapr: Remove alignment gap b/n RAM and hotplug regions

2016-06-03 Thread David Gibson
On Fri, Jun 03, 2016 at 11:19:43AM +0530, Bharata B Rao wrote: > Let the alignment b/n RAM and memory hotplug region be equal to > LMB size (256MB) so that there is no gap b/n RAM and hotplug region. > This new alignment is true for only pseries-2.7 onwards and the older > machine types continue to

[Qemu-devel] [PULL 7/7] vnc: add configurable keyboard delay

2016-06-03 Thread Gerd Hoffmann
Limits the rate kbd events from the vnc server are forwarded to the guest, so input devices which are typically low-bandwidth can keep up even on bulky input. v2: update documentation too. v3: spell fixes. Signed-off-by: Gerd Hoffmann Tested-by: Yang Hongyang Message-id: 1464762150-25817-1-git-

Re: [Qemu-devel] [Qemu-ppc] [PULL 04/12] ppc: tlbie, tlbia and tlbisync are HV only

2016-06-03 Thread David Gibson
On Thu, Jun 02, 2016 at 09:47:01AM +0100, Mark Cave-Ayland wrote: > On 02/06/16 09:23, Cédric Le Goater wrote: > > > On 06/02/2016 09:45 AM, Mark Cave-Ayland wrote: > >> On 02/06/16 08:37, Cédric Le Goater wrote: > >>> On 06/02/2016 05:17 AM, David Gibson wrote: > On Wed, Jun 01, 2016 at 08:0

[Qemu-devel] [PULL 2/7] ui: spice: Exit if gl=on EGL init fails

2016-06-03 Thread Gerd Hoffmann
From: Cole Robinson The user explicitly requested spice GL, so if we know it isn't going to work we should exit Signed-off-by: Cole Robinson Reviewed-by: Marc-André Lureau Message-id: e3789e35b16f9e3cc6f2652f91c52d88ba6d6936.1463588606.git.crobi...@redhat.com Signed-off-by: Gerd Hoffmann ---

Re: [Qemu-devel] [RFC PATCH v1 1/3] spapr: Introduce pseries-2.7 machine type

2016-06-03 Thread David Gibson
On Fri, Jun 03, 2016 at 11:19:42AM +0530, Bharata B Rao wrote: > Signed-off-by: Bharata B Rao Applied to ppc-for-2.7, we were always going to need this at some point. > --- > hw/ppc/spapr.c | 22 -- > 1 file changed, 20 insertions(+), 2 deletions(-) > > diff --git a/hw/ppc/

Re: [Qemu-devel] [PATCH v5 24/27] iotests: Disable image locking in 085

2016-06-03 Thread Fam Zheng
On Wed, 05/25 15:52, Max Reitz wrote: > On 17.05.2016 09:35, Fam Zheng wrote: > > The cases is about live snapshot features. Disable image locking because > > otherwise a few tests are going to fail because we reuse the same images > > at blockdev-add. > > > > Signed-off-by: Fam Zheng > > --- > >

Re: [Qemu-devel] [RFC PATCH v1 3/3] spapr: spapr: Work around the memory hotplug failure with DDW

2016-06-03 Thread David Gibson
On Fri, Jun 03, 2016 at 11:19:44AM +0530, Bharata B Rao wrote: > Memory hotplug can fail for some combinations of RAM and maxmem when > DDW is enabled in the presence of devices like nec-usb-xhci. DDW depends > on maximum addressable memory returned by guest and this value is currently > being calc

Re: [Qemu-devel] [PATCH qemu v17 09/12] vfio: Add host side DMA window capabilities

2016-06-03 Thread David Gibson
On Wed, Jun 01, 2016 at 06:57:40PM +1000, Alexey Kardashevskiy wrote: > There are going to be multiple IOMMUs per a container. This moves > the single host IOMMU parameter set to a list of VFIOHostDMAWindow. > > This should cause no behavioral change and will be used later by > the SPAPR TCE IOMMU

Re: [Qemu-devel] [PATCH RFC 4/8] target-i386: cpu: consolidate calls of object_property_parse() in x86_cpu_parse_featurestr

2016-06-03 Thread Peter Krempa
On Thu, Jun 02, 2016 at 18:31:04 +0200, Igor Mammedov wrote: > On Thu, 2 Jun 2016 17:05:06 +0200 > Peter Krempa wrote: > > On Thu, Jun 02, 2016 at 11:53:22 -0300, Eduardo Habkost wrote: > > > On Thu, Jun 02, 2016 at 02:22:22PM +0200, Igor Mammedov wrote: [...] > > I couldn't find anything regard

[Qemu-devel] [PULL 1/6] virtio-gpu: fix scanout rectangles

2016-06-03 Thread Gerd Hoffmann
Commit "ca58b45 ui/virtio-gpu: add and use qemu_create_displaysurface_pixman" breaks scanouts which use a region of the underlying resource only. So, we need another way to handle the underlying issue. Lets create a new pixman image, grab a reference on the pixman providing the underlying storage

[Qemu-devel] [PULL 0/6] vga patch queue

2016-06-03 Thread Gerd Hoffmann
#x27; into staging (2016-06-02 14:26:57 +0100) are available in the git repository at: git://git.kraxel.org/qemu tags/pull-vga-20160603-1 for you to fetch changes up to 8d0cc96d0dc18931494437ffa68655c0e11dc8fe: virtio-gpu: add live migration support (2016-06-03 09:0

[Qemu-devel] [PULL 3/6] vmsvga: add more fifo checks

2016-06-03 Thread Gerd Hoffmann
Make sure all fifo ptrs are within range. Fixes: CVE-2016-4454 Cc: P J P Reported-by: 李强 Signed-off-by: Gerd Hoffmann Message-id: 1464592161-18348-3-git-send-email-kra...@redhat.com --- hw/display/vmware_vga.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/display/v

[Qemu-devel] [PULL 5/6] vmsvga: don't process more than 1024 fifo commands at once

2016-06-03 Thread Gerd Hoffmann
vmsvga_fifo_run is called in regular intervals (on each display update) and will resume where it left off. So we can simply exit the loop, without having to worry about how processing will continue. Fixes: CVE-2016-4453 Cc: P J P Reported-by: 李强 Signed-off-by: Gerd Hoffmann Message-id: 1464592

[Qemu-devel] [PULL 4/6] vmsvga: shadow fifo registers

2016-06-03 Thread Gerd Hoffmann
The fifo is normal ram. So kvm vcpu threads and qemu iothread can access the fifo in parallel without syncronization. Which in turn implies we can't use the fifo pointers in-place because the guest can try changing them underneath us. So add shadows for them, to make sure the guest can't modify

[Qemu-devel] [PATCH v2 1/4] 9p: drop useless out: label

2016-06-03 Thread Greg Kurz
Reviewed-by: Eric Blake Signed-off-by: Greg Kurz --- v2: added Eric's r-b --- hw/9pfs/9p.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 587e901f81cc..12bd688f37d3 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -1646,15 +1646,15

[Qemu-devel] [PATCH v2 0/4] 9p: get rid of readdir_r()

2016-06-03 Thread Greg Kurz
The readdir_r() function has a broken design and should not be used anymore. It is expected to be obsoleted in a future version of POSIX.1: http://austingroupbugs.net/view.php?id=696#c2857 Glibc has already announced that 2.24 (scheduled for August 2016) will deprecates readdir_r() and encourages

[Qemu-devel] [PULL 6/6] virtio-gpu: add live migration support

2016-06-03 Thread Gerd Hoffmann
Store some additional state for cursor and resource backing storage, so we can write out and reload things. Implement vmsave+vmload for 2d mode. Continue blocking live migration in 3d/virgl mode. Signed-off-by: Gerd Hoffmann Message-id: 1464009727-7753-1-git-send-email-kra...@redhat.com --- hw

[Qemu-devel] [PATCH v2 2/4] 9p: introduce the V9fsDir type

2016-06-03 Thread Greg Kurz
If we are to switch back to readdir(), we need a more complex type than DIR * to be able to serialize concurrent accesses to the directory stream. This patch introduces a placeholder type and fixes all users. Reviewed-by: Eric Blake Signed-off-by: Greg Kurz --- v2: added Eric's r-b --- hw/9pfs

[Qemu-devel] [PULL 2/6] vmsvga: move fifo sanity checks to vmsvga_fifo_length

2016-06-03 Thread Gerd Hoffmann
Sanity checks are applied when the fifo is enabled by the guest (SVGA_REG_CONFIG_DONE write). Which doesn't help much if the guest changes the fifo registers afterwards. Move the checks to vmsvga_fifo_length so they are done each time qemu is about to read from the fifo. Fixes: CVE-2016-4454 Cc:

[Qemu-devel] [PATCH v2 3/4] 9p: add locking to V9fsDir

2016-06-03 Thread Greg Kurz
If several threads concurrently call readdir() with the same directory stream pointer, it is possible that they all get a pointer to the same dirent structure, whose content is overwritten each time readdir() is called. We must thus serialize accesses to the dirent structure. This may be achieved

[Qemu-devel] [PATCH v2 4/4] 9p: switch back to readdir()

2016-06-03 Thread Greg Kurz
This patch changes the 9p code to use readdir() again instead of readdir_r(), which is deprecated in glibc 2.24. All the locking was put in place by a previous patch. Signed-off-by: Greg Kurz --- v2: set errno to 0 before calling readdir() --- fsdev/file-op-9p.h |3 +-- hw/9pfs/9p-handle.c

Re: [Qemu-devel] [PATCH qemu v17 10/12] vfio/spapr: Create DMA window dynamically (SPAPR IOMMU v2)

2016-06-03 Thread David Gibson
On Wed, Jun 01, 2016 at 06:57:41PM +1000, Alexey Kardashevskiy wrote: > New VFIO_SPAPR_TCE_v2_IOMMU type supports dynamic DMA window management. > This adds ability to VFIO common code to dynamically allocate/remove > DMA windows in the host kernel when new VFIO container is added/removed. > > Thi

[Qemu-devel] [Bug 1568356] Re: ERROR:ui/sdl2-2d.c:120:sdl2_2d_switch:

2016-06-03 Thread T. Huth
I just noticed that somebody submitted a related patch recently: https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg02702.html Could you please check whether this fixes your issue here with sdl2-2d.c, too? -- You received this bug notification because you are a member of qemu- devel-ml, w

Re: [Qemu-devel] [PATCH v4 24/28] qapi: Add JSON output visitor

2016-06-03 Thread Markus Armbruster
Eric Blake writes: > We have several places that want to go from qapi to JSON; right now, > they have to create an intermediate QObject to do the work. That > also has the drawback that the JSON formatting of a QDict will > rearrange keys (according to a deterministic, but unpredictable, > hash)

[Qemu-devel] [PATCH COLO-Frame v17 01/34] configure: Add parameter for configure to enable/disable COLO support

2016-06-03 Thread zhanghailiang
configure --enable-colo/--disable-colo to switch COLO support on/off. COLO support is On by default. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert --- v11: - Turn COLO on in default (Eric's suggestion) --- configure | 11

[Qemu-devel] [PATCH COLO-Frame v17 06/34] COLO/migration: Create a new communication path from destination to source

2016-06-03 Thread zhanghailiang
This new communication path will be used for returning messages from destination to source. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v13: - Remove useless error report v12: - Add Reviewed-by tag v11: - Rebase master to use qemu_file_get_retu

[Qemu-devel] [PATCH COLO-Frame v17 04/34] migration: Integrate COLO checkpoint process into migration

2016-06-03 Thread zhanghailiang
Add a migrate state: MIGRATION_STATUS_COLO, enter this migration state after the first live migration successfully finished. We reuse migration thread, so if colo is enabled by user, migration thread will go into the process of colo. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed

[Qemu-devel] [PATCH COLO-Frame v17 02/34] migration: Introduce capability 'x-colo' to migration

2016-06-03 Thread zhanghailiang
We add helper function colo_supported() to indicate whether colo is supported or not, with which we use to control whether or not showing 'x-colo' string to users, they can use qmp command 'query-migrate-capabilities' or hmp command 'info migrate_capabilities' to learn if colo is supported. Cc: Ju

[Qemu-devel] [PATCH COLO-Frame v17 00/34] COarse-grain LOck-stepping(COLO) Virtual Machines for Non-stop Service (FT)

2016-06-03 Thread zhanghailiang
This is the 17th version of COLO FT feature. Here is only COLO frame part, you can get the whole codes from github: https://github.com/coloft/qemu/commits/colo-v3.0-periodic-mode Migration now switches to use the new QIOChannel API. It only affects COLO's patch 9 and patch 12, which we used the o

[Qemu-devel] [PATCH COLO-Frame v17 09/34] COLO: Save PVM state to secondary side when do checkpoint

2016-06-03 Thread zhanghailiang
The main process of the checkpoint is to synchronize SVM with PVM. VM's state includes ram and device state. So we will migrate PVM's state to SVM when do checkpoint, just like migration does. We will cache PVM's state in slave, we use QEMUSizedBuffer to store the data, we need to know the size of

[Qemu-devel] [PATCH COLO-Frame v17 25/34] savevm: Introduce two helper functions for save/find loadvm_handlers entry

2016-06-03 Thread zhanghailiang
For COLO's checkpoint process, we will do savevm/loadvm repeatedly. So every time we call qemu_loadvm_section_start_full(), we will add all sections information into loadvm_handlers list for one time. There will be many instances in loadvm_handlers for one section, and this will lead to memory leak

[Qemu-devel] [PATCH COLO-Frame v17 13/34] COLO: Flush PVM's cached RAM into SVM's memory

2016-06-03 Thread zhanghailiang
During the time of VM's running, PVM may dirty some pages, we will transfer PVM's dirty pages to SVM and store them into SVM's RAM cache at next checkpoint time. So, the content of SVM's RAM cache will always be same with PVM's memory after checkpoint. Instead of flushing all content of PVM's RAM

[Qemu-devel] [PATCH COLO-Frame v17 07/34] COLO: Implement COLO checkpoint protocol

2016-06-03 Thread zhanghailiang
We need communications protocol of user-defined to control the checkpoint process. The new checkpoint request is started by Primary VM, and the interactive process like below: Checkpoint synchronizing points: Primary Secondary

[Qemu-devel] [PATCH COLO-Frame v17 20/34] qmp event: Add COLO_EXIT event to notify users while exited from COLO

2016-06-03 Thread zhanghailiang
If some errors happen during VM's COLO FT stage, it's important to notify the users of this event. Together with 'x_colo_lost_heartbeat', Users can intervene in COLO's failover work immediately. If users don't want to get involved in COLO's failover verdict, it is still necessary to notify users th

[Qemu-devel] [PATCH COLO-Frame v17 15/34] COLO: Synchronize PVM's state to SVM periodically

2016-06-03 Thread zhanghailiang
Do checkpoint periodically, the default interval is 200ms. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v12: - Add Reviewed-by tag v11: - Fix wrong sleep time for checkpoint period. (Dave's comment) --- migration/colo.c | 12 1 fil

[Qemu-devel] [PATCH COLO-Frame v17 10/34] COLO: Load PVM's dirty pages into SVM's RAM cache temporarily

2016-06-03 Thread zhanghailiang
We should not load PVM's state directly into SVM, because there maybe some errors happen when SVM is receving data, which will break SVM. We need to ensure receving all data before load the state into SVM. We use an extra memory to cache these data (PVM's ram). The ram cache in secondary side is i

[Qemu-devel] [PATCH COLO-Frame v17 08/34] COLO: Add a new RunState RUN_STATE_COLO

2016-06-03 Thread zhanghailiang
Guest will enter this state when paused to save/restore VM state under colo checkpoint. Cc: Eric Blake Cc: Markus Armbruster Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Gonglei Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Eric Blake --- qapi-schema.json | 5 ++

[Qemu-devel] [PATCH COLO-Frame v17 12/34] COLO: Load VMState into buffer before restore it

2016-06-03 Thread zhanghailiang
We should not destroy the state of SVM (Secondary VM) until we receive the whole state from the PVM (Primary VM), in case the primary fails in the middle of sending the state, so, here we cache the device state in Secondary before restore it. Besides, we should call qemu_system_reset() before loa

[Qemu-devel] [PATCH COLO-Frame v17 32/34] COLO/filter: Add each netdev a buffer filter

2016-06-03 Thread zhanghailiang
For COLO periodic mode, it needs to buffer packets that sent by VM, and we will not release these packets until finish a checkpoint. Here, we add each netdev a buffer-filter that will be controlled by COLO. It is off by default, and the packets will not pass through these filters. If users don't e

[Qemu-devel] [PATCH COLO-Frame v17 11/34] ram/COLO: Record the dirty pages that SVM received

2016-06-03 Thread zhanghailiang
We record the address of the dirty pages that received, it will help flushing pages that cached into SVM. We record them by re-using migration dirty bitmap. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert --- v16: - Use the new wrapper memory_region_get_ram_addr() modified in co

[Qemu-devel] [PATCH COLO-Frame v17 27/34] migration/savevm: Export two helper functions for savevm process

2016-06-03 Thread zhanghailiang
We add a new helper functions qemu_savevm_live_state(), and make qemu_save_device_state() public. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v15: - Add Reviewd-by tag v14: - New patch split from previous 'COLO: Separate the process of saving/

[Qemu-devel] [PATCH COLO-Frame v17 14/34] COLO: Add checkpoint-delay parameter for migrate-set-parameters

2016-06-03 Thread zhanghailiang
Add checkpoint-delay parameter for migrate-set-parameters, so that we can control the checkpoint frequency when COLO is in periodic mode. Cc: Luiz Capitulino Cc: Eric Blake Cc: Markus Armbruster Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v1

Re: [Qemu-devel] [PATCH v4 25/28] qapi: Support pretty printing in JSON output visitor

2016-06-03 Thread Markus Armbruster
Eric Blake writes: > Similar to pretty printing in the QObject visitor. The trickiest > part is probably that the testsuite now has to honor parameterization > on whether pretty printing is enabled. Worth mentioning that the pretty-printing matches the one in qobject-json.c? > > Signed-off-by:

[Qemu-devel] [PATCH COLO-Frame v17 18/34] COLO: Implement failover work for Primary VM

2016-06-03 Thread zhanghailiang
For PVM, if there is failover request from users. The COLO thread will exit the loop while the failover BH does the cleanup work and resumes VM. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v13: - Add Reviewed-by tag v12: - Fix error report and

[Qemu-devel] [PATCH COLO-Frame v17 21/34] COLO failover: Shutdown related socket fd when do failover

2016-06-03 Thread zhanghailiang
If the net connection between COLO's two sides is broken while COLO or COLO incoming thread is blocked in read()/write() socket fd. It will not detect this error until connection is timeout. That will be a long time. Here we shutdown all the related socket file descriptors to wake up the blocking

[Qemu-devel] [PATCH COLO-Frame v17 28/34] COLO: Separate the process of saving/loading ram and device state

2016-06-03 Thread zhanghailiang
We separate the process of saving/loading ram and device state when do checkpoint. We add new helpers for save/load ram/device. With this change, we can directly transfer RAM from primary side to secondary side without using channel-buffer as assistant, which also reduce the size of extra memory wa

[Qemu-devel] [PATCH COLO-Frame v17 22/34] COLO failover: Don't do failover during loading VM's state

2016-06-03 Thread zhanghailiang
We should not do failover work while the main thread is loading VM's state. Otherwise it will destroy the consistent of VM's memory and device state. Here we add a new failover status 'RELAUNCH' which means we should relaunch the process of failover. Signed-off-by: zhanghailiang Signed-off-by: L

[Qemu-devel] [PATCH COLO-Frame v17 03/34] COLO: migrate colo related info to secondary node

2016-06-03 Thread zhanghailiang
We can know if VM in destination should go into COLO mode by refer to the info that been migrated from PVM. We skip this section if colo is not enabled (i.e. migrate_set_capability colo off), so that, It not break compatibility with migration however the --enable-colo/disable-colo on the source/d

[Qemu-devel] [PATCH COLO-Frame v17 31/34] net: Add notifier/callback for netdev init

2016-06-03 Thread zhanghailiang
We can register some callback for this notifier, this will be used by COLO to register a callback which will add each netdev a buffer filter. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v17: - Rename netdev_init_add_notifier() to netdev_register_init_notifier() v16: - Simp

[Qemu-devel] [PATCH COLO-Frame v17 19/34] COLO: Implement failover work for Secondary VM

2016-06-03 Thread zhanghailiang
If users require SVM to takeover work, colo incoming thread should exit from loop while failover BH helps backing to migration incoming coroutine. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v12: - Improve error message that suggested by Dave -

[Qemu-devel] [PATCH COLO-Frame v17 29/34] COLO: Split qemu_savevm_state_begin out of checkpoint process

2016-06-03 Thread zhanghailiang
It is unnecessary to call qemu_savevm_state_begin() in every checkpoint process. It mainly sets up devices and does the first device state pass. These data will not change during the later checkpoint process. So, we split it out of colo_do_checkpoint_transaction(), in this way, we can reduce these

[Qemu-devel] [PATCH COLO-Frame v17 05/34] migration: Integrate COLO checkpoint process into loadvm

2016-06-03 Thread zhanghailiang
Switch from normal migration loadvm process into COLO checkpoint process if COLO mode is enabled. We add three new members to struct MigrationIncomingState, 'have_colo_incoming_thread' and 'colo_incoming_thread' record the colo related threads for secondary VM, 'migration_incoming_co' records the

[Qemu-devel] [PATCH COLO-Frame v17 16/34] COLO failover: Introduce a new command to trigger a failover

2016-06-03 Thread zhanghailiang
We leave users to choose whatever heartbeat solution they want, if the heartbeat is lost, or other errors they detect, they can use experimental command 'x_colo_lost_heartbeat' to tell COLO to do failover, COLO will do operations accordingly. For example, if the command is sent to the PVM, the Pri

[Qemu-devel] [PATCH COLO-Frame v17 24/34] COLO: Update the global runstate after going into colo state

2016-06-03 Thread zhanghailiang
If we start qemu with -S, the runstate will change from 'prelaunch' to 'running' after going into colo state. So it is necessary to update the global runstate after going into colo state. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert --- v13: - Add R

Re: [Qemu-devel] [PATCH v2] raw-posix: Fetch max sectors for host block device

2016-06-03 Thread Kevin Wolf
Am 03.06.2016 um 04:07 hat Fam Zheng geschrieben: > This is sometimes a useful value we should count in. > > Signed-off-by: Fam Zheng Thanks, applied to the block branch. Kevin

[Qemu-devel] [PATCH COLO-Frame v17 30/34] filter-buffer: Accept zero interval

2016-06-03 Thread zhanghailiang
We may want to accept zero interval when VM FT solutions like MC or COLO use this filter to release packets on demand. Signed-off-by: zhanghailiang Reviewed-by: Yang Hongyang Cc: Jason Wang Cc: Yang Hongyang --- net/filter-buffer.c | 10 -- 1 file changed, 10 deletions(-) diff --git

[Qemu-devel] [PATCH COLO-Frame v17 17/34] COLO failover: Introduce state to record failover process

2016-06-03 Thread zhanghailiang
When handling failover, we do different things according to the different stage of failover process, here we introduce a global atomic variable to record the status of failover. We add four failover status to indicate the different stage of failover process. You should use the helpers to get and s

[Qemu-devel] [PATCH COLO-Frame v17 33/34] COLO: Control the status of buffer filters for PVM

2016-06-03 Thread zhanghailiang
Enable all buffer filters that added by COLO while go into COLO process, and disable them while exit COLO. Signed-off-by: zhanghailiang Cc: Jason Wang Cc: Yang Hongyang --- v16: - Stop buffer filter while doing checkpoint and resume it after checkpoint. v15: - Re-implement colo_set_filter_sta

Re: [Qemu-devel] [RFC PATCH v4 3/3] VFIO Type1 IOMMU: Add support for mediated devices

2016-06-03 Thread Dong Jia
On Thu, 2 Jun 2016 00:56:47 -0700 Neo Jia wrote: > On Wed, Jun 01, 2016 at 04:40:19PM +0800, Dong Jia wrote: > > On Wed, 25 May 2016 01:28:17 +0530 > > Kirti Wankhede wrote: > > > > > + > > > +/* > > > + * Pin a set of guest PFNs and return their associated host PFNs for API > > > + * supported

[Qemu-devel] [PATCH COLO-Frame v17 23/34] COLO: Process shutdown command for VM in COLO state

2016-06-03 Thread zhanghailiang
If VM is in COLO FT state, we should do some extra work before normal shutdown process. SVM will ignore the shutdown command if this command is issued directly to it. PVM will send the shutdown command to SVM if it gets this command. Cc: Paolo Bonzini Signed-off-by: zhanghailiang Signed-off-by:

[Qemu-devel] [PATCH COLO-Frame v17 26/34] migration/savevm: Add new helpers to process the different stages of loadvm

2016-06-03 Thread zhanghailiang
There are several stages during loadvm process. In different stage, migration incoming processes different section. We want to control these stages more accuracy, to optimize the COLO capability. Here we add two new helper functions: qemu_loadvm_state_begin() and qemu_load_device_state(). Besides,

Re: [Qemu-devel] Channel paths (was: Re: [RFC Patch 0/3] Accept passed in socket 'fd' open from outside for unix socket)

2016-06-03 Thread Daniel P. Berrange
On Thu, Jun 02, 2016 at 09:27:45PM +0200, Sascha Silbe wrote: > Dear Daniel, > > "Daniel P. Berrange" writes: > > > On Thu, Jun 02, 2016 at 09:41:56AM +0200, Michal Privoznik wrote: > >> On 01.06.2016 18:16, Wei Xu wrote: > >> > On 2016年06月01日 00:44, Daniel P. Berrange wrote: > > There are plent

[Qemu-devel] [PATCH COLO-Frame v17 34/34] COLO: Add block replication into colo process

2016-06-03 Thread zhanghailiang
Make sure master start block replication after slave's block replication started. Signed-off-by: zhanghailiang Signed-off-by: Wen Congyang Signed-off-by: Li Zhijian Cc: Stefan Hajnoczi Cc: Kevin Wolf Cc: Max Reitz --- migration/colo.c | 49 ++

Re: [Qemu-devel] [PATCH v6 11/11] pci: Convert msi_init() to Error and fix callers to check it

2016-06-03 Thread Cao jin
Hi Markus, Thanks very much for your thorough review for the whole series, really really impressed:) On 06/01/2016 08:37 PM, Markus Armbruster wrote: Cao jin writes: msi_init() reports errors with error_report(), which is wrong when it's used in realize(). msix_init() has the same proble

Re: [Qemu-devel] Why is "spapr-pci-host-bridge" no-user?

2016-06-03 Thread Alexey Kardashevskiy
On 03/06/16 16:40, Markus Armbruster wrote: > Commit 09aa9a5 "spapr-pci: enable adding PHB via -device" set > cannot_instantiate_with_device_add_yet without also adding a comment > explaining why. It is currently the only one lacking such a comment. > Let's fix that. > > Unfortunately, the commit

Re: [Qemu-devel] [PATCH] linux-user: check if NETLINK_ROUTE is available

2016-06-03 Thread Laurent Vivier
Le 03/06/2016 à 10:32, Riku Voipio a écrit : > On Thu, Jun 02, 2016 at 10:14:15PM +0200, Laurent Vivier wrote: >> Some IFLA_* symbols can be missing in the host linux/if_link.h, >> but as they are enums and not "#defines", check in "configure" if >> last known (IFLA_PROTO_DOWN) is available and

Re: [Qemu-devel] [PATCH v4 27/28] qapi: Add 'any' support to JSON output

2016-06-03 Thread Markus Armbruster
Eric Blake writes: > Now that we can visit any QObject, it's easy to add support > for visit_type_any() in the JSON output visitor. > > Signed-off-by: Eric Blake Unlike in v3, this actually clones the QObject behind the any type. Much cleaner, and very little code due to your elegant use of vis

Re: [Qemu-devel] [PATCH v4 26/28] qobject: Implement qobject_to_json() atop JSON visitor

2016-06-03 Thread Markus Armbruster
Eric Blake writes: > Rather than open-code two different JSON visitors, it's nicer to > make qobject_to_json() reuse the JSON output visitor. This also > lets us pass QObject to any output visitor (passing it to the > string output visitor will fail if structs are involved, but > passing it to t

Re: [Qemu-devel] [RFC Patch 0/3] Accept passed in socket 'fd' open from outside for unix socket

2016-06-03 Thread Daniel P. Berrange
On Fri, Jun 03, 2016 at 02:07:00AM +0800, Wei Xu wrote: > On 2016年06月02日 19:38, Michal Privoznik wrote: > > On 02.06.2016 10:29, Daniel P. Berrange wrote: > > > On Thu, Jun 02, 2016 at 09:41:56AM +0200, Michal Privoznik wrote: > > > > On 01.06.2016 18:16, Wei Xu wrote: > > > > > On 2016年06月01日 00:4

Re: [Qemu-devel] [PATCH v4 29/28] qapi: Add strict mode to JSON output visitor

2016-06-03 Thread Markus Armbruster
Eric Blake writes: > On 05/19/2016 10:52 AM, Eric Blake wrote: >> Let the caller decide whether output must be strict JSON (and >> raise an error on an attempt to output an encoding error or >> non-finite number), vs. the status quo of relaxed (encoding >> errors are rewritten to use substitute U

[Qemu-devel] [PATCH v6 00/22] block: Lock images when opening

2016-06-03 Thread Fam Zheng
v6: Rebase, and address comments from Max and Rich: Dropped the gluster implementation because the previous reviewed version doesn't handle reopen correctly. Left for another day. Added Max's reviewed-by in patches 1, 3, 7, 12, 13, 16, 17 and 20 - 22. Updated "qemu -help" text. [

[Qemu-devel] [PATCH v6 13/22] block: Don't lock drive-backup target image in none mode

2016-06-03 Thread Fam Zheng
As a very special case, in sync=none mode, the source is the backing image of the target, which will be RO opened again. This won't work with image locking because the first open could be exclusive. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- blockdev.c | 5 + 1 file changed, 5 inse

Re: [Qemu-devel] [PATCH] linux-user: check if NETLINK_ROUTE is available

2016-06-03 Thread Riku Voipio
On Thu, Jun 02, 2016 at 10:14:15PM +0200, Laurent Vivier wrote: > Some IFLA_* symbols can be missing in the host linux/if_link.h, > but as they are enums and not "#defines", check in "configure" if > last known (IFLA_PROTO_DOWN) is available and if not, disable > management of NETLINK_ROUTE protoc

Re: [Qemu-devel] [RFC PATCH v4 3/3] VFIO Type1 IOMMU: Add support for mediated devices

2016-06-03 Thread Tian, Kevin
> From: Dong Jia [mailto:bjsdj...@linux.vnet.ibm.com] > Sent: Friday, June 03, 2016 4:32 PM > > On Thu, 2 Jun 2016 00:56:47 -0700 > Neo Jia wrote: > > > On Wed, Jun 01, 2016 at 04:40:19PM +0800, Dong Jia wrote: > > > On Wed, 25 May 2016 01:28:17 +0530 > > > Kirti Wankhede wrote: > > > > > > > +

[Qemu-devel] [PATCH v6 02/22] qapi: Add lock-mode in blockdev-add options

2016-06-03 Thread Fam Zheng
To allow overriding the default locking behavior when opening the image. Signed-off-by: Fam Zheng --- qapi/block-core.json | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 98a20d2..23ec31d 100644 --- a/qapi/

[Qemu-devel] [PATCH] docker: Fix git-archive for submodules

2016-06-03 Thread Fam Zheng
If dtc or pixman submodule is initialized, "git archive" in the subshell gets a relative filename against $(SRC_PATH), while we have already cd'ed into the submodule directory. Prefix it with $(CURDIR), which is the full path to the working directory. Signed-off-by: Fam Zheng --- tests/docker/M

[Qemu-devel] [PATCH v6 17/22] qemu-iotests: 030: Disable image locking when checking test image

2016-06-03 Thread Fam Zheng
The VM is running, qemu-io would fail the lock acquisition. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- tests/qemu-iotests/030 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 3ac2443..fa996ef 100755 --- a/tests/qe

Re: [Qemu-devel] [PATCH 1/1] qcow2: avoid extra flushes in qcow2

2016-06-03 Thread Kevin Wolf
Am 02.06.2016 um 17:58 hat Denis V. Lunev geschrieben: > The problem with excessive flushing was found by a couple of performance > tests: > - parallel directory tree creation (from 2 processes) > - 32 cached writes + fsync at the end in a loop > > For the first one results improved from 2.6 l

[Qemu-devel] [PATCH v6 03/22] blockdev: Add and parse "lock-mode" option for image locking

2016-06-03 Thread Fam Zheng
Respect the locking mode from CLI or QMP, and set the open flags accordingly. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- blockdev.c | 23 +++ qemu-options.hx | 1 + 2 files changed, 24 insertions(+) diff --git a/blockdev.c b/blockdev.c index 717785e..5acb286

[Qemu-devel] [PATCH v6 16/22] qemu-iotests: Wait for QEMU processes before checking image in 091

2016-06-03 Thread Fam Zheng
We should wait for the QEMU process to terminate and close the image before we check the data. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- tests/qemu-iotests/091 | 3 +++ tests/qemu-iotests/091.out | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/qemu-iotests/091 b/tests/

[Qemu-devel] [PATCH v6 04/22] block: Introduce image file locking

2016-06-03 Thread Fam Zheng
Block drivers can implement this new operation .bdrv_lockf to actually lock the image in the protocol specific way. Signed-off-by: Fam Zheng --- block.c | 57 +++ include/block/block.h | 11 - include/block/block_int.h |

[Qemu-devel] [PATCH v6 09/22] qemu-io: Add "-L" option for BDRV_O_NO_LOCK

2016-06-03 Thread Fam Zheng
Signed-off-by: Fam Zheng --- qemu-io.c | 24 +--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/qemu-io.c b/qemu-io.c index d977a6e..7a5e824 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -107,6 +107,7 @@ static void open_help(void) " -r, -- open file read-only\n"

[Qemu-devel] [PATCH v6 01/22] block: Add flag bits for image locking

2016-06-03 Thread Fam Zheng
Later the block layer will automatically lock the images to avoid unexpected concurrent accesses to the same image, which will easily corrupt the metadata or user data, unless in some very special cases, like migration. The exceptional cases like shared storage migration and testing should set BDR

[Qemu-devel] [PATCH v6 20/22] tests: Use null-co:// instead of /dev/null

2016-06-03 Thread Fam Zheng
With image locking, opening /dev/null can fail when multiple tests run in parallel (make -j2, for example). Use null-co:// as the null protocol doesn't do image locking. While it's arguable we could special-case /dev/null, /dev/zero, /dev/urandom etc in raw-posix driver, it is not really necessary

[Qemu-devel] [PATCH v6 12/22] qemu-nbd: Add "--no-lock/-L" option

2016-06-03 Thread Fam Zheng
Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- qemu-nbd.c| 7 ++- qemu-nbd.texi | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 6554f0a..6adfc46 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -98,6 +98,7 @@ static void usage(const cha

[Qemu-devel] [PATCH v6 06/22] osdep: Introduce qemu_dup

2016-06-03 Thread Fam Zheng
This takes care of both the CLOEXEC flag and fd-path mapping for image locking. Signed-off-by: Fam Zheng --- include/qemu/osdep.h | 3 +++ util/osdep.c | 9 + 2 files changed, 12 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 749214a..89c63c7 100644

[Qemu-devel] [PATCH v6 05/22] osdep: Add qemu_lock_fd and qemu_unlock_fd

2016-06-03 Thread Fam Zheng
They are wrappers of POSIX fcntl "file private locking". Signed-off-by: Fam Zheng --- include/qemu/osdep.h | 2 ++ util/osdep.c | 29 + 2 files changed, 31 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 6937694..749214a 100644 -

Re: [Qemu-devel] [PATCH v4 17/28] qapi: Factor out JSON number formatting

2016-06-03 Thread Markus Armbruster
Eric Blake writes: > On 06/02/2016 09:02 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Pull out a new qstring_append_json_number() helper, so that all >>> JSON output producers can use a consistent style for printing >>> floating point without duplicating code (since we are doing mo

[Qemu-devel] [PATCH v6 10/22] qemu-img: Add "-L" option to sub commands

2016-06-03 Thread Fam Zheng
If specified, BDRV_O_NO_LOCK flag will be set when opening the image. Signed-off-by: Fam Zheng --- qemu-img.c | 91 +- 1 file changed, 72 insertions(+), 19 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 4b56ad3..88a12b5 100644

[Qemu-devel] [PATCH v6 07/22] raw-posix: Use qemu_dup

2016-06-03 Thread Fam Zheng
Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- block/raw-posix.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index a4f5a1b..bb8669f 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -645,15 +645,7 @@ static int

[Qemu-devel] [PATCH v6 08/22] raw-posix: Add image locking support

2016-06-03 Thread Fam Zheng
virtlockd in libvirt locks the first byte, we lock byte 1 to avoid the intervene. Both file and host device protocols are covered. The complication is with reopen. We have three different locking states, namely "unlocked", "shared locked" and "exclusively locked". There have three different stat

[Qemu-devel] [PATCH v6 11/22] qemu-img: Update documentation of "-L" option

2016-06-03 Thread Fam Zheng
Signed-off-by: Fam Zheng --- qemu-img-cmds.hx | 44 ++-- qemu-img.c | 1 + qemu-img.texi| 3 +++ 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index e7cded6..fa87942 100644 --- a/qemu-img-cm

[Qemu-devel] [PATCH v2] usb-host: add special case for bus+addr

2016-06-03 Thread Gerd Hoffmann
This patch changes usb-host behavior in case we hostbus= and hostaddr= properties are used to identify the usb device in question. Instead of adding the device to the hotplug watchlist we try to open directly using the given bus number and device address. Putting a device specified by hostaddr to

[Qemu-devel] [PATCH v6 14/22] mirror: Disable image locking on target backing chain

2016-06-03 Thread Fam Zheng
In sync=none the backing image of s->target is s->common.bs, which could be exclusively locked, the image locking wouldn't work here. Later we can update completion code to lock it after the replaced node has dropped its lock. Signed-off-by: Fam Zheng --- blockdev.c | 10 -- 1 file chan

  1   2   3   4   >