summaryrefslogtreecommitdiffstats
path: root/qemu/roms/ipxe/contrib/errdb
diff options
context:
space:
mode:
authorRajithaY <rajithax.yerrumsetty@intel.com>2017-04-25 03:31:15 -0700
committerRajitha Yerrumchetty <rajithax.yerrumsetty@intel.com>2017-05-22 06:48:08 +0000
commitbb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch)
treeca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/roms/ipxe/contrib/errdb
parenta14b48d18a9ed03ec191cf16b162206998a895ce (diff)
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to kvmfornfv repo and make use of the updated latest qemu for the execution of all testcase Change-Id: I1280af507a857675c7f81d30c95255635667bdd7 Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/roms/ipxe/contrib/errdb')
-rw-r--r--qemu/roms/ipxe/contrib/errdb/.gitignore1
-rwxr-xr-xqemu/roms/ipxe/contrib/errdb/errdb.pl109
2 files changed, 0 insertions, 110 deletions
diff --git a/qemu/roms/ipxe/contrib/errdb/.gitignore b/qemu/roms/ipxe/contrib/errdb/.gitignore
deleted file mode 100644
index 95bf5c3cd..000000000
--- a/qemu/roms/ipxe/contrib/errdb/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-errors.db
diff --git a/qemu/roms/ipxe/contrib/errdb/errdb.pl b/qemu/roms/ipxe/contrib/errdb/errdb.pl
deleted file mode 100755
index 6423d8347..000000000
--- a/qemu/roms/ipxe/contrib/errdb/errdb.pl
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/usr/bin/perl -w
-
-=head1 NAME
-
-errdb.pl
-
-=head1 SYNOPSIS
-
-errdb.pl [options] ../../src/bin/errors
-
-Options:
-
- -d,--database=db Specify path to errors.db
- -h,--help Display brief help message
- -v,--verbose Increase verbosity
- -q,--quiet Decrease verbosity
-
-=cut
-
-use Getopt::Long;
-use Pod::Usage;
-use DBI;
-use strict;
-use warnings;
-
-# Parse command-line options
-my $verbosity = 0;
-my $errdb = "errors.db";
-Getopt::Long::Configure ( 'bundling', 'auto_abbrev' );
-GetOptions (
- 'database|d=s' => sub { shift; $errdb = shift; },
- 'verbose|v+' => sub { $verbosity++; },
- 'quiet|q+' => sub { $verbosity--; },
- 'help|h' => sub { pod2usage ( 1 ); },
-) or die "Could not parse command-line options\n";
-pod2usage ( 1 ) unless @ARGV >= 1;
-
-# Open database
-my $dbh = DBI->connect ( "dbi:SQLite:dbname=".$errdb, "", "",
- { RaiseError => 1, PrintError => 0 } );
-$dbh->begin_work();
-
-# Create errors table if necessary
-eval {
- $dbh->selectall_arrayref ( "SELECT * FROM errors LIMIT 1" );
-};
-if ( $@ ) {
- print "Creating errors table\n" if $verbosity >= 1;
- $dbh->do ( "CREATE TABLE errors (".
- " errno char(8) NOT NULL,".
- " description text NOT NULL,".
- " PRIMARY KEY ( errno ) )" );
-}
-
-# Create xrefs table if necessary
-eval {
- $dbh->selectall_arrayref ( "SELECT * FROM xrefs LIMIT 1" );
-};
-if ( $@ ) {
- print "Creating xrefs table\n" if $verbosity >= 1;
- $dbh->do ( "CREATE TABLE xrefs (".
- " errno char(8) NOT NULL,".
- " filename text NOT NULL,".
- " line integer NOT NULL,".
- " UNIQUE ( errno, filename, line ),".
- " FOREIGN KEY ( errno ) REFERENCES errors ( errno ) )" );
- $dbh->do ( "CREATE INDEX xrefs_errno ON xrefs ( errno )" );
-}
-
-# Parse input file(s)
-my $errors = {};
-my $xrefs = {};
-while ( <> ) {
- chomp;
- ( my $errno, my $filename, my $line, my $description ) = split ( /\t/ );
- $errno = substr ( $errno, 0, 6 ) unless $errno =~ /^7f/;
- $errors->{$errno} = $description;
- $xrefs->{$errno} ||= {};
- $xrefs->{$errno}->{$filename} ||= {};
- $xrefs->{$errno}->{$filename}->{$line} ||= 1;
-}
-
-# Ensure all errors are present in database
-my $error_update =
- $dbh->prepare ( "UPDATE errors SET description = ? WHERE errno = ?" );
-my $error_insert = $dbh->prepare ( "INSERT INTO errors VALUES ( ?, ? )" );
-while ( ( my $errno, my $description ) = each %$errors ) {
- print "Error ".$errno." is \"".$description."\"\n" if $verbosity >= 2;
- if ( $error_update->execute ( $description, $errno ) == 0 ) {
- $error_insert->execute ( $errno, $description );
- }
-}
-
-# Replace xrefs in database
-$dbh->do ( "DELETE FROM xrefs" );
-my $xref_insert = $dbh->prepare ( "INSERT INTO xrefs VALUES ( ?, ?, ? )" );
-while ( ( my $errno, my $xref_errno ) = each %$xrefs ) {
- while ( ( my $filename, my $xref_filename ) = each %$xref_errno ) {
- foreach my $line ( keys %$xref_filename ) {
- print "Error ".$errno." is used at ".$filename." line ".$line."\n"
- if $verbosity >= 2;
- $xref_insert->execute ( $errno, $filename, $line );
- }
- }
-}
-
-# Close database
-$dbh->commit();
-$dbh->disconnect();