[libvirt] [PATCH] Set default emulator in domain_conf.*, rather than the driver.

Daniel P. Berrange berrange at redhat.com
Tue Jun 16 09:39:40 UTC 2009


On Mon, Jun 15, 2009 at 06:11:07PM -0400, Cole Robinson wrote:
> Rather than numerous instances of:
> 
> emulator = vm->def->emulator;
> if (!emulator)
>     emulator = virDomainDefDefaultEmulator(conn, vm->def, driver->caps);
> if (!emulator)
>     return -1;
> 
> Set this value at XML parse time in the domain config, so we can depend on
> it for all future emulator accesses. There were unchecked accesses in the
> qemu driver that were tripping up on this if no emulator was specified in
> the XML, see:
> 
> http://www.redhat.com/archives/libvir-list/2008-October/msg00602.html
> 
> Signed-off-by: Cole Robinson <crobinso at redhat.com>
> ---
>  src/domain_conf.c        |   66 ++++++++++++++++++++++++++-------------------
>  src/domain_conf.h        |    4 ---
>  src/libvirt_private.syms |    1 -
>  src/lxc_driver.c         |    5 ---
>  src/qemu_conf.c          |    5 ---
>  src/qemu_driver.c        |    8 -----
>  6 files changed, 38 insertions(+), 51 deletions(-)

ACK. We did originally have this in the domain conf.c file, but it caused
other problems, in particular breaking Xen. I think that with the 
additional per-driver flag you added though this should be ok now.


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