802.1Qbh: Delay IFF_UP'ing interface until migration final stage

Current code does an IFF_UP on a 8021Qbh interface immediately after a port
profile set. This is ok in most cases except when its the migration prepare
stage. During migration we want to postpone IFF_UP'ing the interface on the
destination host until the source host has disassociated the interface.
This patch moves IFF_UP of the interface to the final stage of migration.
The motivation for this change is to postpone any addr registrations on the
destination host until the source host has done the addr deregistrations.

While at it, for symmetry with associate move ifDown of a 8021Qbh interface
to before disassociate
This commit is contained in:
Roopa Prabhu 2011-02-22 07:48:54 -05:00 committed by Stefan Berger
parent 9f928af12b
commit dfd39ccda8

View File

@ -1470,8 +1470,6 @@ doPortProfileOp8021Qbh(const char *ifname,
NULL,
vf,
PORT_REQUEST_DISASSOCIATE);
if (!rc)
ifaceUp(ifname);
break;
case DISASSOCIATE:
@ -1484,7 +1482,6 @@ doPortProfileOp8021Qbh(const char *ifname,
NULL,
vf,
PORT_REQUEST_DISASSOCIATE);
ifaceDown(ifname);
break;
default:
@ -1550,10 +1547,11 @@ vpAssociatePortProfileId(const char *macvtap_ifname,
case VIR_VIRTUALPORT_8021QBH:
/* avoid associating twice */
if (vmOp == VIR_VM_OP_MIGRATE_IN_FINISH)
break;
rc = doPortProfileOp8021Qbh(linkdev, macvtap_macaddr,
virtPort, vmuuid, ASSOCIATE);
if (vmOp != VIR_VM_OP_MIGRATE_IN_FINISH)
rc = doPortProfileOp8021Qbh(linkdev, macvtap_macaddr,
virtPort, vmuuid, ASSOCIATE);
if (vmOp != VIR_VM_OP_MIGRATE_IN_START && !rc)
ifaceUp(linkdev);
break;
}
@ -1600,6 +1598,7 @@ vpDisassociatePortProfileId(const char *macvtap_ifname,
/* avoid disassociating twice */
if (vmOp == VIR_VM_OP_MIGRATE_IN_FINISH)
break;
ifaceDown(linkdev);
rc = doPortProfileOp8021Qbh(linkdev, macvtap_macaddr,
virtPort, NULL, DISASSOCIATE);
break;