libxl: do not assume Dom0 backend while getting nic info

Fill backend_domid field based on backend path.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Marek Marczykowski-Górecki authored and Wei Liu committed 2016-09-05 11:53:16 +01:00
1 parent b2f2ced591
commit 7539772a65
1 file changed
+12
+12
View File
@@ -309,6 +309,18 @@ static int libxl__device_nic_from_xenstore(libxl__gc *gc,
else
nic->devid = 0;
rc = libxl__xs_read_checked(gc, XBT_NULL,
GCSPRINTF("%s/backend", libxl_path), &tmp);
if (rc) goto out;
if (!tmp) {
LOG(ERROR, "nic %s does not exist (no backend path)", libxl_path);
rc = ERROR_FAIL;
goto out;
}
rc = libxl__backendpath_parse_domid(gc, tmp, &nic->backend_domid);
if (rc) goto out;
/* nic->mtu = */
rc = libxl__xs_read_checked(gc, XBT_NULL,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.