libxl: do not assume Dom0 backend while getting nic info

Fill backend_domid field based on backend path.

[ Correspoding xen.git#master commit is 7539772a65 -iwj ]

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>
(cherry picked from commit 317eb71bc3)
This commit is contained in:
Marek Marczykowski-Górecki authored and Ian Jackson committed 2016-09-19 16:34:06 +01:00
1 parent cc977b7ab0
commit 57dbc55cd3
1 file changed
+12
+12
View File
@@ -3485,6 +3485,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 = */
tmp = READ_LIBXLDEV(gc, "mac");
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.