Not more than the maximum number of witnesses provided for herein shall be paid out of the state treasury in criminal cases.
The maximum number that may be (i) caused to be summoned by an attorney for the Commonwealth in any one case to go before a grand jury -- five; (ii) used before a court not of record in the trial of any criminal case -- five; and (iii) caused to be summoned by an attorney for the Commonwealth for the trial of any criminal case -- ten.
Nothing herein shall be construed to limit (i) the number of witnesses that may be authorized by any court or the judge thereof to be used when the necessity for additional witnesses appears to the court or judge and the consent of the court or judge is first obtained or (ii) the number of witnesses that a grand jury may of its own motion summon.
Va. Code § 17.1-617