aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/linux/vmbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/linux/vmbus.c')
-rw-r--r--src/vlib/linux/vmbus.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/vlib/linux/vmbus.c b/src/vlib/linux/vmbus.c
index 2fc438b4778..d50b539910b 100644
--- a/src/vlib/linux/vmbus.c
+++ b/src/vlib/linux/vmbus.c
@@ -118,8 +118,8 @@ linux_vmbus_main_t linux_vmbus_main;
* "f2c086b2-ff2e-11e8-88de-7bad0a57de05" and convert
* it to u8[16]
*/
-static uword
-unformat_vlib_vmbus_addr (unformat_input_t * input, va_list * args)
+uword
+unformat_vlib_vmbus_addr (unformat_input_t *input, va_list *args)
{
vlib_vmbus_addr_t *addr = va_arg (*args, vlib_vmbus_addr_t *);
uword ret = 0;
@@ -137,8 +137,8 @@ unformat_vlib_vmbus_addr (unformat_input_t * input, va_list * args)
}
/* Convert bus address to standard UUID string */
-static u8 *
-format_vlib_vmbus_addr (u8 * s, va_list * va)
+u8 *
+format_vlib_vmbus_addr (u8 *s, va_list *va)
{
vlib_vmbus_addr_t *addr = va_arg (*va, vlib_vmbus_addr_t *);
char tmp[40];
@@ -297,15 +297,21 @@ vlib_vmbus_bind_to_uio (vlib_vmbus_addr_t * addr)
vec_reset_length (s);
s = format (s, "%s/%s/new_id%c", sysfs_vmbus_drv_path, uio_drv_name, 0);
error = clib_sysfs_write ((char *) s, "%s", netvsc_uuid);
-
+ /* If device already exists, we can bind/unbind/override driver */
if (error)
{
- close (fd);
- goto done;
+ if (error->code == EEXIST)
+ {
+ clib_error_free (error);
+ }
+ else
+ {
+ close (fd);
+ goto done;
+ }
}
uio_new_id_needed = 0;
-
}
error = vlib_vmbus_raise_lower (fd, ifname);