For the purposes of subdivisions 2, 3 and 4 of subsection A and for the purposes of subsections B1 and B2, prior commitments shall include commitments to any correctional facility under the laws of any state, the District of Columbia, the United States or its territories for murder, rape, robbery, forcible sodomy, animate or inanimate object sexual penetration, aggravated sexual battery, abduction, kidnapping, burglary, felonious assault or wounding, or manufacturing, selling, giving, distributing or possessing with the intent to manufacture, sell, give or distribute a controlled substance, if such would be a felony if committed in the Commonwealth. Only prior commitments interrupted by a person's being at liberty, or resulting from the commission of a felony while in a correctional facility of the Commonwealth, of any other state or of the United States, shall be included in determining the number of times such person has been convicted, sentenced and committed for the purposes of subdivisions 2, 3 and 4 of subsection A. "At liberty" as used herein shall include not only freedom without any legal restraints, but shall also include release pending trial, sentencing or appeal, or release on probation or parole or escape. In the case of terms of imprisonment to be served consecutively, the total time imposed shall constitute the term of the imprisonment; in the case of terms of imprisonment to be served concurrently, the longest term imposed shall be the term of imprisonment. In any case in which a parolee commits an offense while on parole, only the sentence imposed for such offense and not the sentence or sentences or any part thereof from which he was paroled shall constitute the term of imprisonment.
The Department of Corrections shall make all reasonable efforts to determine prior convictions and commitments of each inmate for the enumerated offenses.
Va. Code § 53.1-151