No problem. Europe - KMG - HKG counts as an international transfer (Hong Kong and Macau both count as international destinations).
Current rules state: "Transit incl. two stops, with a total transit time of 24 hours, within China (People's Rep.) is permitted".
If transiting only through Shanghai, as a French passport holder, you would have 48 hours. Note that if you stop first in KMG and then Shanghai you would b subject to the "24 hour total transfer time in China" rule.