Obstruction of Justice (aka perverting the course of justice) is a broad term that simply boils down to charging an individual for knowingly lying to law enforcement in order to change to course/outcome of a case, or lying to protect another person. The charge may also be brought against the person who destroys, hides, or alters evidence.
Virginia Obstruction of Justice is a class 1 misdemeanor that carries a penalty of up to one year in jail.
Obstruction of Justice – Code of Virginia
§ 18.2-460. Obstructing justice; penalty.
A. If any person without just cause knowingly obstructs a judge, magistrate, justice, juror, attorney for the Commonwealth, witness, any law-enforcement officer, or animal control officer employed pursuant to § 3.2-6555 in the performance of his duties as such or fails or refuses without just cause to cease such obstruction when requested to do so by such judge, magistrate, justice, juror, attorney for the Commonwealth, witness, law-enforcement officer, or animal control officer employed pursuant to § 3.2-6555, he shall be guilty of a Class 1 misdemeanor.
B. Except as provided in subsection C, any person who, by threats or force, knowingly attempts to intimidate or impede a judge, magistrate, justice, juror, attorney for the Commonwealth, witness, any law-enforcement officer, or an animal control officer employed pursuant to § 3.2-6555 lawfully engaged in his duties as such, or to obstruct or impede the administration of justice in any court, is guilty of a Class 1 misdemeanor.
C. If any person by threats of bodily harm or force knowingly attempts to intimidate or impede a judge, magistrate, justice, juror, attorney for the Commonwealth, witness, any law-enforcement officer, lawfully engaged in the discharge of his duty, or to obstruct or impede the administration of justice in any court relating to a violation of or conspiracy to violate § 18.2-248 or subdivision (a) (3), (b) or (c) of § 18.2-248.1, or § 18.2-46.2 or § 18.2-46.3, or relating to the violation of or conspiracy to violate any violent felony offense listed in subsection C of § 17.1-805, he shall be guilty of a Class 5 felony.
D. Any person who knowingly and willfully makes any materially false statement or representation to a law-enforcement officer or an animal control officer employed pursuant to § 3.2-6555 who is in the course of conducting an investigation of a crime by another is guilty of a Class 1 misdemeanor
Personally, I don't see choosing not to tell even if asked( Yes, saying no there's no guns/firearms present) as a crime as defined by the above criminal code.
The officer isn't investigating a crime when he ask about your firearm as you are legally allowed to possess, and there's that whole self incrimination thingy.
But there's that saying, "you might beat the rap but you won't beat the ride."