From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH kvm-unit-tests 4/4] Add sample test using the api test harness Date: Sun, 28 Nov 2010 11:04:22 +0200 Message-ID: <20101128090422.GC3330@redhat.com> References: <1290595933-13122-1-git-send-email-avi@redhat.com> <1290595933-13122-5-git-send-email-avi@redhat.com> <20101126141721.GA6124@redhat.com> <4CF0CC4A.8070100@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:54198 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797Ab0K1J1n (ORCPT ); Sun, 28 Nov 2010 04:27:43 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAS9Rhf6030389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 28 Nov 2010 04:27:43 -0500 Content-Disposition: inline In-Reply-To: <4CF0CC4A.8070100@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Nov 27, 2010 at 11:15:54AM +0200, Avi Kivity wrote: > On 11/26/2010 04:17 PM, Michael S. Tsirkin wrote: > >> + > >> +int main(int ac, char **av) > >> +{ > >> + kvm::system system; > >> + kvm::vm vm(system); > >> + identity::setup_vm(vm); > >> + kvm::vcpu vcpu(vm, 0); > >> + identity::vcpu thread(vcpu, set_global); > >> + vcpu.run(); > >> + printf("global %d\n", global); > >> + return global == 1; > >> +} > > > >I note that no exceptions are caught. So any failure will get us a crash, > >is there an indication what went wrong? > > > > I'll add a try/catch. So we'll get a "test failed: error 11" at high level? That's still not very helpful for debugging. The specific test might be better served by assert calls after each ioctl than an elaborate exception handling scheme. > -- > I have a truly marvellous patch that fixes the bug which this > signature is too narrow to contain.