[libvirt] PATCH: 25/25: Support ac97 sound card

Richard W.M. Jones rjones at redhat.com
Mon Jan 19 12:21:43 UTC 2009


On Fri, Jan 16, 2009 at 04:59:13PM +0100, Daniel Veillard wrote:
> On Tue, Jan 13, 2009 at 05:49:02PM +0000, Daniel P. Berrange wrote:
> > QEMU now has support for a sound card of type "ac97", so enable
> > that in the XML parser / qemu driver.
> 
>   Not related to the threading really, looks fine.
> 
> Any automatic way to detect unused functions ? I guess we can't expect
> the compiler or linker to help in this case since we make them public
> for internal consumption.

CIL can do this easily.

However, over the weekend I was looking at the new -fwhole-program and
-combine options to gcc.  They are intended to do whole-program
optimization, but because of the way they work they can also remove
unused functions from the output:

  $ cat test1.c
  #include <stdio.h>
  void unused (void) { printf ("I'm not used.\n"); }
  $ cat test2.c
  #include <stdio.h>
  #include <stdlib.h>
  int main (int argc, char *argv[]) { printf ("hello, world\n"); exit (0); }

  $ gcc -Wall -c test1.c -o test1.o
  $ gcc -Wall -c test2.c -o test2.o
  $ gcc -Wall test1.o test2.o -o test
  $ nm test | grep unused
  000000000040050c T unused

  $ gcc -Wall -combine -fwhole-program test1.c test2.c -o test
  $ nm test | grep unused

One problem is that the rest of the toolchain (ie. libtool) doesn't
understand them yet :-(

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/




More information about the libvir-list mailing list