[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libxl: do not assume Dom0 backend while getting nic info



commit 7539772a65b044f326ebf9528bd40e7c6a78c540
Author:     Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Mon Sep 5 11:26:04 2016 +0200
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Mon Sep 5 11:53:16 2016 +0100

    libxl: do not assume Dom0 backend while getting nic info
    
    Fill backend_domid field based on backend path.
    
    Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxl/libxl_nic.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tools/libxl/libxl_nic.c b/tools/libxl/libxl_nic.c
index c34b7ba..d1caa90 100644
--- a/tools/libxl/libxl_nic.c
+++ b/tools/libxl/libxl_nic.c
@@ -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,
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.