Any witness from without the Commonwealth whose attendance is compelled under the provisions of Chapter 16, Article 2 (§ 19.2-272 et seq.) of this title shall be deemed to render a service within the meaning of § 19.2-332 and the compensation and expenses of such witness, whether on behalf of the Commonwealth or the accused, may be paid out of the state treasury in accordance with the provisions of such section. But the compensation and expenses of any witness summoned on behalf of an accused shall not be certified to the state treasury as a compensation under such section except in cases when the court or judge thereof is satisfied that the defendant is without means to pay same and is unable to provide the costs incident thereto.
Va. Code § 19.2-330