Re: [Qemu-devel] [PATCH 02/11] snapshot: return error code from bdrv_snapshot_delete_by_id_or_name

2015-11-04 Thread Greg Kurz
On Wed, 4 Nov 2015 20:19:33 +0300 "Denis V. Lunev" wrote: > this will make code better in the next patch > This changelog is not very useful. IMHO this calls for squashing this patch into the next one: then we clearly see how the return value is used and why the code is better. > Signed-off-b

Re: [Qemu-devel] [PATCH COLO-Frame v10 35/38] netfilter: Introduce a API to automatically add filter-buffer for each netdev

2015-11-04 Thread zhanghailiang
Hi Jason, On 2015/11/4 10:56, Jason Wang wrote: On 11/03/2015 07:56 PM, zhanghailiang wrote: Signed-off-by: zhanghailiang Cc: Jason Wang Commit log please. --- v10: new patch --- include/net/filter.h | 1 + include/net/net.h| 3 ++ net/filter-buffer.c | 84 +++

Re: [Qemu-devel] [PATCH v9 04/27] qapi: Simplify error testing in test-qmp-*

2015-11-04 Thread Markus Armbruster
Eric Blake writes: > On 11/04/2015 01:40 AM, Markus Armbruster wrote: > >> >>> By moving err into data, we can let test teardown take care >>> of cleaning up any collected error; it also gives us fewer >>> lines of code between repeated tests where init runs teardown >>> on our behalf. >> >> Th

Re: [Qemu-devel] [PATCH] target-i386: enable cflushopt/clwb/pcommit instructions

2015-11-04 Thread Richard Henderson
On 11/04/2015 08:35 PM, Eduardo Habkost wrote: On Fri, Oct 30, 2015 at 01:54:33PM -0700, Richard Henderson wrote: On 10/29/2015 12:31 AM, Xiao Guangrong wrote: These instructions are used by NVDIMM drivers and the specification locates at: https://software.intel.com/sites/default/files/managed/

[Qemu-devel] [PATCH] Trivial: update comment of struct Object

2015-11-04 Thread Cao jin
it don`t has "GSList *interfaces" anymore Signed-off-by: Cao jin --- include/qom/object.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 0bb89d4..e46cc30 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -396,9 +396,6 @@ stru

Re: [Qemu-devel] [PATCH v8 10/17] qapi: Simplify visiting of alternate types

2015-11-04 Thread Markus Armbruster
Eric Blake writes: > On 11/04/2015 09:03 AM, Markus Armbruster wrote: > >> Conclusions: >> >> * Having two different name manglers is a headache we could do without, >> especially since the second one camel_to_upper() is pretty magic. >> >> We have it only to get >> >> typedef enum Blo

Re: [Qemu-devel] Should 'qemu-img commit' sparsify the backing file?

2015-11-04 Thread Fam Zheng
On Wed, 11/04 16:37, Richard W.M. Jones wrote: > > This doesn't work (I tested both qemu 2.3 and qemu from git). Should it? > > (1) Create a non-sparse guest image: > > $ virt-builder fedora-22 > $ mv fedora-22.img fedora-22.img.sparse > $ cp --sparse=never fedora-22.img.sparse fedora-22.img >

Re: [Qemu-devel] [PATCH 01/11] snapshot: create helper to test that block drivers supports snapshots

2015-11-04 Thread Greg Kurz
On Wed, 4 Nov 2015 20:19:32 +0300 "Denis V. Lunev" wrote: > The patch enforces proper locking for this operation. > > Signed-off-by: Denis V. Lunev > CC: Juan Quintela > CC: Stefan Hajnoczi > CC: Kevin Wolf > --- > block/snapshot.c | 27 +++ > include/block/

Re: [Qemu-devel] [PATCH] object_new_with_type: remove redundant code

2015-11-04 Thread Cao jin
sorry for this, I am wrong at removing type_initialize. please forget it On 11/05/2015 01:19 PM, Cao jin wrote: g_assert & type_initialize are called in object_initialize_with_type Signed-off-by: Cao jin --- qom/object.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/qom/object.c b/q

Re: [Qemu-devel] [PATCH v7 3/8] mirror: Do zero write on target if sectors not allocated

2015-11-04 Thread Fam Zheng
On Wed, 11/04 19:35, Kevin Wolf wrote: > Am 08.06.2015 um 07:56 hat Fam Zheng geschrieben: > > If guest discards a source cluster, mirroring with bdrv_aio_readv is > > overkill. > > Some protocols do zero upon discard, where it's best to use > > bdrv_aio_write_zeroes, otherwise, bdrv_aio_discard w

[Qemu-devel] [PATCH] object_new_with_type: remove redundant code

2015-11-04 Thread Cao jin
g_assert & type_initialize are called in object_initialize_with_type Signed-off-by: Cao jin --- qom/object.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/qom/object.c b/qom/object.c index fc6e161..43ac2dd 100644 --- a/qom/object.c +++ b/qom/object.c @@ -423,9 +423,6 @@ Object *object_ne

[Qemu-devel] [PATCH v3] iscsi: Translate scsi sense into error code

2015-11-04 Thread Fam Zheng
Previously we return -EIO blindly when anything goes wrong. Add a helper function to parse sense fields and try to make the return code more meaningful. This also fixes the default werror configuration (enospc) when we're using qcow2 on an iscsi lun. The old -EIO not being treated as out of space

Re: [Qemu-devel] [PULL 00/14] Misc changes for QEMU 2.4-rc1

2015-11-04 Thread Fam Zheng
On Wed, 11/04 16:34, Peter Maydell wrote: > On 4 November 2015 at 16:18, Paolo Bonzini wrote: > > The following changes since commit 7bc8e0c967a4ef77657174d28af775691e18b4ce: > > > > Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging > > (2015-10-29 09:49:52 +) > > >

Re: [Qemu-devel] [PATCH v2] iscsi: Translate scsi sense into error code

2015-11-04 Thread Fam Zheng
On Wed, 11/04 21:12, Peter Lieven wrote: > Am 04.11.2015 um 02:36 schrieb Fam Zheng: > > Previously we return -EIO blindly when anything goes wrong. Add a helper > > function to parse sense fields and try to make the return code more > > meaningful. > > > > This also fixes the default werror config

[Qemu-devel] [GIT PULL qemu v2] pseries: Update SLOF firmware image to qemu-slof-20151103

2015-11-04 Thread Alexey Kardashevskiy
Hi! This is a SLOF update which is 700k and therefore too big to be posted as a patch so here is a pull request. Changes: v2: * rebuilt with gcc 4.8, v1 was build with 5.2.1 by mistake The following changes since commit 90da0d5a703839c8db9f37355107955df043b654: ppc/spapr: Add "ibm,pa-feature

Re: [Qemu-devel] [GIT PULL qemu] pseries: Update SLOF firmware image to qemu-slof-20151103

2015-11-04 Thread Alexey Kardashevskiy
On 11/05/2015 02:28 PM, Alexey Kardashevskiy wrote: Hi! This is a SLOF update which is 700k and therefore too big to be posted as a patch so here is a pull request. Ignore this please, this is built using gcc 5.2.1. The following changes since commit 90da0d5a703839c8db9f37355107955df043b

[Qemu-devel] [v2 1/2] kvmclock: add a new function to update env->tsc.

2015-11-04 Thread Liang Li
The commit 317b0a6d8 fixed an issue which caused by the outdated env->tsc value, but the fix lead to 'cpu_synchronize_all_states()' called twice during live migration. The 'cpu_synchronize_all_states()' takes about 130us for a VM which has 4 vcpus, it's a bit expensive. Synchronize the whole CPU c

[Qemu-devel] [v2 2/2] Revert "Introduce cpu_clean_all_dirty"

2015-11-04 Thread Liang Li
This reverts commit de9d61e83d43be9069e6646fa9d57a3f47779d28. Now 'cpu_clean_all_dirty' is useless, we can revert the related code. Conflicts: include/sysemu/kvm.h Signed-off-by: Liang Li --- cpus.c| 9 - include/sysemu/cpus.h | 1 - include/sysemu/kvm.h | 8 --

[Qemu-devel] [v2 0/2] Optimize the env->tsc update operation

2015-11-04 Thread Liang Li
This patch set aims for reducing the live migration downtime. It updates the env->tsc when stopping kvmclock with a new function. Rather than using 'cpu_synchronize_all_states()', which updates the whole CPU context just for updating the env->tsc. For a VM with 4 CPUs, this patch set can help to r

Re: [Qemu-devel] [kvm-unit-test RFC] x86: Memory instructions test case

2015-11-04 Thread Xiao Guangrong
On 11/05/2015 05:21 AM, Eduardo Habkost wrote: Quickly hacked test case for memory instructions (clflush, mfence, sfence, lfence, clflushopt, clwb, pcommit), that simply checks for #UD exceptions. This was useful to test TCG handling of those instructions. The "fake clwb" part will probably b

[Qemu-devel] [GIT PULL qemu] pseries: Update SLOF firmware image to qemu-slof-20151103

2015-11-04 Thread Alexey Kardashevskiy
Hi! This is a SLOF update which is 700k and therefore too big to be posted as a patch so here is a pull request. The following changes since commit 90da0d5a703839c8db9f37355107955df043b654: ppc/spapr: Add "ibm,pa-features" property to the device-tree (2015-10-23 12:22:40 +1100) are availabl

Re: [Qemu-devel] [PATCH v4 7/7] e1000: Implementing various counters

2015-11-04 Thread Jason Wang
On 11/04/2015 11:44 PM, Leonid Bloch wrote: > On Wed, Nov 4, 2015 at 4:46 AM, Jason Wang wrote: >> >> On 11/03/2015 07:14 PM, Leonid Bloch wrote: >>> This implements the following Statistic registers (various counters) >>> according to Intel's specs: >>> >>> TSCTC GOTCL GOTCH GORCL GORCH MP

Re: [Qemu-devel] [PATCH v4 3/7] e1000: Trivial implementation of various MAC registers

2015-11-04 Thread Jason Wang
On 11/04/2015 11:21 PM, Leonid Bloch wrote: > On Wed, Nov 4, 2015 at 4:44 AM, Jason Wang wrote: >> >> On 11/03/2015 07:14 PM, Leonid Bloch wrote: >>> These registers appear in Intel's specs, but were not implemented. >>> These registers are now implemented trivially, i.e. they are initiated >>>

Re: [Qemu-devel] [PATCH v4 2/7] e1000: Add support for migrating the entire MAC registers' array

2015-11-04 Thread Jason Wang
On 11/04/2015 10:48 PM, Leonid Bloch wrote: >>> >> }, >>> >> .subsections = (const VMStateDescription*[]) { >>> >> &vmstate_e1000_mit_state, >>> >> +&vmstate_e1000_full_mac_state, >>> >> +&vmstate_e1000_compat_mac_state, >>> >> NULL >>> >> } >> > >

Re: [Qemu-devel] [PATCH v3 2/3] target-i386: calculate vcpu's TSC rate to be migrated

2015-11-04 Thread Haozhong Zhang
On 11/04/15 19:42, Eduardo Habkost wrote: > On Mon, Nov 02, 2015 at 05:26:42PM +0800, Haozhong Zhang wrote: > > The value of the migrated vcpu's TSC rate is determined as below. > > 1. If a TSC rate is specified by the cpu option 'tsc-freq', then this > > user-specified value will be used. > >

[Qemu-devel] [Bug 1465935] Re: kvm_irqchip_commit_routes: Assertion `ret == 0' failed

2015-11-04 Thread Mathew Hodson
** Changed in: qemu (Ubuntu Utopic) Importance: Undecided => High ** Changed in: qemu (Ubuntu Precise) Importance: Undecided => High ** No longer affects: qemu (Ubuntu Precise) -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. h

Re: [Qemu-devel] Could not add PCI device with big memory to aarch64 VMs

2015-11-04 Thread Laszlo Ersek
On 11/04/15 23:22, liang yan wrote: > Hello, Laszlo, > > (1)I am trying to add ivshmem device(PCI device with big memory) to my > aarch64 vm. > So far, I could find device information from vm. But it seems vm did not > create > correct resource file for this device. Do you have any idea that this

Re: [Qemu-devel] [PATCH v2 3/5] arm: xilinx_zynq: Add linux pre-boot

2015-11-04 Thread Alistair Francis
On Thu, Oct 29, 2015 at 10:34 PM, Peter Crosthwaite wrote: > Add a Linux-specific pre-boot routine that matches the device- > specific bootloaders behaviour. This is needed for modern Linux that > expects the ARM PLL in SLCR to be a more even value (not 26). > > Cc: Alistair Francis > Signed-off-

Re: [Qemu-devel] [PATCH] target-sparc: fix 32-bit truncation in fpackfix

2015-11-04 Thread Mark Cave-Ayland
On 04/11/15 11:05, Richard Henderson wrote: > On 11/04/2015 11:45 AM, Paolo Bonzini wrote: int32_t src = rs2 >> (word * 32); -int64_t scaled = src << scale; +int64_t scaled = (int64_t)src << scale; int64_t from_fixed = scale

Re: [Qemu-devel] [PATCH 00/13] Mac OS 9 compatibility improvements (upstream rework)

2015-11-04 Thread Mark Cave-Ayland
On 04/11/15 03:44, David Gibson wrote: > On Fri, Oct 30, 2015 at 04:48:12PM +, Mark Cave-Ayland wrote: >> On 23/10/15 14:56, Mark Cave-Ayland wrote: >> >>> This is a rework of Cormac O'Brien's GSoC project to try and boot MacOS 9 >>> under >>> QEMU, the original version of which was posted to

[Qemu-devel] [PATCH v2 1/1] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO)

2015-11-04 Thread Sukadev Bhattiprolu
Implement RTAS_SYSPARM_PROCESSOR_MODULE_INFO parameter to rtas_get_sysparm() call in qemu. This call returns the processor module (socket), chip and core information as specified in section 7.3.16.18 of PAPR v2.7. We walk the /proc/device-tree to determine the number of chips, cores and modules in

Re: [Qemu-devel] [PATCH 12/13] cuda.c: fix T2 timer and enable its interrupt

2015-11-04 Thread Mark Cave-Ayland
On 04/11/15 03:40, David Gibson wrote: > On Fri, Oct 23, 2015 at 02:56:37PM +0100, Mark Cave-Ayland wrote: >> Fix the counter loading logic and enable the T2 interrupt when the timer >> expires. > > A mention of what uses T2, and therefore why this is useful would be > good. There is a good chan

Re: [Qemu-devel] [PATCH v9 19/27] qapi: Check for qapi collisions of flat union branches

2015-11-04 Thread Eric Blake
On 11/04/2015 04:11 PM, Eric Blake wrote: > On 11/04/2015 12:01 PM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Right now, our ad hoc parser ensures that we cannot have a >>> flat union that introduces any qapi member names that would >>> conflict with the non-variant qapi members alread

Re: [Qemu-devel] [PATCH v9 20/27] qapi: Simplify QAPISchemaObjectTypeVariants.check()

2015-11-04 Thread Eric Blake
On 11/04/2015 12:02 PM, Markus Armbruster wrote: > Eric Blake writes: > >> From: Markus Armbruster >> >> Avoid the 'if seen' conditional by doing just the essential work >> here, namely setting self.tag_member for flat unions. >> Move the rest to callers. >> >> Signed-off-by: Markus Armbruster

Re: [Qemu-devel] [PATCH v9 19/27] qapi: Check for qapi collisions of flat union branches

2015-11-04 Thread Eric Blake
On 11/04/2015 12:01 PM, Markus Armbruster wrote: > Eric Blake writes: > >> Right now, our ad hoc parser ensures that we cannot have a >> flat union that introduces any qapi member names that would >> conflict with the non-variant qapi members already present >> from the union's base type (see fla

Re: [Qemu-devel] [PATCH v9 17/27] qapi: Clean up after previous commit

2015-11-04 Thread Eric Blake
On 11/04/2015 06:43 AM, Markus Armbruster wrote: > Eric Blake writes: > >> From: Markus Armbruster >> >> QAPISchemaObjectTypeVariants.check() parameter members is no >> longer used, drop it. >> >> Signed-off-by: Markus Armbruster >> Message-Id: <1446559499-26984-3-git-send-email-arm...@redhat.c

Re: [Qemu-devel] [PATCH 07/13] cuda.c: implement dummy IIC access commands

2015-11-04 Thread Mark Cave-Ayland
On 04/11/15 03:17, David Gibson wrote: > On Fri, Oct 23, 2015 at 02:56:32PM +0100, Mark Cave-Ayland wrote: >> These are used by MacOS 9 on boot. Here we return an error except for 4-byte >> commands which write to the IIC bus. > > A bit of rationale about why some of these give errors and some do

Re: [Qemu-devel] [PATCH 05/13] cuda.c: fix CUDA_PACKET response packet format

2015-11-04 Thread Mark Cave-Ayland
On 04/11/15 03:15, David Gibson wrote: > On Fri, Oct 23, 2015 at 02:56:30PM +0100, Mark Cave-Ayland wrote: >> According to comments in MOL, the response to a CUDA_PACKET should be one of >> the following: >> >> Reply: CUDA_PACKET, status, cmd >> Error: ERROR_PACKET, status, CUDA_PACKET, cmd >> >>

Re: [Qemu-devel] [PATCH 04/13] cuda.c: fix CUDA ADB error packet format

2015-11-04 Thread Mark Cave-Ayland
On 04/11/15 03:12, David Gibson wrote: > On Fri, Oct 23, 2015 at 02:56:29PM +0100, Mark Cave-Ayland wrote: >> ADB error packets should be of the form (type, status, cmd) rather than just >> (type, status). This fixes ADB device detection under MacOS 9. > > Hmm.. are there any public doc on these

[Qemu-devel] [Bug 1513234] [NEW] Cannot ping guest from host after closing laptop lid, and re-opening

2015-11-04 Thread Steven Combs
Public bug reported: I am running Ubuntu 15.10 (this issue also exists on 15.04) x64. Desktop environment to re-produce is either GNOME 3.16 or OpenBox-3. I have a Windows 8.1 VM that I run with QEMU and I will work out of that for my job most of the day. When I am going to leave I like to just c

[Qemu-devel] Could not add PCI device with big memory to aarch64 VMs

2015-11-04 Thread liang yan
Hello, Laszlo, (1)I am trying to add ivshmem device(PCI device with big memory) to my aarch64 vm. So far, I could find device information from vm. But it seems vm did not create correct resource file for this device. Do you have any idea that this happens? I used the upstream EDK2 to build m

Re: [Qemu-devel] [PATCH v3 2/3] target-i386: calculate vcpu's TSC rate to be migrated

2015-11-04 Thread Eduardo Habkost
On Mon, Nov 02, 2015 at 05:26:42PM +0800, Haozhong Zhang wrote: > The value of the migrated vcpu's TSC rate is determined as below. > 1. If a TSC rate is specified by the cpu option 'tsc-freq', then this > user-specified value will be used. > 2. If neither a user-specified TSC rate nor a migr

[Qemu-devel] [PATCH 0/2] target-i386: tcg: Handle clflushopt/clwb/pcommit instructions

2015-11-04 Thread Eduardo Habkost
This series makes TCG accept the clwb instruction, and make it check the right CPUID bits when handling clflushopt and pcommit. Tested using the kvm-unit-test patch I sent earlier today: Subject: [kvm-unit-test RFC] x86: Memory instructions test case Message-Id: <1446672079-8549-1-git-send-ema

[Qemu-devel] [PATCH 1/2] target-i386: tcg: Accept clwb instruction

2015-11-04 Thread Eduardo Habkost
Accept the clwb instruction (66 0F AE /6) if its corresponding feature flag is enabled on CPUID[7]. Signed-off-by: Eduardo Habkost --- target-i386/translate.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index

[Qemu-devel] [PATCH 2/2] target-i386: tcg: Check right CPUID bits for clflushopt/pcommit

2015-11-04 Thread Eduardo Habkost
Detect the clflushopt and pcommit instructions and check their corresponding feature flags, instead of checking CPUID_SSE and CPUID_CLFLUSH. Signed-off-by: Eduardo Habkost --- target-i386/translate.c | 28 1 file changed, 20 insertions(+), 8 deletions(-) diff --git

Re: [Qemu-devel] [RFC v2] Add support for KVM_CAP_SPLIT_IRQCHIP

2015-11-04 Thread Paolo Bonzini
On 02/11/2015 22:19, Matt Gingell wrote: > Hi Jan, > > Would you be able to look this over? I’d like to get this into shape to > commit, > either now or once the corresponding kernel patch goes in. > > Thanks, > Matt > > Add support for KVM_CAP_SPLIT_IRQCHIP > > Adds a new alternative 'spl

[Qemu-devel] [kvm-unit-test RFC] x86: Memory instructions test case

2015-11-04 Thread Eduardo Habkost
Quickly hacked test case for memory instructions (clflush, mfence, sfence, lfence, clflushopt, clwb, pcommit), that simply checks for #UD exceptions. This was useful to test TCG handling of those instructions. The "fake clwb" part will probably break once a new instruction use those opcodes. Sig

[Qemu-devel] Implementing a Runtime Shadow Stack

2015-11-04 Thread Jhong Chung, Juan
Hi qemu-devel, I’m trying to start a project and I need some guidance. I want to develop a runtime shadow stack for any binary executed under qemu regardless of the guest or host architecture. This will be a proof of concept for a course project. For now I don’t need to worry about overhead o

Re: [Qemu-devel] [PATCH v9 04/27] qapi: Simplify error testing in test-qmp-*

2015-11-04 Thread Eric Blake
On 11/04/2015 01:40 AM, Markus Armbruster wrote: > >> By moving err into data, we can let test teardown take care >> of cleaning up any collected error; it also gives us fewer >> lines of code between repeated tests where init runs teardown >> on our behalf. > > This part isn't as obvious. > >

Re: [Qemu-devel] [PATCH v8 10/17] qapi: Simplify visiting of alternate types

2015-11-04 Thread Eric Blake
On 11/04/2015 09:03 AM, Markus Armbruster wrote: > Conclusions: > > * Having two different name manglers is a headache we could do without, > especially since the second one camel_to_upper() is pretty magic. > > We have it only to get > > typedef enum BlockDeviceIoStatus { > BLO

Re: [Qemu-devel] [PATCH v3 0/4] SysFS driver for QEMU fw_cfg device

2015-11-04 Thread Gabriel L. Somlo
On Mon, Oct 05, 2015 at 03:18:05PM +0200, Paolo Bonzini wrote: > > > On 05/10/2015 14:50, Peter Maydell wrote: > > If you want to try to support "firmware might also be reading > > fw_cfg at the same time as the kernel" this is a (painful) > > problem regardless of how the kernel figures out whet

[Qemu-devel] [PULL for-2.5 0/3] qemu-ga patch queue

2015-11-04 Thread Michael Roth
The following changes since commit 79cf9fad341e6e7bd6b55395b71d5c5727d7f5b0: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20151103' into staging (2015-11-03 14:54:40 +) are available in the git repository at: git://github.com/mdroth/qemu.git tags/qga-pull-2015-11

[Qemu-devel] [PULL 3/3] qga: set file descriptor in qmp_guest_file_open non-blocking on Win32

2015-11-04 Thread Michael Roth
From: Olga Krishtal Set fd non-blocking to avoid common use cases (like reading from a named pipe) from hanging the agent. This was missed in the original code. The patch introduces qemu_set_handle_nonoblocking, the local analog of qemu_set_nonblock for HANDLES. The usage of handles in qemu_set_

[Qemu-devel] [PULL 2/3] qga: fixed CloseHandle in qmp_guest_file_open

2015-11-04 Thread Michael Roth
From: Olga Krishtal CloseHandle use HANDLE as an argument, but not *HANDLE Signed-off-by: Olga Krishtal Signed-off-by: Denis V. Lunev Reviewed-by: Stefan Weil CC: Michael Roth Signed-off-by: Michael Roth --- qga/commands-win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -

[Qemu-devel] [PULL 1/3] qga: drop hand-made guest_file_toggle_flags helper

2015-11-04 Thread Michael Roth
From: "Denis V. Lunev" We'd better use generic qemu_set_nonblock directly. Signed-off-by: Denis V. Lunev Reviewed-by: Yuri Pudgorodskiy Reviewed-by: Eric Blake CC: Michael Roth Signed-off-by: Michael Roth --- qga/commands-posix.c | 27 ++- 1 file changed, 2 insertio

Re: [Qemu-devel] [PATCH v2] iscsi: Translate scsi sense into error code

2015-11-04 Thread Peter Lieven
Am 04.11.2015 um 02:36 schrieb Fam Zheng: > Previously we return -EIO blindly when anything goes wrong. Add a helper > function to parse sense fields and try to make the return code more > meaningful. > > This also fixes the default werror configuration (enospc) when we're > using qcow2 on an iscsi

Re: [Qemu-devel] [PATCH] target-i386: enable cflushopt/clwb/pcommit instructions

2015-11-04 Thread Eduardo Habkost
On Fri, Oct 30, 2015 at 01:54:33PM -0700, Richard Henderson wrote: > On 10/29/2015 12:31 AM, Xiao Guangrong wrote: > > These instructions are used by NVDIMM drivers and the specification > > locates at: > > https://software.intel.com/sites/default/files/managed/0d/53/319433-022.pdf > > > > There i

Re: [Qemu-devel] [PATCH] qcow2: Fix qcow2_get_cluster_offset() for zero clusters

2015-11-04 Thread Max Reitz
On 04.11.2015 18:16, Kevin Wolf wrote: > When searching for contiguous zero clusters, we only need to check the > cluster type. Before this patch, an increasing offset (L2E_OFFSET_MASK) > was expected, so that the function never returned more than a single > zero cluster in practice. This patch fix

Re: [Qemu-devel] [PATCH v9 20/27] qapi: Simplify QAPISchemaObjectTypeVariants.check()

2015-11-04 Thread Markus Armbruster
Eric Blake writes: > From: Markus Armbruster > > Avoid the 'if seen' conditional by doing just the essential work > here, namely setting self.tag_member for flat unions. > Move the rest to callers. > > Signed-off-by: Markus Armbruster > Message-Id: <1446559499-26984-7-git-send-email-arm...@redh

[Qemu-devel] [PATCH v6 11/15] block: Add list of all BlockDriverStates

2015-11-04 Thread Max Reitz
Signed-off-by: Max Reitz --- block.c | 7 +++ include/block/block_int.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/block.c b/block.c index 57e4b15..cf5dadc 100644 --- a/block.c +++ b/block.c @@ -78,6 +78,9 @@ struct BdrvStates bdrv_states = QTAILQ_HEAD_INITIALIZ

[Qemu-devel] [PATCH v6 15/15] iotests: Add test for multiple BB on BDS tree

2015-11-04 Thread Max Reitz
This adds a test for having multiple BlockBackends in one BDS tree. In this case, there is one BB for the protocol BDS and one BB for the format BDS in a simple two-BDS tree (with the protocol BDS and BB added first). When bdrv_close_all() is executed, no cached data from any BDS should be lost; t

[Qemu-devel] [PATCH v6 13/15] block: Add blk_remove_all_bs()

2015-11-04 Thread Max Reitz
When bdrv_close_all() is called, instead of force-closing all root BlockDriverStates, it is better to just drop the reference from all BlockBackends and let them be closed automatically. This prevents BDS from getting closed that are still referenced by other BDS, which may result in loss of cached

Re: [Qemu-devel] [PATCH v9 19/27] qapi: Check for qapi collisions of flat union branches

2015-11-04 Thread Markus Armbruster
Eric Blake writes: > Right now, our ad hoc parser ensures that we cannot have a > flat union that introduces any qapi member names that would > conflict with the non-variant qapi members already present > from the union's base type (see flat-union-clash-member.json). > We want QAPISchema*.check()

[Qemu-devel] [PATCH v6 10/15] block: Make bdrv_close() static

2015-11-04 Thread Max Reitz
There are no users of bdrv_close() left, except for one of bdrv_open()'s failure paths, bdrv_close_all() and bdrv_delete(), and that is good. Make bdrv_close() static so nobody makes the mistake of directly using bdrv_close() again. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block.c

[Qemu-devel] [PATCH v6 09/15] blockdev: Use blk_remove_bs() in do_drive_del()

2015-11-04 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index 4eda49c..a97a881 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2494,7 +2494,7 @@ void hmp_drive_del(Monitor *mon, const QDict *qdict) return;

[Qemu-devel] [PATCH v6 14/15] block: Rewrite bdrv_close_all()

2015-11-04 Thread Max Reitz
This patch rewrites bdrv_close_all(): Until now, all root BDSs have been force-closed. This is bad because it can lead to cached data not being flushed to disk. Instead, try to make all reference holders relinquish their reference voluntarily: 1. All BlockBackend users are handled by making all B

[Qemu-devel] [PATCH v6 12/15] blockdev: Keep track of monitor-owned BDS

2015-11-04 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 25 + include/block/block_int.h | 4 stubs/Makefile.objs| 1 + stubs/blockdev-close-all-bdrv-states.c | 5 + 4 files changed, 35 insertions(+) create mode 10

[Qemu-devel] [PATCH v6 07/15] block: Move BDS close notifiers into BB

2015-11-04 Thread Max Reitz
The only remaining user of the BDS close notifiers is NBD which uses them to determine when a BDS tree is being ejected. This patch removes the BDS-level close notifiers and adds a notifier list to the BlockBackend structure that is invoked whenever a BDS is removed. Symmetrically to that, another

[Qemu-devel] [PATCH v6 08/15] block: Use blk_remove_bs() in blk_delete()

2015-11-04 Thread Max Reitz
Signed-off-by: Max Reitz --- block/block-backend.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index 38580f7..5702cc1 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -165,10 +165,7 @@ static void blk_de

[Qemu-devel] [PATCH v6 04/15] iotests: Move _filter_nbd into common.filter

2015-11-04 Thread Max Reitz
_filter_nbd can be useful for other NBD tests, too, therefore it should reside in common.filter, and it should support URLs of the "nbd://" format and export names. The NBD log lines ("/your/source/dir/nbd.c:function():line: error") should not be converted to empty lines but removed altogether. S

[Qemu-devel] [PATCH v6 06/15] iotests: Add test for eject under NBD server

2015-11-04 Thread Max Reitz
This patch adds a test for ejecting the BlockBackend an NBD server is connected to (the NBD server is supposed to stop). Signed-off-by: Max Reitz --- tests/qemu-iotests/140 | 90 ++ tests/qemu-iotests/140.out | 16 + tests/qemu-iotests/grou

[Qemu-devel] [PATCH v6 03/15] block: Release dirty bitmaps in bdrv_close()

2015-11-04 Thread Max Reitz
bdrv_delete() is not very happy about deleting BlockDriverStates with dirty bitmaps still attached to them. In the past, we got around that very easily by relying on bdrv_close_all() bypassing bdrv_delete(), and bdrv_close() simply ignoring that condition. We should fix that by releasing all dirty

[Qemu-devel] [PATCH v6 05/15] iotests: Make redirecting qemu's stderr optional

2015-11-04 Thread Max Reitz
Redirecting qemu's stderr to stdout makes working with the stderr output difficult due to the other file descriptor magic performed in _launch_qemu ("ambiguous redirect"). Add an option which specifies whether stderr should be redirected to stdout or not (allowing for other modes to be added in th

[Qemu-devel] [PATCH v6 02/15] blockjob: Call bdrv_unref() on creation error

2015-11-04 Thread Max Reitz
If block_job_create() fails, it should release its reference to the job's BDS. Normally, this is done in the callback provided by the caller, but that callback will not be invoked if the block job failed to be created. Signed-off-by: Max Reitz --- blockjob.c | 1 + 1 file changed, 1 insertion(+)

[Qemu-devel] [PATCH v6 for-2.6 00/15] block: Rework bdrv_close_all()

2015-11-04 Thread Max Reitz
Currently, bdrv_close_all() force-closes all BDSs with a BlockBackend, which can lead to data corruption (see the iotest added in the final patch of this series) and is most certainly very ugly. This series reworks bdrv_close_all() to instead eject the BDS trees from all BlockBackends and then clo

[Qemu-devel] [PATCH v6 01/15] blockdev: Add missing bdrv_unref() in drive-backup

2015-11-04 Thread Max Reitz
All error paths after a successful bdrv_open() of target_bs should contain a bdrv_unref(target_bs). This one did not yet, so add it. Signed-off-by: Max Reitz --- blockdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/blockdev.c b/blockdev.c index ac2a537..4eda49c 100644 --- a/blockdev.c

Re: [Qemu-devel] [PATCH v7 3/8] mirror: Do zero write on target if sectors not allocated

2015-11-04 Thread Kevin Wolf
Am 08.06.2015 um 07:56 hat Fam Zheng geschrieben: > If guest discards a source cluster, mirroring with bdrv_aio_readv is overkill. > Some protocols do zero upon discard, where it's best to use > bdrv_aio_write_zeroes, otherwise, bdrv_aio_discard will be enough. > > Signed-off-by: Fam Zheng > ---

Re: [Qemu-devel] [PATCH] qdev: free qemu-opts when the QOM path goes away

2015-11-04 Thread Markus Armbruster
Paolo Bonzini writes: > Otherwise there is a race where the DEVICE_DELETED event has been sent but > attempts to reuse the ID will fail. > > Reported-by: Michael S. Tsirkin > Signed-off-by: Paolo Bonzini Let's see whether I understand this. > --- > hw/core/qdev.c | 4 +++- > 1 file changed,

Re: [Qemu-devel] [PATCH v2] qom/object: fix 2 comment typos

2015-11-04 Thread Andreas Färber
Am 03.11.2015 um 14:39 schrieb Peter Maydell: > On 3 November 2015 at 02:36, Cao jin wrote: >> Also change the misleading definition of macro OBJECT_CLASS_CHECK >> >> Signed-off-by: Cao jin > > Reviewed-by: Peter Maydell Thanks, applied to qom-next (tweaking the commit message): https://github

Re: [Qemu-devel] [PULL 00/18] Record/replay core for QEMU 2.4-rc1

2015-11-04 Thread Alex Bennée
Paolo Bonzini writes: > The following changes since commit 7bc8e0c967a4ef77657174d28af775691e18b4ce: > > Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging > (2015-10-29 09:49:52 +) > > are available in the git repository at: > > > git://github.com/bonzini/qemu.gi

Re: [Qemu-devel] [PATCH v9 00/27] alternate layout (post-introspection cleanups, subset C)

2015-11-04 Thread Markus Armbruster
Eric Blake writes: > On 11/04/2015 03:22 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> No pending prerequisites; based on qemu.git master >>> >>> Also available as a tag at this location: >>> git fetch git://repo.or.cz/qemu/ericb.git qapi-cleanupv9c >>> >>> and will soon be part of

Re: [Qemu-devel] [PATCH] target-sparc: fix 32-bit truncation in fpackfix

2015-11-04 Thread Markus Armbruster
Paolo Bonzini writes: > On 04/11/2015 15:07, Markus Armbruster wrote: >> Paolo Bonzini writes: >> >>> On 04/11/2015 12:05, Richard Henderson wrote: On 11/04/2015 11:45 AM, Paolo Bonzini wrote: >>>int32_t src = rs2 >> (word * 32); >>> -int64_t scaled = sr

Re: [Qemu-devel] [PATCH v9 03/27] qapi: Plug leaks in test-qmp-*

2015-11-04 Thread Markus Armbruster
Eric Blake writes: > On 11/04/2015 01:19 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Make valgrind happy with the current state of the tests, so that >>> it is easier to see if future patches introduce new memory problems >>> without being drowned in noise. Many of the leaks were

Re: [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform

2015-11-04 Thread Kevin O'Connor
On Wed, Nov 04, 2015 at 08:48:20AM +0800, Gonglei wrote: > On 2015/11/3 14:58, Xulei (Stone, Euler) wrote: > > On qemu-kvm platform, when I reset a VM through "virsh reset", and > > coincidently > > the VM is in process of internal rebooting at the same time. Then the VM > > will > > not be succe

[Qemu-devel] [PATCH 2/3] blockdev: acquire AioContext in hmp_commit()

2015-11-04 Thread Denis V. Lunev
From: Stefan Hajnoczi This one slipped through. Although we acquire AioContext when committing all devices we don't for just a single device. AioContext must be acquired before calling bdrv_*() functions to synchronize access with other threads that may be using the AioContext. Signed-off-by:

[Qemu-devel] [PATCH 3/3] block: guard bdrv_drain in bdrv_close with aio_context_acquire

2015-11-04 Thread Denis V. Lunev
bdrv_close is called in to much places to properly track at the moment. Signed-off-by: Denis V. Lunev CC: Stefan Hajnoczi --- block.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block.c b/block.c index e9f40dc..98b0b66 100644 --- a/block.c +++ b/block.c @@ -1895,6 +1895,7 @@ vo

[Qemu-devel] [PATCH 1/3] block: add missed aio_context_acquire around bdrv_set_aio_context

2015-11-04 Thread Denis V. Lunev
It is required for bdrv_drain. Signed-off-by: Denis V. Lunev CC: Stefan Hajnoczi --- block/block-backend.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index 19fdaae..07fcfc7 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @

Re: [Qemu-devel] [PATCH v9 03/27] qapi: Plug leaks in test-qmp-*

2015-11-04 Thread Eric Blake
On 11/04/2015 01:19 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Make valgrind happy with the current state of the tests, so that >> it is easier to see if future patches introduce new memory problems >> without being drowned in noise. Many of the leaks were due to >> calling a second

[Qemu-devel] [PATCH 2.5 v2 0/3] misc missed aio_context_acquire for bdrv_drain

2015-11-04 Thread Denis V. Lunev
These bits were present in the following submission [PATCH QEMU 2.5 v4 0/10] dataplane snapshot fixes + aio_poll fixes and they are unrelated to the migration and safe enough to reach QEMU 2.5. Just sent separately not to miss them. Dangerous bits will be sent separately when we'll come into agre

[Qemu-devel] [PATCH] qcow2: Fix qcow2_get_cluster_offset() for zero clusters

2015-11-04 Thread Kevin Wolf
When searching for contiguous zero clusters, we only need to check the cluster type. Before this patch, an increasing offset (L2E_OFFSET_MASK) was expected, so that the function never returned more than a single zero cluster in practice. This patch fixes it to actually return as many contiguous zer

[Qemu-devel] [PATCH 08/11] migration: implement bdrv_all_find_vmstate_bs and bdrv_unlock helpers

2015-11-04 Thread Denis V. Lunev
bdrv_all_find_vmstate_bs will return locked BlockDriverState. The code written in the way to avoid nested locking taking into account that patch for locking inside qemu_fopen_bdrv/qemu_fclose is acceptable. Signed-off-by: Denis V. Lunev CC: Juan Quintela CC: Stefan Hajnoczi CC: Kevin Wolf ---

[Qemu-devel] [PATCH 04/11] snapshot: create bdrv_all_goto_snapshot helper

2015-11-04 Thread Denis V. Lunev
to switch to snapshot on all loaded block drivers. The patch also ensures proper locking. Signed-off-by: Denis V. Lunev CC: Juan Quintela CC: Stefan Hajnoczi CC: Kevin Wolf --- block/snapshot.c | 20 include/block/snapshot.h | 1 + migration/savevm.c | 15

[Qemu-devel] [PATCH 07/11] migration: reorder processing in hmp_savevm

2015-11-04 Thread Denis V. Lunev
This approach looks a bit more natural. State deletion can be performed on running VM which reduces VM downtime The situation when we have all devices read-only is not that frequent to optimize for it. We can afford to pause VM for the case. This reduces the amount of time when aio_context remain

[Qemu-devel] [PATCH 10/11] snapshot: create bdrv_all_create_snapshot helper

2015-11-04 Thread Denis V. Lunev
to create snapshot for all loaded block drivers. The patch also ensures proper locking. Signed-off-by: Denis V. Lunev CC: Juan Quintela CC: Stefan Hajnoczi CC: Kevin Wolf --- block/snapshot.c | 24 include/block/snapshot.h | 1 + migration/savevm.c | 2

[Qemu-devel] [PATCH 11/11] monitor: add missed aio_context_acquire into vm_completion call

2015-11-04 Thread Denis V. Lunev
Signed-off-by: Denis V. Lunev CC: Stefan Hajnoczi CC: Kevin Wolf CC: Luiz Capitulino CC: Markus Armbruster --- monitor.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index 6cd747f..3295840 100644 --- a/monitor.c +++ b/monitor.c @@ -3408

[Qemu-devel] [PATCH 05/11] snapshot: create bdrv_all_find_snapshot helper

2015-11-04 Thread Denis V. Lunev
to check that snapshot is available for all loaded block drivers. The ability to switch to snapshot is verified separately using bdrv_all_can_snapshot. The patch also ensures proper locking. Signed-off-by: Denis V. Lunev CC: Juan Quintela CC: Stefan Hajnoczi CC: Kevin Wolf --- block/snapshot

[Qemu-devel] [PATCH 03/11] snapshot: create bdrv_all_delete_snapshot helper

2015-11-04 Thread Denis V. Lunev
to delete snapshots from all loaded block drivers. The patch also ensures proper locking. Signed-off-by: Denis V. Lunev CC: Juan Quintela CC: Stefan Hajnoczi CC: Kevin Wolf --- block/snapshot.c | 22 include/block/snapshot.h | 2 ++ migration/savevm.c | 54

[Qemu-devel] [PATCH 09/11] migration: add missed aio_context_acquire for state writing/reading

2015-11-04 Thread Denis V. Lunev
aio_context should be locked in the similar way as was done in QMP snapshot creation in the other case there are a lot of possible troubles if native AIO mode is enabled for disk. qemu_fopen_bdrv and bdrv_fclose are used in real snapshot operations only along with block drivers. This change should

[Qemu-devel] [PATCH 02/11] snapshot: return error code from bdrv_snapshot_delete_by_id_or_name

2015-11-04 Thread Denis V. Lunev
this will make code better in the next patch Signed-off-by: Denis V. Lunev CC: Juan Quintela CC: Stefan Hajnoczi CC: Kevin Wolf --- block/snapshot.c | 7 --- include/block/snapshot.h | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/block/snapshot.c b/bloc

[Qemu-devel] [PATCH 2.5 v5 0/11] dataplane snapshot fixes

2015-11-04 Thread Denis V. Lunev
with test while /bin/true ; do virsh snapshot-create rhel7 sleep 10 virsh snapshot-delete rhel7 --current done with enabled iothreads on a running VM leads to a lot of troubles: hangs, asserts, errors. Anyway, I think that the construction like assert(aio_contex

  1   2   3   >