From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXYTU-0001vD-MY for qemu-devel@nongnu.org; Fri, 26 Sep 2014 12:34:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXYTO-0003HB-GW for qemu-devel@nongnu.org; Fri, 26 Sep 2014 12:34:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXYTO-0003GY-8H for qemu-devel@nongnu.org; Fri, 26 Sep 2014 12:34:22 -0400 Date: Fri, 26 Sep 2014 13:34:10 -0300 From: Eduardo Habkost Message-ID: <20140926163410.GA3113@thinpad.lan.raisama.net> References: <1411676309-20218-1-git-send-email-ehabkost@redhat.com> <54258440.3060203@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54258440.3060203@redhat.com> Subject: Re: [Qemu-devel] [RFC 00/10] Target-specific unit test support, add unit tests for target-i386/cpu.c code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Igor Mammedov , qemu-devel@nongnu.org, Andreas =?iso-8859-1?Q?F=E4rber?= On Fri, Sep 26, 2014 at 05:20:32PM +0200, Paolo Bonzini wrote: > Il 25/09/2014 22:18, Eduardo Habkost ha scritto: > > This is an attempt to write unit tests for the target-i386/cpu.c code. By now, I > > just implemented 3 simple test cases, to ensure X86CPU objects can be created, > > and to ensure the CPU features are set properly depending on the CPU model > > table. > > + qemu-log.o \ > + qom/object.o qom/qom-qobject.o qom/cpu.o qom/container.o \ > + hw/core/qdev.o hw/core/qdev-properties.o hw/core/irq.o hw/core/fw-path-provider.o hw/core/hotplug.o \ > + vmstate.o qemu-file.o $(util-obj-y) \ > + x86_64-softmmu/cpus.o x86_64-softmmu/target-i386/machine.o \ > + tests/vl-stub.o tests/x86-stub.o tests/coroutine-stub.o tests/monitor-stub.o tests/aio-stub.o tests/timer-stub.o tests/block-stub.o \ > + stubs/reset.o stubs/sysbus.o stubs/vmstate.o stubs/fdset-remove-fd.o stubs/mon-printf.o stubs/qtest.o stubs/vm-stop.o > > Do you really need cpus.c? That's what brings in most dependencies, > and everything else should be included in libqemustub.a. To be honest, I don't remember why exactly I decided to pull cpus.c instead of making stubs for it. :) I will take a look again at what happens if I don't include it. > Also, util-obj-y should be replaced with libqemuutil.a I will change it to use libqemuutil.a. Thanks. > > In any case, most of these files are not needed by the linux-user > version of cpu.c, so I would need to know what exactly forces you > to include each of the files. I want to test KVM-specific code, which isn't enabled on linux-user. > > Also, would it be possible to do these tests via qtest and > qom-get/qom-set? Most things I want to test are not available through QMP or qtest yet. The whole point of this test code is to give us some safety while we are still implementing new QOM/QMP/qtest stuff. Specifically, I want to test some behavior that depend on having missing entries on the CPU feature name tables (e.g. the "migratable" property), and on the return values of kvm_arch_get_supported_cpuid(), so qtest won't work unless we add qtest/QMP code to hack kvm_arch_get_supported_cpuid() and the CPU model/feature tables. Maybe one day the externally-visible interfaces will become flexible and generic enough to allow this same test code to be implemented purely using qtest, but not today. > > That said, please feel free to send patches 1-3 now, via qemu-trivial. OK. Thanks. -- Eduardo