is this not the purpose of 
if (agent->cfg_listener()->SkipNode(vmi_node, agent->cfg()->cfg_vm_interface_table()))

to be sure that the current node is a VMI node ?