From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] Activate Virtualization On Demand Date: Wed, 18 Mar 2009 08:43:46 +0200 Message-ID: <49C09822.1000300@redhat.com> References: <1237279648-7839-1-git-send-email-agraf@suse.de> <49BF91D6.7000008@redhat.com> <95BBDC8C-D5CD-4B46-A3F2-4C22C55AB113@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" To: Alexander Graf Return-path: Received: from mx1.redhat.com ([66.187.233.31]:41681 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751250AbZCRGnL (ORCPT ); Wed, 18 Mar 2009 02:43:11 -0400 In-Reply-To: <95BBDC8C-D5CD-4B46-A3F2-4C22C55AB113@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: Alexander Graf wrote: >> >> Please make sure cpu hotplug/hotunplug (and this suspend/resume) >> still work. > > Make sure as in test? I use this: #!/usr/bin/python import commands, time, random processors = int(commands.getoutput('getconf _NPROCESSORS_CONF')) def fname(cpu): return '/sys/devices/system/cpu/cpu%s/online' % (cpu,) def get_state(cpu): return int(file(fname(cpu)).read()) def set_state(cpu, state): file(fname(cpu), 'w').write(str(state)) try: while True: cpu = random.randint(1, processors - 1) state = 1 - get_state(cpu) set_state(cpu, state) time.sleep(1) except KeyboardInterrupt: for cpu in range(1, processors): if not get_state(cpu): set_state(cpu, 1) -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.