Commit 467cb150 authored by Shashi Guruprasad's avatar Shashi Guruprasad
Browse files

During a simparse, virt_agents and eventlist need to be cleaned up

but not other virt_* tables. Thats coz the above two tables are not
truly virtual since they contain the vnode to which the event should
be sent to. My previous patch has been to use replace instead of
insert. Unfortunately, the tables get messed up with the same agent
having multiple entries where some of the entries were left behind
from the previous swapin.
parent 85a98475
......@@ -145,6 +145,12 @@ else {
fatal("Bad data in argument: $eid.");
my %event_objtypes;
my $query_result = DBQueryFatal("select idx,type from event_objecttypes");
while (my ($idx,$type) = $query_result->fetchrow_array()) {
$event_objtypes{$type} = $idx;
# Do it
if ($fromxml) {
readXML($pid, $eid, $xmlfile);
......@@ -288,7 +294,16 @@ sub readXML($$$) {
DBQueryFatal("delete from $table ".
"where eid='$eid' and pid='$pid' and ".
} elsif ( !$impotent && (($table eq "eventlist") ||
($table eq "virt_agents")) ) {
# Both eventlist and virt_agents need to be cleared
# for NSE event objecttype since entries in this
# table depend on the particular mapping
my $nse_objtype = $event_objtypes{"NSE"};
DBQueryFatal("delete from $table ".
"where pid='$pid' and eid='$eid' and ".
if (!defined($virtual_tables{$table}));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment