Did you ask yourself why Russia didn’t veto the resolution 1973 against Libya? For me there are at least two good reasons (from a Russian point of view):
First, with a veto Russia would have attracted the anger of all western media. It would have been a disaster for the image of Russia. But with not blocking this resolution, they turned the situation round. Western media cannot blame them for protecting Gadhaffi, but they can criticize the military intervention. They did know exactly that the intervention will happen, and will go much further than what the resolution 1973 allows. They did also know that western armies will not protect civilians. How could they, by bombarding cities with uranium weapons? And so Russia but himself into a position where it can make harsh critics on western ambitions. Even if the official critics made by Medwedev are moderated, the critics of Putin get a much bigger response in the media.
They follow a double strategy. The marionette president gives an official declaration that does not harm diplomatic relations with western countries, and Putin says what many people want to hear. And they hear it and get a better image about Russia, because he is saying what they want to hear.
There second reason, how Russia profits from this war is, you can guess. What’s Russia’s most important export good? You’re right, it’s oil. And with the war in Libya the oil price goes up, and this means, Russia does earn much more money. To remember, Russia did export in 2010 247,7 million tons of crude oil, means for each 4$ the oil price goes up per ton (not per barrel), they get 1 billion additionally.
So from Russian view, it was by far the best thing Russia could do for it’s own interests. Russia gained power in a relative view.
The first point is also true for China. They can make publicity. An additional point i didn’t mention, it the internal propaganda, that in a lower importance also true for Russia. You can also observe the double position: inside China, western powers are showed as leading an imperial war against a country in the third world. Officially they have almost the same position as Russia.