How to persuade my advisor to keep working with me even if my grades are poor? I am an international grad student in ECE in USA, in the field of Wireless Communications, and I am on my second semester of my Master's program. 

Last week I learned by advisor was unhappy about the grades I got last semester. More specifically, I took two courses and took B+ and A-. On the first course I thought I had scored A or more but I got a bad score on the final; something I wasn't expecting. On the second one, I had a panic attack during the final and I couldn't think calmly, so I got a score of 60, when having 90+ on midterms. I told this to my advisor, and also said that being away from home also made it harder for me psychologically, the reply was that many people have problems on the first semester, but also that if I don't correct my grades this semester it may mean that I am not suitable for doing research in this field, and that I would need to search for another research group, or leave with a master's and work at industry. 

Note that my grades are over the department minimum for PhD entry. So it's my advisor's idea, not a department requirement.

So what should I do? Of course I will try my best to be improve this semester but I think I need to have a plan B in case my grades don't improve too much. What should I do to persuade my advisor?
scaaahu has given the most pragmatic answer in a comment:


  Study harder or leave. 


If it is very important to your advisor that your grades are better, those seem to me pretty much the options.

That being said, I think most people don't really care so much about grades that they would kick out a perfectly fine grad student for grade's sake alone, even if he is well above the formal requirements. Honestly, I would assume that this is not, or at least not only, about grades.

How is your research going along? Are you progressing at least as well as the majority of the other students in the lab? Is your advisor still enthusiastic about your topic? It is not entirely unlikely that your supervisor is not super-happy with some other part of your work, and just using your suboptimal grades as a simpler, more objectively validatable reason to put pressure on you.