vport: Use EBUSY to represent already attached device.
authorJesse Gross <jesse@nicira.com>
Thu, 15 Jul 2010 02:02:10 +0000 (19:02 -0700)
committerJesse Gross <jesse@nicira.com>
Thu, 15 Jul 2010 22:09:08 +0000 (15:09 -0700)
We currently use EEXIST to represent both a device that is already
attached and for GRE devices that are the same as another one.
Instead use EBUSY for already attached devices to disambiguate the
two situations.

datapath/vport.c
lib/netdev-gre.c
lib/netdev-patch.c

index ef07a09..5b865e1 100644 (file)
@@ -208,7 +208,7 @@ do_vport_add(struct odp_vport_add *vport_config)
 
        vport = vport_locate(vport_config->devname);
        if (vport) {
-               err = -EEXIST;
+               err = -EBUSY;
                goto out;
        }
 
index 45b574f..25e0a64 100644 (file)
@@ -152,7 +152,7 @@ netdev_gre_create(const char *name, const char *type OVS_UNUSED,
     }
 
     err = netdev_vport_do_ioctl(ODP_VPORT_ADD, &ova);
-    if (err == EEXIST) {
+    if (err == EBUSY) {
         VLOG_WARN("%s: destroying existing device", name);
 
         err = netdev_vport_do_ioctl(ODP_VPORT_DEL, ova.devname);
index ec4d4bd..1340eb7 100644 (file)
@@ -103,7 +103,7 @@ netdev_patch_create(const char *name, const char *type OVS_UNUSED,
     ova.config = (char *)peer;
 
     err = netdev_vport_do_ioctl(ODP_VPORT_ADD, &ova);
-    if (err == EEXIST) {
+    if (err == EBUSY) {
         VLOG_WARN("%s: destroying existing device", name);
 
         err = netdev_vport_do_ioctl(ODP_VPORT_DEL, ova.devname);