§ 3.1-796.116. Dogs killing, injuring or chasing livestock or poultry.
It shall be the duty of any animal control officer or other officer who may find a dog in the act of killing or injuring livestock or poultry to kill such dog forthwith whether such dog bears a tag or not. Any person finding a dog committing any of the depredations mentioned in this section shall have the right to kill such dog on sight as shall any owner of livestock or his agent finding a dog chasing livestock on land utilized by the livestock when the circumstances show that such chasing is harmful to the livestock
*. Any court shall have the power to order the animal control officer or other officer to kill any dog known to be a confirmed livestock or poultry killer, and any dog killing poultry for the third time shall be considered a confirmed poultry killer. The court, through its contempt powers, may compel the owner, custodian, or harborer of the dog to produce the dog.
*Dogs are companion animals and not livestock for this section. So you could protect your horse, chickens, cattle, or rabbits etc. by this law.
§ 3.1-796.122. Cruelty to animals; penalty.
H. Any person who (i) tortures, willfully inflicts inhumane injury or pain not connected with bona fide scientific or medical experimentation or cruelly and unnecessarily beats, maims or mutilates any dog or cat that is a companion animal whether belonging to him or another and (ii) as a direct result causes the death of such dog or cat that is a companion animal, or the euthanasia of such animal on the recommendation of a licensed veterinarian upon determination that such euthanasia was necessary due to the condition of the animal, shall be guilty of a Class 6 felony. If a dog or cat is attacked on its owner's property by a dog so as to cause injury or death, the owner of the injured dog or cat may use all reasonable and necessary force against the dog at the time of the attack to protect his dog or cat. Such owner may be presumed to have taken necessary and appropriate action to defend his dog or cat and shall therefore be presumed not to have violated this subsection.
The provisions of this subsection shall not overrule § 3.1-796.93:1
or § 3.1-796.116
This section of code would allow you to protect your dog or cat on your property.
18.2-280. Willfully discharging firearms in public places.
D. This section shall not apply to any law-enforcement officer in the performance of his official duties nor to any other person whose said willful act is otherwise justifiable or excusable at law in the protection of his life or property, or is otherwise specifically authorized by law.
This section covers you if you are in an area that regulates discharge of firearms.
I wasn't sure before but it seems to me if your dog is being attacked on your property, you can shoot the attacking dog.