'which' should be used if it's a small number to choose from, otherwise 'what' is fine.
Grammatically it's good.
:)
(if you're worried about that 'don't end a sentence with a preposition' rule, that rule is stupid and wrong - your sentence is evidence of that!)