Theoretically, what technique would one use to modify a virus so that it only affected a subset of the population?
Yes, it is possible and probably you won't need many literary artifices to make it work.

Essentially viruses are what is technically called "obligate intracellular parasites".
Parasites because they cannot grow by themselves, they need a host cell from which they "steal" the intracellular machinery to replicate; intracellular because they grow inside cells; and obligate because they cannot reproduce outside their target cell.

Now, each virus has its "favourite cell" to infect. For instance HIV targets a type of lymphocytes (cells of the immune system), other viruses may only target bacteria (these are called bacteriophages) and so on.

How is this specificity achieved? Well, to put it simply, viruses "anchor" to specific proteins (or other molecules) that are sitting on the membrane of their target cells and that allows them to go in. If a cell does not have that specific protein, then the virus cannot infect it.

So, in your story, maybe the target population will have a mutation in their genome that will modify a certain protein. You could then (fictionally) construct a virus that specifically targets cells expressing that protein and you're set!

The virus construction part is just standard molecular biology, really.

A few things to read:
http://en.wikipedia.org/wiki/Genetic_engineering
http://en.wikipedia.org/wiki/Genetically_modified_virus
http://en.wikipedia.org/wiki/Viruses &lt;--this explains a lot