The ChiComs as usual are playing both sides.  President Xi should be counseling Kim Jong Un to cool it and not the United States.  
Bottom line however is that the ChiComs have less influence on Kim Jong Un than people think.  The North Koreans  from a historic perspective do not trust the Chinese.
Their alliance if you can call it that has always been ambivalent and more one of convenience and self interest.
Kim Jong Un and his ruling elite's only interest is the survival of their regime.  They understand that any nation that possesses the bomb is almost immune from being invaded and overthrown which is why they are
so bent on developing their ability to put the bomb on a ballistic missile.
At the end of the day, the US and South Korea may have no option but to overthrow Kim Jong Un. It will be costly but the choice is to do it now or have to do it later.  If President Truman had listened to
General McArthur, we would not be facing this problem.