From: Marcelo Tosatti Subject: Re: [PATCH v2 1/2] Do not register kvmclock savevm section if kvmclock is disabled. Date: Mon, 6 Dec 2010 19:04:01 -0200 Message-ID: <20101206210401.GB14704@amt.cnet> References: <1291644227-22923-1-git-send-email-glommer@redhat.com> <1291644227-22923-2-git-send-email-glommer@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, avi@redhat.com To: Glauber Costa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:64572 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754044Ab0LFVtR (ORCPT ); Mon, 6 Dec 2010 16:49:17 -0500 Content-Disposition: inline In-Reply-To: <1291644227-22923-2-git-send-email-glommer@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Dec 06, 2010 at 09:03:46AM -0500, Glauber Costa wrote: > Usually nobody usually thinks about that scenario (me included and specially), > but kvmclock can be actually disabled in the host. > > It happens in two scenarios: > 1. host too old. > 2. we passed -kvmclock to our -cpu parameter. > > In both cases, we should not register kvmclock savevm section. This patch > achives that by registering this section only if kvmclock is actually > currently enabled in cpuid. > > The only caveat is that we have to register the savevm section a little bit > later, since we won't know the final kvmclock state before cpuid gets parsed. What is the problem of registering the section? Restoring the value if the host does not support it returns an error? Can't you ignore the error if kvmclock is not reported in cpuid, in the restore handler? Also, please generate against uq/master.