Migrant crisis: EU border security becomes new mantra
It is often said that crises in the EU give an impetus for further integration - "more Europe".
There was a new example of that at this week's Brussels summit.
EU leaders agreed on the need for a new "European Border and Coast Guard", with greater powers and resources than the current Frontex border agency.
The European Commission stressed that the new force would not usurp the authority of national border staff - it would work alongside them.
Controversially, however, if a member state fails in its duty to protect the EU's external borders, during an emergency, the Commission could deploy EU guards without needing the state's permission.
And part of the guards' remit would be to send failed asylum seekers back - though currently such "returns" are handled by national forces.
The plan has caused some alarm about sovereignty. Few issues are as touchy for nations as their own borders. Hungary and Poland have voiced concern.
Barriers go up
But this year's record influx of migrants - many of them Syrian war refugees - has demanded crisis measures.
Greece has become the main gateway to Europe, as thousands of desperate migrants come ashore daily on the islands near Turkey.
The massive flow north, through the Balkans, has severely strained European solidarity.
New east-west tensions arose when Hungary, Slovakia and some other countries objected to housing migrants. Muslims would struggle to integrate - and anyway most wanted to live in Germany, it was argued.
But France, Germany, Greece, Italy and Sweden all want EU burden-sharing.
The migrant crisis is testing the idea of "ever closer union" just as UK Prime Minister David Cameron argues against it. For the first time he presented his reform case to the other EU leaders in detail.
A striking phrase at the summit was the need to "take back control" of the EU's external borders - a phrase also used by British Eurosceptics who want to limit immigration from the EU.
Fight against terrorism
Stricter policing of the EU's external borders is considered vital to preserve freedom of movement in the Schengen area, where 26 countries removed border controls.
But tighter surveillance is also part of what the EU leaders call "our uncompromising fight against terrorism".
Shocked by the jihadist atrocities in Paris last month, they pledged to enable much more information-sharing between police and intelligence services in the EU.
There needs to be better use of the Schengen Information System (SIS) and other key databases to keep track of suspects, the leaders agreed.
The EU aims to hammer out the operational details for the new border force by next July.
The deadline is significant. A senior EU official said next summer could see another big surge of migrants, with the likelihood of more boat tragedies.
According to the Centre for European Policy Studies (CEPS) however, the approach to the migrant crisis remains too security-focused.
CEPS urges the EU to provide more legal channels for migration and use development aid to help tackle the root causes, especially poverty.
Nearly one million refugees and other migrants have entered the EU this year, the International Organization for Migration (IOM) says.
And no let-up is expected next year, as the Syrian war and other conflicts grind on.
Turkey under pressure
But few European politicians are bold enough to say they want young skilled migrants to fill jobs as the workforce gets older.
Germany's welcome for Syrians could pay dividends in the future.
A big EU effort is under way now to encourage Turkey to crack down on people traffickers and improve conditions for the 2.2 million Syrian refugees it is hosting, so that they stay in the region.
Many of those refugees are in squalid camps, without any legal right to jobs or welfare. So, seeing no future in Turkey, they set off for the EU.
In a report last month Human Rights Watch said fewer than one-third of the 700,000 Syrian refugee children who had entered Turkey since 2010 were attending school.
The EU is offering Turkey incentives: its bid to join the EU is no longer frozen, Turks may get visa-free travel to Europe next autumn, and Turkey will get €3bn ($3.26bn; £2.1bn) of EU aid for the refugees.
Addressing the conflicts in the Middle East, Afghanistan and other trouble spots has become urgent business for the EU - and a distraction from the unresolved problems of the eurozone.