Merge "Model update to add external-id to port/interface."
authorSam Hague <shague@redhat.com>
Thu, 2 Apr 2015 00:15:18 +0000 (00:15 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 2 Apr 2015 00:15:18 +0000 (00:15 +0000)
southbound/southbound-api/src/main/yang/ovsdb.yang
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundConstants.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundMapper.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/ovsdb/transact/BridgeCreateCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbBridgeRemovedCommand.java
southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java

index ef15750ed9c01d582e0ec85d03eca88cf70aeb07..22038aa04dab18566b5c7a342155b285c05cede9 100755 (executable)
@@ -288,6 +288,11 @@ module ovsdb {
         base interface-type-base;
     }
 
+    identity interface-type-dpdkvhostuser {
+        description "Interface type for dpdkvhostuser interfaces";
+        base interface-type-base;
+    }
+
     grouping ovsdb-port-interface-attributes {
         leaf port-uuid {
             description "The unique identifier of the OVSDB port";
index 07ae9a043eb94a1c8a02aabd0dcc742170356645..6f16b208adbd813d7a2ab865c104fdc98244f82a 100755 (executable)
@@ -23,6 +23,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.re
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeDpdk;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeDpdkr;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeDpdkvhost;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeDpdkvhostuser;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeProtocolBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeProtocolOpenflow10;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeProtocolOpenflow11;
@@ -78,6 +79,7 @@ public class SouthboundConstants {
             .put("dpdk", InterfaceTypeDpdk.class)
             .put("dpdkr", InterfaceTypeDpdkr.class)
             .put("dpdkvhost", InterfaceTypeDpdkvhost.class)
+            .put("dpdkvhostuser", InterfaceTypeDpdkvhostuser.class)
             .build();
 
     public static final ImmutableBiMap<Class<? extends DatapathTypeBase>,String> DATAPATH_TYPE_MAP
index 2ebbbc3b32e0d073887a95533feda8a40eb087e1..e12bd7116a0290b56576108e44fddefafc463c4e 100644 (file)
@@ -340,7 +340,7 @@ public class SouthboundMapper {
         if (controllerEntries != null && !controllerEntries.isEmpty()) {
             int index = 0;
             for (ControllerEntry controllerEntry : controllerEntries) {
-                String controllerNamedUUID = "Controller_" + omn.getBridgeName().getValue() + index++;
+                String controllerNamedUUID = "Controller_" + getRandomUUID();
                 Controller controller = TyperUtils.getTypedRowWrapper(dbSchema, Controller.class);
                 controller.setTarget(controllerEntry.getTarget().getValue());
                 controllerMap.put(new UUID(controllerNamedUUID), controller);
@@ -348,4 +348,8 @@ public class SouthboundMapper {
         }
         return controllerMap;
     }
+
+    public static String getRandomUUID() {
+        return java.util.UUID.randomUUID().toString().replace("-", "");
+    }
 }
index 37101f0f9dca8d1c99f4140f51fdf30969b34ddc..68f076e881716e0928e9ee15986f297fd578a267 100644 (file)
@@ -56,9 +56,9 @@ public class BridgeCreateCommand implements TransactCommand {
                         ovsdbManagedNode.getBridgeUuid());
 
             // Named UUIDs
-            String bridgeNamedUuid = "Bridge_" + ovsdbManagedNode.getBridgeName().getValue();
-            String interfaceNamedUuid = "Interface_" + ovsdbManagedNode.getBridgeName().getValue();
-            String portNamedUuid = "Port_" + ovsdbManagedNode.getBridgeName().getValue();
+            String bridgeNamedUuid = "Bridge_" + SouthboundMapper.getRandomUUID();
+            String interfaceNamedUuid = "Interface_" + SouthboundMapper.getRandomUUID();
+            String portNamedUuid = "Port_" + SouthboundMapper.getRandomUUID();
 
             // Interface part
             Interface interfaceOvs = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Interface.class);
index 19a368337c4c89bf7b427802f10d8573de98cacf..61c984d88cb5c9ec3a941cbb66d76a5f473efdd0 100644 (file)
@@ -10,7 +10,6 @@ import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
 import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
 import org.opendaylight.ovsdb.southbound.OvsdbClientKey;
 import org.opendaylight.ovsdb.southbound.SouthboundMapper;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagedNodeEntry;
@@ -34,7 +33,7 @@ public class OvsdbBridgeRemovedCommand extends AbstractTransactionCommand {
                 getUpdates(), getDbSchema()).values();
         for (Bridge bridge : removedRows) {
             InstanceIdentifier<Node> bridgeIid = SouthboundMapper.createInstanceIdentifier(getKey(),
-                    new OvsdbBridgeName(bridge.getName()));
+                    bridge);
             InstanceIdentifier<ManagedNodeEntry> mnIid = SouthboundMapper.createInstanceIdentifier(getKey())
                     .augmentation(OvsdbNodeAugmentation.class)
                     .child(ManagedNodeEntry.class, new ManagedNodeEntryKey(new OvsdbBridgeRef(bridgeIid)));
index 1efcf12b40137efda2e66ba71c9723f710976fde..03bd1d6460a8787b2d0471d9036fa51069ff0231 100644 (file)
@@ -105,6 +105,9 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand {
                                 if (itr.next() != null) {
                                     int id = itr.next().intValue();
                                     ovsdbTerminationPointBuilder.setVlanTag(new VlanId(id));
+                                    // TODO: re-visit this iteration when expecting more than 1 vlan tag
+                                    //       per ovsdb termination point.
+                                    break;
                                 }
                             }
                             Column<GenericTableSchema, Set<UUID>> iface = port.getInterfacesColumn();