From: Marcelo Tosatti Subject: Re: [PATCH v4] qemu-kvm: Make PC speaker emulation aware of in-kernel PIT Date: Fri, 15 May 2009 19:14:22 -0300 Message-ID: <20090515221422.GB12643@amt.cnet> References: <4A092506.9090308@web.de> <4A09F0F9.7080804@web.de> <4A0C8259.4010701@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm-devel To: Jan Kiszka Return-path: Received: from mx2.redhat.com ([66.187.237.31]:43054 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752304AbZEOWOv (ORCPT ); Fri, 15 May 2009 18:14:51 -0400 Content-Disposition: inline In-Reply-To: <4A0C8259.4010701@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, May 14, 2009 at 10:43:05PM +0200, Jan Kiszka wrote: > When using the in-kernel PIT the speaker emulation has to synchronize > the PIT state with KVM. Enhance the existing speaker sound device and > allow it to take over port 0x61 by using KVM_CREATE_PIT2 where > available. This unbreaks -soundhw pcspk in KVM mode. > > Changes in v4: > - preserve full PIT state across read-modify-write > - update kvm.h > > Changes in v3: > - re-added incorrectly dropped kvm_enabled checks > > Changes in v2: > - rebased over qemu-kvm and KVM_CREATE_PIT2 > - refactored hooks in pcspk > > Signed-off-by: Jan Kiszka Jan, You always attempt to use KVM_CREATE_PIT2, so say on migration if the destination does not support the new ioctl you fallback to in-kernel dummy naturally. Seems the right thing to do. Would be nice to avoid sprinkling KVM details inside hw/pcspk.c though but that is another problem. Looks good (and v3 kernel patch).