Don't call 'vif.plug' twice during VM startup

When starting a VM, the 'get_guest_config' method would end
up calling both the 'plug' and 'get_config' methods on the
VIF driver impl.  The 'plug' method was, however, already
being called by the 'create_domain_and_network' method in
libvirt/driver.py. The result was that when starting a VM,
Nova would be invoking 'plug' twice. Fortunately this does
not currently cause any serious problems, but it could well
do in the future.

Change-Id: I4b044a6d44801a27362e3bf8531962ba85e79466
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add generic UC dropper

There is a lot of tables where we should add unique constraints
on upgrade and drop on downgrade, to avoid race conditions.
But there is a problem with SQLite. SQLite does not allow to drop unique constraints.
There is only one way to drop UC in SQLite:
1) create new table, with same columns and UC (but without UC that we want to drop)
2) copy data from old table
3) drop old table
4) create indexes in new table from old
5) rename new table to old table name

For other DB backends is used 'alter table'.

This patch add generic method for dropping UC.

blueprint db-unique-keys

Change-Id: I3e60578d3902559996943868abeb17b41153769b
Merge "Don't call 'vif.plug' twice during VM startup"
Merge "Add generic UC dropper"