[libvirt] [PATCH] Fix segfault if no qemu emulator passed

Daniel P. Berrange berrange at redhat.com
Tue Sep 9 09:39:23 UTC 2008


On Tue, Sep 09, 2008 at 09:56:47AM +0100, Daniel P. Berrange wrote:
> On Mon, Sep 08, 2008 at 11:10:17PM -0400, Cole Robinson wrote:
> > There is unfortunately a pretty prevalent
> > segfault in the latest libvirt. If a qemu
> > domain is defined without an emulator
> > specified, libvirtd crashes.
> > 
> > This is doubly unfortunate since current
> > virtinst generates an emulator-less config
> > for all qemu and kvm guests (I'm about to fix
> > this upstream though).
> 
> #%(*&#@(%@. Damn. This is worthy of a brown paper bag release for libvirt
> to fix this shockingly bad bug.

On a semi-related point, I recently updated my automated build server to
run Fedora 9, which means we now get code coverage reports for the libvirt
test suite.

  http://builder.virt-manager.org/artifacts/libvirt--devel/coverage/

If you look at line 789 you can see we never run any tests where the emulator
is NULL, which is why we never caught this bug. Something to fix in the test
suite :-)

  http://builder.virt-manager.org/artifacts/libvirt--devel/coverage/libvirt--devel/src/qemu_conf.c.gcov.html

It also highlights that we really need to create some kind of functional
test rig, because we've got alot of code that is simply not possible to
unit test because it interacts with host OS state / functionality.

That said we ought to be able to get some better code coverage of the
libvirtd daemon by leveraging the test hypervisor drive at least.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list