Re: [PATCH v2] qemu-kvm: Switch to upstream -enable-kvm semantics

2011-01-03 Thread Avi Kivity
On 01/02/2011 09:52 PM, Richard W.M. Jones wrote: On Sun, Jan 02, 2011 at 11:15:33AM +0100, Jan Kiszka wrote: Does any qemu-kvm user rely on the automatic fallback to TCG if KVM initialization fails? Yes, libguestfs does ... ... or at least we would like to be able to reliably request this

[PATCH v2 09/17] kvm: x86: Fix xcr0 reset mismerge

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com For unknown reasons, xcr0 reset ended up in kvm_arch_update_guest_debug on upstream merge. Fix this and also remove the misleading comment (1 is THE reset value). Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- target-i386/kvm.c |3 +-- 1 files

[PATCH v2 07/17] kvm: x86: Prepare kvm_get_mp_state for in-kernel irqchip

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com This code path will not yet be taken as we still lack in-kernel irqchip support. But qemu-kvm can already make use of it and drop its own mp_state access services. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- target-i386/kvm.c |3 +++ 1 files

[PATCH v2 05/17] x86: Optionally dump code bytes on cpu_dump_state

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Introduce the cpu_dump_state flag CPU_DUMP_CODE and implement it for x86. This writes out the code bytes around the current instruction pointer. Make use of this feature in KVM to help debugging fatal vm exits. Signed-off-by: Jan Kiszka

[PATCH v2 14/17] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com If kvmclock is used, which implies the kernel supports it, register a kvmclock device with the sysbus. Its main purpose is to save and restore the kernel state on migration, but this will also allow to visualize it one day. Signed-off-by: Jan Kiszka

[PATCH v2 16/17] kvm: x86: Rework identity map and TSS setup for larger BIOS sizes

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com First of all, we only need this EPT identity and TSS reservation on Intel CPUs. Then, in order to support loading BIOSes 256K, reorder the code, adjusting the base if the kernel supports moving the identity map. We can drop the check for

[PATCH v2 15/17] kvm: Drop smp_cpus argument from init functions

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com No longer used. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kvm-all.c |4 ++-- kvm-stub.c |2 +- kvm.h |4 ++-- target-i386/kvm.c |2 +- target-ppc/kvm.c |2 +- target-s390x/kvm.c |2 +-

[PATCH v2 13/17] kvm: Eliminate KVMState arguments

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com QEMU supports only one VM, so there is only one kvm_state per process, and we gain nothing passing a reference to it around. Eliminate any need to refer to it outside of kvm-all.c. Signed-off-by: Jan Kiszka jan.kis...@siemens.com CC: Alexander Graf

[PATCH v2 02/17] kvm: Drop return value of kvm_cpu_exec

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com It is not used, it is not needed, so let's remove it. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kvm-all.c |6 ++ kvm-stub.c |4 ++-- kvm.h |2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/kvm-all.c

[PATCH v2 11/17] kvm: x86: Reset paravirtual MSRs

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Make sure to clear MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK, and MSR_KVM_ASYNC_PF_EN so that a freshly booted guest cannot be disturbed by old values. Signed-off-by: Jan Kiszka jan.kis...@siemens.com CC: Glauber Costa glom...@redhat.com ---

[PATCH v2 17/17] kvm: Drop dependencies on very old capabilities

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com COALESCED_MMIO, SYNC_MMU, EXT_CPUID, CLOCKSOURCE, NOP_IO_DELAY, PV_MMU - all these caps predate features on which we already depend at build time. Moreover, the check for KVM_CAP_EXT_CPUID is unneeded as we already test fail is a more recent feature is

[PATCH v2 06/17] kvm: x86: Align kvm_arch_put_registers code with comment

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com The ordering doesn't matter in this case, but better keep it consistent. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- target-i386/kvm.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target-i386/kvm.c

[PATCH v2 10/17] kvm: x86: Refactor msr_star/hsave_pa setup and checks

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Simplify kvm_has_msr_star/hsave_pa to booleans and push their one-time initialization into kvm_arch_init. Also handle potential errors of that setup procedure. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- target-i386/kvm.c | 47

[PATCH v2 04/17] kvm: Improve reporting of fatal errors

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Report KVM_EXIT_UNKNOWN, KVM_EXIT_FAIL_ENTRY, and KVM_EXIT_EXCEPTION with more details to stderr. The latter two are so far x86-only, so move them into the arch-specific handler. Integrate the Intel real mode warning on KVM_EXIT_FAIL_ENTRY that qemu-kvm

USB Scanner

2011-01-03 Thread Matthias Henze (L)
Hi, finally I've tried to connect a USB scanner to a KVM VM. I've done so by adding hostusb: 04a9:1606 to the VMs conf. The scanner is detected by Windows XP and at first it seemed to work. It scanns but then CapturePerfect hangs for ever. lsusb reports: Bus 002 Device 005: ID 04a9:1606

Role of qemu_fair_mutex

2011-01-03 Thread Jan Kiszka
Hi, at least in kvm mode, the qemu_fair_mutex seems to have lost its function of balancing qemu_global_mutex access between the io-thread and vcpus. It's now only taken by the latter, isn't it? This and the fact that qemu-kvm does not use this kind of lock made me wonder what its role is and if

Re: Role of qemu_fair_mutex

2011-01-03 Thread Avi Kivity
On 01/03/2011 11:46 AM, Jan Kiszka wrote: Hi, at least in kvm mode, the qemu_fair_mutex seems to have lost its function of balancing qemu_global_mutex access between the io-thread and vcpus. It's now only taken by the latter, isn't it? This and the fact that qemu-kvm does not use this kind of

Re: Role of qemu_fair_mutex

2011-01-03 Thread Jan Kiszka
Am 03.01.2011 11:01, Avi Kivity wrote: On 01/03/2011 11:46 AM, Jan Kiszka wrote: Hi, at least in kvm mode, the qemu_fair_mutex seems to have lost its function of balancing qemu_global_mutex access between the io-thread and vcpus. It's now only taken by the latter, isn't it? This and the

Re: Role of qemu_fair_mutex

2011-01-03 Thread Avi Kivity
On 01/03/2011 12:03 PM, Jan Kiszka wrote: Am 03.01.2011 11:01, Avi Kivity wrote: On 01/03/2011 11:46 AM, Jan Kiszka wrote: Hi, at least in kvm mode, the qemu_fair_mutex seems to have lost its function of balancing qemu_global_mutex access between the io-thread and vcpus. It's now only

Re: [PATCH v2 13/17] kvm: Eliminate KVMState arguments

2011-01-03 Thread Alexander Graf
On 03.01.2011, at 09:33, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com QEMU supports only one VM, so there is only one kvm_state per process, and we gain nothing passing a reference to it around. Eliminate any need to refer to it outside of kvm-all.c. Slightly unqemu'ish, but

Re: [PATCH v2] qemu-kvm: Switch to upstream -enable-kvm semantics

2011-01-03 Thread Richard W.M. Jones
On Mon, Jan 03, 2011 at 10:28:12AM +0200, Avi Kivity wrote: On 01/02/2011 09:52 PM, Richard W.M. Jones wrote: On Sun, Jan 02, 2011 at 11:15:33AM +0100, Jan Kiszka wrote: Does any qemu-kvm user rely on the automatic fallback to TCG if KVM initialization fails? Yes, libguestfs does ...

Re: [PATCH v2] qemu-kvm: Switch to upstream -enable-kvm semantics

2011-01-03 Thread Avi Kivity
On 01/03/2011 01:18 PM, Richard W.M. Jones wrote: On Mon, Jan 03, 2011 at 10:28:12AM +0200, Avi Kivity wrote: On 01/02/2011 09:52 PM, Richard W.M. Jones wrote: On Sun, Jan 02, 2011 at 11:15:33AM +0100, Jan Kiszka wrote: Does any qemu-kvm user rely on the automatic fallback to TCG if KVM

qemu vs. kvm: When to flush the coalesced mmio buffer?

2011-01-03 Thread Jan Kiszka
Hi again, another subtle difference between qemu-kvm and upstream: When we leave the guest for an IO window (KVM_RUN returns EINTR or EAGAIN), we call kvm_flush_coalesced_mmio_buffer in qemu-kvm but not in upstream. When version is better? I can't find any rationales in both git logs. Jan

Re: [Qemu-devel] qemu vs. kvm: When to flush the coalesced mmio buffer?

2011-01-03 Thread Gleb Natapov
On Mon, Jan 03, 2011 at 01:11:32PM +0100, Jan Kiszka wrote: Hi again, another subtle difference between qemu-kvm and upstream: When we leave the guest for an IO window (KVM_RUN returns EINTR or EAGAIN), we call kvm_flush_coalesced_mmio_buffer in qemu-kvm but not in upstream. When version

[PATCH 0/2] Fix vmx real-mode state leakage

2011-01-03 Thread Avi Kivity
When emulating real mode, we fake some segment state to conform with vm86 mode. Unfortunately, we allow the guest to see this fake state if we live migrate when this state is in effect. This patchset corrects the problem. Avi Kivity (2): KVM: VMX: Save and restore tr selector across mode

[PATCH 2/2] KVM: VMX: Avoid leaking fake realmode state to userspace

2011-01-03 Thread Avi Kivity
When emulating real mode, we fake some state: - tr.base points to a fake vm86 tss - segment registers are made to conform to vm86 restrictions change vmx_get_segment() not to expose this fake state to userspace; instead, return the original state. Signed-off-by: Avi Kivity a...@redhat.com ---

Re: qemu vs. kvm: When to flush the coalesced mmio buffer?

2011-01-03 Thread Jan Kiszka
Am 03.01.2011 13:32, Avi Kivity wrote: On 01/03/2011 02:11 PM, Jan Kiszka wrote: Hi again, another subtle difference between qemu-kvm and upstream: When we leave the guest for an IO window (KVM_RUN returns EINTR or EAGAIN), we call kvm_flush_coalesced_mmio_buffer in qemu-kvm but not in

[PATCH 18/17] kvm: Flush coalesced mmio buffer on IO window exits

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com We must flush pending mmio writes if we leave kvm_cpu_exec for an IO window. Otherwise we risk to loose those requests when migrating to a different host during that window. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kvm-all.c |4 ++-- 1

[PATCH v3 05/17] x86: Optionally dump code bytes on cpu_dump_state

2011-01-03 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Introduce the cpu_dump_state flag CPU_DUMP_CODE and implement it for x86. This writes out the code bytes around the current instruction pointer. Make use of this feature in KVM to help debugging fatal vm exits. Signed-off-by: Jan Kiszka

Re: [Qemu-devel] Re: [PATCH v3] qemu, qmp: convert do_inject_nmi() to QObject, QError

2011-01-03 Thread Luiz Capitulino
On Mon, 20 Dec 2010 14:09:05 +0800 Lai Jiangshan la...@cn.fujitsu.com wrote: On 12/17/2010 11:25 PM, Avi Kivity wrote: On 12/17/2010 01:22 PM, Luiz Capitulino wrote: I think Avi's suggest is better, and I will use inject-nmi (without cpu-index argument) to send NMI to all cpus,

Re: [Qemu-devel] [PATCH 1/3] nmi: convert cpu_index to cpu-index

2011-01-03 Thread Luiz Capitulino
On Mon, 20 Dec 2010 18:00:34 +0100 Markus Armbruster arm...@redhat.com wrote: Lai Jiangshan la...@cn.fujitsu.com writes: cpu-index is better name. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git a/hmp-commands.hx b/hmp-commands.hx index 4befbe2..8de7aa3 100644

[PATCH] increase ple_gap default to 64

2011-01-03 Thread Rik van Riel
On some CPUs, a ple_gap of 41 is simply insufficient to ever trigger PLE exits, even with the minimalistic PLE test from kvm-unit-tests. http://git.kernel.org/?p=virt/kvm/kvm-unit-tests.git;a=commitdiff;h=eda71b28fa122203e316483b35f37aaacd42f545 For example, the Xeon X5670 CPU needs a ple_gap of

Re: USB Scanner

2011-01-03 Thread Erik Rull
Matthias Henze (L) wrote: Hi, finally I've tried to connect a USB scanner to a KVM VM. I've done so by adding hostusb: 04a9:1606 to the VMs conf. The scanner is detected by Windows XP and at first it seemed to work. It scanns but then CapturePerfect hangs for ever. lsusb reports: Bus 002

Re: [PATCH v2 14/17] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-03 Thread Avi Kivity
On 01/03/2011 10:33 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com If kvmclock is used, which implies the kernel supports it, register a kvmclock device with the sysbus. Its main purpose is to save and restore the kernel state on migration, but this will also allow to visualize it

Re: [PATCH v2 14/17] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-03 Thread Jan Kiszka
Am 03.01.2011 17:04, Avi Kivity wrote: On 01/03/2011 10:33 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com If kvmclock is used, which implies the kernel supports it, register a kvmclock device with the sysbus. Its main purpose is to save and restore the kernel state on

Re: [PATCH v2 14/17] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-03 Thread Glauber Costa
On Mon, 2011-01-03 at 09:33 +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com If kvmclock is used, which implies the kernel supports it, register a kvmclock device with the sysbus. Its main purpose is to save and restore the kernel state on migration, but this will also allow

Re: [PATCH v2 14/17] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-03 Thread Glauber Costa
On Mon, 2011-01-03 at 18:04 +0200, Avi Kivity wrote: On 01/03/2011 10:33 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com If kvmclock is used, which implies the kernel supports it, register a kvmclock device with the sysbus. Its main purpose is to save and restore the kernel

Re: [PATCH v2 14/17] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-03 Thread Glauber Costa
On Mon, 2011-01-03 at 17:30 +0100, Jan Kiszka wrote: Am 03.01.2011 17:04, Avi Kivity wrote: On 01/03/2011 10:33 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com If kvmclock is used, which implies the kernel supports it, register a kvmclock device with the sysbus. Its main

Re: [PATCH v2 11/17] kvm: x86: Reset paravirtual MSRs

2011-01-03 Thread Glauber Costa
On Mon, 2011-01-03 at 09:33 +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Make sure to clear MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK, and MSR_KVM_ASYNC_PF_EN so that a freshly booted guest cannot be disturbed by old values. Signed-off-by: Jan Kiszka

Re: [PATCH v2 14/17] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-03 Thread Avi Kivity
On 01/03/2011 06:30 PM, Jan Kiszka wrote: Am 03.01.2011 17:04, Avi Kivity wrote: On 01/03/2011 10:33 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com If kvmclock is used, which implies the kernel supports it, register a kvmclock device with the sysbus. Its main purpose is to

Re: [PATCH v2 11/17] kvm: x86: Reset paravirtual MSRs

2011-01-03 Thread Jan Kiszka
Am 03.01.2011 17:40, Glauber Costa wrote: On Mon, 2011-01-03 at 09:33 +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Make sure to clear MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK, and MSR_KVM_ASYNC_PF_EN so that a freshly booted guest cannot be disturbed by old values.

Re: [PATCH v2 14/17] kvm: x86: Introduce kvmclock device to save/restore its state

2011-01-03 Thread Jan Kiszka
Am 03.01.2011 17:37, Glauber Costa wrote: On Mon, 2011-01-03 at 09:33 +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com If kvmclock is used, which implies the kernel supports it, register a kvmclock device with the sysbus. Its main purpose is to save and restore the kernel

Re: [PATCH] KVM: pvclock_clocksource_read while-loop optimization

2011-01-03 Thread Glauber Costa
On Sat, 2011-01-01 at 21:51 +0100, Arjan Koers wrote: Reduce the number of while-loop iterations (from two to one in the most common situation) Signed-off-by: Arjan Koers 0h61vkll2...@xutrox.com diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c index 42eb330..8f52acb

Re: [PATCH v2 11/17] kvm: x86: Reset paravirtual MSRs

2011-01-03 Thread Glauber Costa
On Mon, 2011-01-03 at 17:46 +0100, Jan Kiszka wrote: Am 03.01.2011 17:40, Glauber Costa wrote: On Mon, 2011-01-03 at 09:33 +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Make sure to clear MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK, and MSR_KVM_ASYNC_PF_EN so that a

Re: [PATCH v2 16/17] kvm: x86: Rework identity map and TSS setup for larger BIOS sizes

2011-01-03 Thread Jan Kiszka
Am 03.01.2011 17:06, Avi Kivity wrote: On 01/03/2011 10:33 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com First of all, we only need this EPT identity and TSS reservation on Intel CPUs. kvm-amd will ignore it just fine. I'd like to keep arch differences away from userspace.

Re: [PATCH v2 16/17] kvm: x86: Rework identity map and TSS setup for larger BIOS sizes

2011-01-03 Thread Avi Kivity
On 01/03/2011 06:52 PM, Jan Kiszka wrote: Am 03.01.2011 17:06, Avi Kivity wrote: On 01/03/2011 10:33 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com First of all, we only need this EPT identity and TSS reservation on Intel CPUs. kvm-amd will ignore it just fine. I'd

Re: [PATCH v2 2/2] qemu,qmp: convert do_inject_nmi() to QObject, QError

2011-01-03 Thread Luiz Capitulino
On Mon, 20 Dec 2010 08:47:46 -0200 Marcelo Tosatti mtosa...@redhat.com wrote: On Fri, Dec 10, 2010 at 09:20:26AM -0200, Luiz Capitulino wrote: On Fri, 10 Dec 2010 14:36:08 +0800 Lai Jiangshan la...@cn.fujitsu.com wrote: +SQMP +inject_nmi +-- + +Inject an NMI on the

Re: [PATCH v2 17/17] kvm: Drop dependencies on very old capabilities

2011-01-03 Thread Avi Kivity
On 01/03/2011 06:54 PM, Jan Kiszka wrote: Am 03.01.2011 17:08, Avi Kivity wrote: On 01/03/2011 10:33 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com COALESCED_MMIO, SYNC_MMU, EXT_CPUID, CLOCKSOURCE, NOP_IO_DELAY, PV_MMU - all these caps predate features on which we already

Re: [PATCH v2 16/17] kvm: x86: Rework identity map and TSS setup for larger BIOS sizes

2011-01-03 Thread Jan Kiszka
Am 03.01.2011 17:59, Avi Kivity wrote: On 01/03/2011 06:52 PM, Jan Kiszka wrote: Am 03.01.2011 17:06, Avi Kivity wrote: On 01/03/2011 10:33 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com First of all, we only need this EPT identity and TSS reservation on Intel CPUs.

Re: [PATCH v2 17/17] kvm: Drop dependencies on very old capabilities

2011-01-03 Thread Jan Kiszka
Am 03.01.2011 18:01, Avi Kivity wrote: On 01/03/2011 06:54 PM, Jan Kiszka wrote: Am 03.01.2011 17:08, Avi Kivity wrote: On 01/03/2011 10:33 AM, Jan Kiszka wrote: From: Jan Kiszkajan.kis...@siemens.com COALESCED_MMIO, SYNC_MMU, EXT_CPUID, CLOCKSOURCE, NOP_IO_DELAY, PV_MMU - all

[KVM-AUTOTEST PATCH 01/17] KVM test: introduce exception classes for _remote_login() and _remote_scp()

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_utils.py | 68 +++- 1 files changed, 66 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py index 49e3fe8..41117e3 100644 ---

[KVM-AUTOTEST PATCH 02/17] KVM test: kvm_utils.py: reorder remote_login(), remote_scp(), copy_files_to(), etc

2011-01-03 Thread Michael Goldish
Reorder the definition of these functions so that login functions are clustered together, and higher level functions are further down in the file. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_utils.py | 180 1 files

[KVM-AUTOTEST PATCH 03/17] KVM test: use the new LoginError and SCPError exceptions

2011-01-03 Thread Michael Goldish
- Raise these exceptions where appropriate (remote_login(), remote_scp(), etc) - Modify code that uses the functions that raise the new exceptions to account for their changed behavior. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py |

[KVM-AUTOTEST PATCH 04/17] KVM test: add VM.wait_for_login() and kvm_utils.wait_for_login()

2011-01-03 Thread Michael Goldish
These are intended as a replacement for kvm_test_utils.wait_for_login(). Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_utils.py | 29 +++ client/tests/kvm/kvm_vm.py| 43 + 2 files changed, 72

[KVM-AUTOTEST PATCH 05/17] KVM test: use the new wait_for_login()

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_test_utils.py |4 +--- client/tests/kvm/tests/autotest.py |2 +- client/tests/kvm/tests/balloon_check.py|2 +- client/tests/kvm/tests/boot.py |

[KVM-AUTOTEST PATCH 08/17] KVM test: let kvm_vm.create_image() raise a CmdError if qemu-img fails

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py | 15 ++- 1 files changed, 2 insertions(+), 13 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index c237fbe..32be55e 100755 --- a/client/tests/kvm/kvm_vm.py +++

[KVM-AUTOTEST PATCH 10/17] KVM test: add VM.verify_alive() and Monitor.verify_responsive()

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_monitor.py | 31 +++ client/tests/kvm/kvm_vm.py | 21 - 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/client/tests/kvm/kvm_monitor.py

[KVM-AUTOTEST PATCH 11/17] KVM test: use VM.verify_alive() instead of kvm_test_utils.get_living_vm()

2011-01-03 Thread Michael Goldish
It looks cleaner even though it's 1 extra line. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests/autotest.py |3 ++- client/tests/kvm/tests/balloon_check.py|3 ++- client/tests/kvm/tests/boot.py |3 ++-

[KVM-AUTOTEST PATCH 13/17] KVM test: make migrate() a VM method

2011-01-03 Thread Michael Goldish
This should make it easier to run things in parallel to migration, because the method switches the VM object's __dict__ instead of the VM object itself. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py | 142 1 files

[KVM-AUTOTEST PATCH 15/17] KVM test: use VM.migrate() instead of kvm_test_utils.migrate()

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/tests/migration.py|7 +++ client/tests/kvm/tests/migration_multi_host.py |3 +-- client/tests/kvm/tests/timedrift_with_migration.py |2 +- 3 files changed, 5 insertions(+), 7 deletions(-)

[KVM-AUTOTEST PATCH 16/17] KVM test: reorder kvm_utils.copy_files_from() path parameters

2011-01-03 Thread Michael Goldish
Reorder path parameters in copy_files_from(). Currently it uses the same order as copy_files_to() (local_path, remote_path) which is counterintuitive IMO (because copy_files_from() copies from a remote host to localhost). Change it to remote_path, then local_path. This is a very low-impact

[KVM-AUTOTEST PATCH 06/17] KVM test: rename VM.remote_login() to VM.login()

2011-01-03 Thread Michael Goldish
Keep remote_login() as an alias for backward compatibility. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py |2 +- client/tests/kvm/kvm_test_utils.py|2 +- client/tests/kvm/kvm_vm.py| 21 ++---

[KVM-AUTOTEST PATCH 07/17] KVM test: introduce VM exceptions

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py | 146 1 files changed, 146 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index e310401..c237fbe 100755 ---

[KVM-AUTOTEST PATCH 09/17] KVM test: use the new VM exceptions

2011-01-03 Thread Michael Goldish
- Raise them where appropriate. - Catch and handle them where appropriate. - Modify docstrings. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py|9 +-- client/tests/kvm/kvm_test_utils.py |5 +- client/tests/kvm/kvm_vm.py

[KVM-AUTOTEST PATCH 14/17] KVM test: simplify migration_with_reboot and migration_with_file_transfer

2011-01-03 Thread Michael Goldish
Now that migration can be performed without switching VMs (but rather by switching states) these tests can be greatly simplified. Signed-off-by: Michael Goldish mgold...@redhat.com --- .../kvm/tests/migration_with_file_transfer.py | 53 +++-

[KVM-AUTOTEST PATCH 17/17] KVM test: rename path parameters in kvm_vm.copy_files_*()

2011-01-03 Thread Michael Goldish
local_path - host_path remote_path - guest_path Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_vm.py | 17 - 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index

[KVM-AUTOTEST PATCH 12/17] KVM test: kvm_preprocessing.py: simplify handling of params['migration_mode']

2011-01-03 Thread Michael Goldish
Also reorder the if statements because if migration_mode is specified it causes an unconditional VM restart (unlike start_vm). Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py | 16 ++-- 1 files changed, 6 insertions(+), 10 deletions(-)

[KVM-AUTOTEST PATCH 1/7] [RFC] Fix Unhandled* exceptions

2011-01-03 Thread Michael Goldish
In recent Python version, when exceptions are unpickled their __init__() method is called again. The parameters passed to __init__() upon unpickling are *self.args. Because the first execution of __init__() sets self.args to something different from the parameters passed to __init__() (by

[KVM-AUTOTEST PATCH 2/7] [RFC] CmdError: remove extra blank line between methods

2011-01-03 Thread Michael Goldish
For consistency with other exception classes, keep just a single blank line between __init__() and __str__(). Signed-off-by: Michael Goldish mgold...@redhat.com --- client/common_lib/error.py |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/client/common_lib/error.py

[KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Michael Goldish
In complex tests (KVM) an exception string is often not informative enough and the traceback and source code have to be examined in order to figure out what caused the exception. Context strings are a way for tests to provide information about what they're doing, so that when an exception is

[KVM-AUTOTEST PATCH 4/7] [RFC] Embed context information in exception strings

2011-01-03 Thread Michael Goldish
Exceptions look for a .context attribute and embed it in the string returned by __str__(). If the attribute isn't set (or if it's an empty strgin) nothing is embedded. Signed-off-by: Michael Goldish mgold...@redhat.com --- client/common_lib/error.py | 13 - 1 files changed, 12

[KVM-AUTOTEST PATCH 5/7] [RFC] Set the .context attribute for exceptions in _call_test_function()

2011-01-03 Thread Michael Goldish
Before passing exceptions on up, inject context information into them which can later be used by __str__(). Signed-off-by: Michael Goldish mgold...@redhat.com --- client/common_lib/test.py | 16 ++-- 1 files changed, 10 insertions(+), 6 deletions(-) diff --git

[KVM-AUTOTEST PATCH 6/7] [RFC] KVM test: use error.context() in migration_with_file_transfer

2011-01-03 Thread Michael Goldish
This is an example of a case where context information is useful. Signed-off-by: Michael Goldish mgold...@redhat.com --- .../kvm/tests/migration_with_file_transfer.py |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git

[KVM-AUTOTEST PATCH 7/7] [RFC] KVM test: use error.context() in kvm_preprocessing.py

2011-01-03 Thread Michael Goldish
Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py index 5ce0a3b..b7f3154 100644 ---

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Eduardo Habkost
On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote: +# Exception context information: +# -- +# Every function can have some context string associated with it. +# The context string can be changed by calling context(str) and cleared by +# calling

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Eduardo Habkost
On Mon, Jan 03, 2011 at 05:26:20PM -0200, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote: +# Exception context information: +# -- +# Every function can have some context string associated with it. +# The context string

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Michael Goldish
On 01/03/2011 09:26 PM, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote: +# Exception context information: +# -- +# Every function can have some context string associated with it. +# The context string can be changed by

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Eduardo Habkost
On Mon, Jan 03, 2011 at 09:48:02PM +0200, Michael Goldish wrote: On 01/03/2011 09:26 PM, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote: +# Exception context information: +# -- +# Every function can have some context

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Eduardo Habkost
On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote: + +context_data = threading.local() +context_data.contexts = {} Won't this create a single dictionary, only for one single thread, leaving all other threads with 'context_data.contexts' undefined? -- Eduardo -- To unsubscribe

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Michael Goldish
On 01/03/2011 10:26 PM, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote: + +context_data = threading.local() +context_data.contexts = {} Won't this create a single dictionary, only for one single thread, leaving all other threads with

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Michael Goldish
On 01/03/2011 10:16 PM, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 09:48:02PM +0200, Michael Goldish wrote: On 01/03/2011 09:26 PM, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 08:34:07PM +0200, Michael Goldish wrote: +# Exception context information: +# --

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Eduardo Habkost
On Mon, Jan 03, 2011 at 11:07:53PM +0200, Michael Goldish wrote: If I understand your suggestion correctly, then: - The purpose of contexts is to add information to exceptions. If an exception is raised and you call clear_context() in a finally clause, you remove the context of the

[RFC -v3 PATCH 1/3] kvm: keep track of which task is running a KVM vcpu

2011-01-03 Thread Rik van Riel
Keep track of which task is running a KVM vcpu. This helps us figure out later what task to wake up if we want to boost a vcpu that got preempted. Unfortunately there are no guarantees that the same task always keeps the same vcpu, so we can only track the task across a single run of the vcpu.

[RFC -v3 PATCH 0/3] directed yield for Pause Loop Exiting

2011-01-03 Thread Rik van Riel
When running SMP virtual machines, it is possible for one VCPU to be spinning on a spinlock, while the VCPU that holds the spinlock is not currently running, because the host scheduler preempted it to run something else. Both Intel and AMD CPUs have a feature that detects when a virtual CPU is

[RFC -v3 PATCH 3/3] Subject: kvm: use yield_to instead of sleep in kvm_vcpu_on_spin

2011-01-03 Thread Rik van Riel
Instead of sleeping in kvm_vcpu_on_spin, which can cause gigantic slowdowns of certain workloads, we instead use yield_to to hand the rest of our timeslice to another vcpu in the same KVM guest. Signed-off-by: Rik van Riel r...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff

[RFC -v3 PATCH 2/3] sched: add yield_to function

2011-01-03 Thread Rik van Riel
From: Mike Galbraith efa...@gmx.de Add a yield_to function to the scheduler code, allowing us to give enough of our timeslice to another thread to allow it to run and release whatever resource we need it to release. We may want to use this to provide a sys_yield_to system call one day.

Re: [Autotest] [KVM-AUTOTEST PATCH 3/7] [RFC] Introduce exception context strings

2011-01-03 Thread Michael Goldish
On 01/04/2011 12:06 AM, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 07:22:17PM -0200, Eduardo Habkost wrote: On Mon, Jan 03, 2011 at 11:07:53PM +0200, Michael Goldish wrote: If I understand your suggestion correctly, then: - The purpose of contexts is to add information to exceptions. If

Re: USB Scanner

2011-01-03 Thread Erik Rull
David Ahern wrote: The attached work for me with an Epson CX7800. I was able to print and scan with Vista; driver setup for XP was more of a pain - I only got the printer setup working. It's the EHCI code from git://git.kiszka.org/qemu.git ehci with

Re: USB Scanner

2011-01-03 Thread David Ahern
On 01/03/11 16:35, Erik Rull wrote: David Ahern wrote: The attached work for me with an Epson CX7800. I was able to print and scan with Vista; driver setup for XP was more of a pain - I only got the printer setup working. It's the EHCI code from git://git.kiszka.org/qemu.git ehci

Re: USB Scanner

2011-01-03 Thread David Ahern
On 01/03/11 16:50, David Ahern wrote: thanks for the patch. Have you tested USB transfer rates using a USB Memory Stick or something similar? If yes, which transfer rates have you reached? hmm more specifically, 8-11 Mbps depending on type of USB storage device. Harddrives work better

[PATCH 1/2] KVM-test: Add a subtest: nic_hotplug

2011-01-03 Thread Lucas Meneghel Rodrigues
From: Amos Kong ak...@redhat.com Original nic hotplug test only adds a netdev to guest, but it doesn't add a nic device to guest and check the network status of new interface. This test only works with latest qemu-kvm. Changes from v1: * Style fixes * Don't sleep before erroring out the test

[PATCH 2/2] KVM-test: Add set_link subtest

2011-01-03 Thread Lucas Meneghel Rodrigues
From: Amos Kong ak...@redhat.com This test is used to check if packages are transmit into guest while put down/up guest link in monitor. The ping test can only pass when link is up. do file transfer test at the end of this test. Changes from v1: * Style corrections Signed-off-by: Amos Kong

Re: [RFC -v3 PATCH 2/3] sched: add yield_to function

2011-01-03 Thread Mike Galbraith
On Mon, 2011-01-03 at 16:29 -0500, Rik van Riel wrote: From: Mike Galbraith efa...@gmx.de Add a yield_to function to the scheduler code, allowing us to give enough of our timeslice to another thread to allow it to run and release whatever resource we need it to release. We may want to use

Re: [PATCH 1/2] KVM: test: add the test case to check PFEC on prefetch pte path

2011-01-03 Thread Xiao Guangrong
On 01/03/2011 11:11 PM, Avi Kivity wrote: On 12/23/2010 10:10 AM, Xiao Guangrong wrote: Check page fault error code on prefetch pte path Can you point out the commit which fixed this failure? I'd like to backport it if it's simple enough. The commit is 3ddf6c06e13e: commit

Re: [PATCH] increase ple_gap default to 64

2011-01-03 Thread Zhai, Edwin
Riel, Thanks for your patch. I have changed the ple_gap to 128 on xen side, but forget the patch for KVM:( A little bit big is no harm, but more perf data is better. Rik van Riel wrote: On some CPUs, a ple_gap of 41 is simply insufficient to ever trigger PLE exits, even with the

Re: [RFC -v3 PATCH 2/3] sched: add yield_to function

2011-01-03 Thread KOSAKI Motohiro
From: Mike Galbraith efa...@gmx.de Add a yield_to function to the scheduler code, allowing us to give enough of our timeslice to another thread to allow it to run and release whatever resource we need it to release. We may want to use this to provide a sys_yield_to system call one day.

Re: [RFC -v3 PATCH 0/3] directed yield for Pause Loop Exiting

2011-01-03 Thread Mike Galbraith
A couple questions. On Mon, 2011-01-03 at 16:26 -0500, Rik van Riel wrote: When running SMP virtual machines, it is possible for one VCPU to be spinning on a spinlock, while the VCPU that holds the spinlock is not currently running, because the host scheduler preempted it to run something