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

Re: [Xen-devel] [v11][PATCH 11/16] tools/libxl: detect and avoid conflicts with RDM



OOPS! Please refer to this version: (One miss changing flag to flags in patch #11 although we can compile successfully.)


#1. To patch #8

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 2991333..9c5ef8b 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1316,7 +1316,7 @@ int xc_get_machine_memory_map(xc_interface *xch,
                               uint32_t max_entries);

 int xc_reserved_device_memory_map(xc_interface *xch,
-                                  uint32_t flag,
+                                  uint32_t flags,
                                   uint16_t seg,
                                   uint8_t bus,
                                   uint8_t devfn,
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 298b3b5..1b074b7 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -686,7 +686,7 @@ int xc_domain_set_memory_map(xc_interface *xch,
 }

 int xc_reserved_device_memory_map(xc_interface *xch,
-                                  uint32_t flag,
+                                  uint32_t flags,
                                   uint16_t seg,
                                   uint8_t bus,
                                   uint8_t devfn,
@@ -695,11 +695,11 @@ int xc_reserved_device_memory_map(xc_interface *xch,
 {
     int rc;
     struct xen_reserved_device_memory_map xrdmmap = {
-        .flag = flag,
-        .seg = seg,
-        .bus = bus,
-        .devfn = devfn,
-        .nr_entries = *max_entries
+        .flags = flags,
+        .nr_entries = *max_entries,
+        .dev.pci.seg = seg,
+        .dev.pci.bus = bus,
+        .dev.pci.devfn = devfn,
     };
     DECLARE_HYPERCALL_BOUNCE(entries,
                              sizeof(struct xen_reserved_device_memory) *

#2. To patch #11
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 29476fc..8d103c3 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -94,7 +94,7 @@ const char *libxl__domain_device_model(libxl__gc *gc,

 static int
 libxl__xc_device_get_rdm(libxl__gc *gc,
-                         uint32_t flag,
+                         uint32_t flags,
                          uint16_t seg,
                          uint8_t bus,
                          uint8_t devfn,
@@ -107,7 +107,7 @@ libxl__xc_device_get_rdm(libxl__gc *gc,
      * We really can't presume how many entries we can get in advance.
      */
     *nr_entries = 0;
-    r = xc_reserved_device_memory_map(CTX->xch, flag, seg, bus, devfn,
+    r = xc_reserved_device_memory_map(CTX->xch, flags, seg, bus, devfn,
                                       NULL, nr_entries);
     assert(r <= 0);
     /* "0" means we have no any rdm entry. */
@@ -119,7 +119,7 @@ libxl__xc_device_get_rdm(libxl__gc *gc,
     }

     GCNEW_ARRAY(*xrdm, *nr_entries);
-    r = xc_reserved_device_memory_map(CTX->xch, flag, seg, bus, devfn,
+    r = xc_reserved_device_memory_map(CTX->xch, flags, seg, bus, devfn,
                                       *xrdm, nr_entries);
     if (r)
         rc = ERROR_FAIL;
@@ -212,7 +212,7 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
         unsigned int nr_entries;

         /* Collect all rdm info if exist. */
-        rc = libxl__xc_device_get_rdm(gc, PCI_DEV_RDM_ALL,
+        rc = libxl__xc_device_get_rdm(gc, XENMEM_RDM_ALL,
                                       0, 0, 0, &nr_entries, &xrdm);
         if (rc)
             goto out;
@@ -240,7 +240,7 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc,
         devfn = PCI_DEVFN(d_config->pcidevs[i].dev,
                           d_config->pcidevs[i].func);
         nr_entries = 0;
-        rc = libxl__xc_device_get_rdm(gc, ~PCI_DEV_RDM_ALL,
+        rc = libxl__xc_device_get_rdm(gc, 0,
seg, bus, devfn, &nr_entries, &xrdm);
         if (rc)
             goto out;

Thanks
Tiejun

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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