libvirt/src/check-symfile.pl
Daniel P. Berrange 46ec5f85c8 Convert public datatypes to inherit from virObject
This converts the following public API datatypes to use the
virObject infrastructure:

  virConnectPtr
  virDomainPtr
  virDomainSnapshotPtr
  virInterfacePtr
  virNetworkPtr
  virNodeDevicePtr
  virNWFilterPtr
  virSecretPtr
  virStreamPtr
  virStorageVolPtr
  virStoragePoolPtr

The code is significantly simplified, since the mutex in the
virConnectPtr object now only needs to be held when accessing
the per-connection virError object instance. All other operations
are completely lock free.

* src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert
  public datatypes to use virObject
* src/conf/domain_event.c, src/phyp/phyp_driver.c,
  src/qemu/qemu_command.c, src/qemu/qemu_migration.c,
  src/qemu/qemu_process.c, src/storage/storage_driver.c,
  src/vbox/vbox_tmpl.c, src/xen/xend_internal.c,
  tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c,
  tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert
  to use virObjectUnref/virObjectRef

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-08-07 11:47:41 +01:00

55 lines
947 B
Perl
Executable File

#!/usr/bin/perl
die "syntax: $0 SYMFILE ELFLIB(S)" unless int(@ARGV) >= 2;
my $symfile = shift @ARGV;
my @elflibs = @ARGV;
my @wantsyms;
my %gotsyms;
# Skip on non-linux
if ($^O ne "linux") {
return 77; # Automake's skip code
}
open SYMFILE, $symfile or die "cannot read $symfile: $!";
while (<SYMFILE>) {
next if /{/;
next if /}/;
next if /global:/;
next if /local:/;
next if /^\s*$/;
next if /^\s*#/;
next if /\*/;
die "malformed line $_" unless /^\s*(\S+);$/;
push @wantsyms, $1;
}
close SYMFILE;
foreach my $elflib (@elflibs) {
open NM, "-|", "nm", $elflib or die "cannot run 'nm $elflib': $!";
while (<NM>) {
next unless /^\S+\s(?:[TBD])\s(\S+)\s*$/;
$gotsyms{$1} = 1;
}
close NM;
}
my $ret = 0;
foreach my $sym (@wantsyms) {
next if exists $gotsyms{$sym};
print STDERR "Expected symbol $sym is not in ELF library\n";
$ret = 1;
}
exit($ret);