From: Jesse Gross Date: Thu, 15 Jul 2010 02:02:10 +0000 (-0700) Subject: vport: Use EBUSY to represent already attached device. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10d3515aa4fc0d338df28d2760fae264c0cea40a;p=openvswitch vport: Use EBUSY to represent already attached device. 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. --- diff --git a/datapath/vport.c b/datapath/vport.c index ef07a091..5b865e16 100644 --- a/datapath/vport.c +++ b/datapath/vport.c @@ -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; } diff --git a/lib/netdev-gre.c b/lib/netdev-gre.c index 45b574ff..25e0a646 100644 --- a/lib/netdev-gre.c +++ b/lib/netdev-gre.c @@ -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); diff --git a/lib/netdev-patch.c b/lib/netdev-patch.c index ec4d4bd8..1340eb71 100644 --- a/lib/netdev-patch.c +++ b/lib/netdev-patch.c @@ -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);