From 10d3515aa4fc0d338df28d2760fae264c0cea40a Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Wed, 14 Jul 2010 19:02:10 -0700 Subject: [PATCH] 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. --- datapath/vport.c | 2 +- lib/netdev-gre.c | 2 +- lib/netdev-patch.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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); -- 2.30.2