Answer first; It can only mean A). It could never mean B) regardless of the context, situation, etc.
First of all,
「何{なに}をするのが好{す}きですか?」
is an information question and not a yes-no question because 「何」 is an interrogative. An appropriate response must and will answer the 「何」 part. Are you following me? It may be "tennis" and it may be "hiking". You just cannot answer by yes or no.
B) Do you like what you do?
is 100% a yes-no question, n'est-ce pas?. You are asking the listener whether or not s/he likes what s/he does.
Unlike in English, you will never see an interrogative in a simple relative clause in Japanese. Thus, in a good Japanese translation of "what you do", you will not see 「何」. It is just structurally impossible.
"what you do" = 「あなたのすること」. More naturally, 「(あなたの)していること」. You just cannot use 「何」 in saying this. You sometimes need to "forget" what is correct or normal in English when studying Japanese. Easier said than done, I know (because I had a hard time learning English and I am still terrible at it).
how would I say B)?
You would say it 「(今{いま})されていることがお好きですか。」、「今なさっていることがお好きですか。」, but these sound very translated and unnatural. If you are talking about someone's work, you could say 「今のお仕事{しごと}はお好きですか。」. That is natural.