xenserver: Hoist identical bridge and vswitch functions into common code.