uh…the state of Virginia had no army. The Constitution allows only for the United States to raise an army. A state militia, in time of war, transfers its command to the President. The idea that a general in a state militia should have loyalty that binds him to that state if it commits treason against the union shows a complete lack of Constitutional knowledge, or understanding of military command structures.
Please, read the Constitution. It will clarify these misconceptions you have. And it’s well worth reading regardless.