I did some research on this subject and the executive summary says: "You just had the crappiest of luck, sorry" and "Yes, Cannons get double firepower when attacking cities".
So I created a scenario based on the specifications presented in this thread.
The city is on plains, no river, size 6, has City Walls. It is defended by four musketeer units, two of which are level 1 veterans and the other two level 2 veterans.
Adjacent to the city is an enemy fortress, occupied by for Cannon units, one of them is level 1 veteran, the others are green.
I made five test attacks, always starting with the veteran Cannon. The results can be seen at the bottom of this message.
The combat strengths of each type of unit are:
Musketeers (v2): 20 HP, firepower 1, defense 3 + 2.25 (veterancy) + 2.625 (city 5.25*0.5)) + 5.25 (city walls) = 13.125
Musketeers (v1): 20 HP, firepower 1, defense 3 + 1.5 (veterancy) + 2.25 (city 4.5*0.5) + 4.5 (city walls) = 11.25
Cannon (v1): 20 HP, firepower 1 + 1 (citybuster) = 2, attack 8 + 4 (veterancy) = 12
Cannon (green): 20 HP, firepower 1 + 1 (citybuster) = 2, attack 8
Please note, that the citybuster flag does not double the attack strength but firepower as it says.
As explained in
http://freeciv.wikia.com/wiki/Combat#Combat_Mechanics a veteran Cannon has 12/25.125 (48%) chance to inflict damage to v2 Musketeers on each round of violence.
A green Cannon's odds against v2 Musketeers are 8/21.125 (32%) and against v1 Musketeers 8/19.25 (42%). So the Musketeers may get to do some damage more often but the Cannons do more damage when they get the chance.
The double firepower thingy really kicks in as seen in the test results where a green Cannon attacks a v2 Musketeers with only 32% chance to inflict damage. The Cannon succeeded in 3 out of 5 attempts. That is because the Cannon only needs 10 successful rounds to kill the Musketeers, whereas the Musketeers need 20 to do the opposite.
So the odds are just a little bit on the Cannons' side there I think. Not too much which is a good thing in my opinion. It would be boring if a Cannon was sure to always defeat any Musketeers behind City Walls.
Test results:
T0160:
Cannon(v) attacks, Musketeers(v2) defends, Cannon survives with 9/20 HP, gains v2
Cannon() attacks, Musketeers(v2) defends, Musketeers survive with 6/20 HP, gain v3
Cannon() attacks, Musketeers(v) defends, Musketeers survive with 2/20 HP
Cannon() attacks, Musketeers(v) defends, Musketeers survive with 8/20 HP
T0161:
Cannon(v) attacks, Musketeers(v2) defends, Cannon survives with 9/20 HP
Cannon() attacks, Musketeers(v2) defends, Musketeers survive with 8/20 HP
Cannon() attacks, Musketeers(v) defends, Cannon survives with with 2/20 HP
Cannon() attacks, Musketeers(v) defends, Musketeers survive with 14/20 HP, gain v2
T0162:
Cannon(v) attacks, Musketeers(v2) defends, Cannon survives with 1/20 HP
Cannon() attacks, Musketeers(v2) defends, Cannon survives with 1/20 HP
Cannon() attacks, Musketeers(v) defends, Musketeers survive with with 6/20 HP
Cannon() attacks, Musketeers(v) defends, Musketeers survive with 14/20 HP
T0163:
Cannon(v) attacks, Musketeers(v2) defends, Cannon survives with 6/20 HP, gains v2
Cannon() attacks, Musketeers(v2) defends, Cannon survives with 4/20 HP
Cannon() attacks, Musketeers(v) defends, Cannon survives with with 3/20 HP
Cannon() attacks, Musketeers(v) defends, Musketeers survive with 6/20 HP, gain v2
T0164:
Cannon(v) attacks, Musketeers(v2) defends, Cannon survives with 11/20 HP
Cannon() attacks, Musketeers(v2) defends, Cannon survives with 6/20 HP, gains v
Cannon() attacks, Musketeers(v) defends, Musketeers survive with with 4/20 HP
Cannon() attacks, Musketeers(v) defends, Cannon survives with 8/20 HP