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

Re: [Xen-users] [Xen-devel] substantial shutdown delay for PV guests with PCI -passthrough



Sorry for my delay in answering - this is a resend as the first e-Mail with uncompressed attachments did not go through.

Am 19.03.14 16:45, schrieb Ian Jackson:
Atom2 writes ("Re: [Xen-users] substantial shutdown delay for PV guests with PCI 
-passthrough"):
nope, I am using xl; there is no xend or xm installed on the machine or
involved anyhow (I assumed with xend you referred back to xm instead of xl).

Can you try this patch ?

Thanks,
Ian.
Hi Ian,
the patch unfortunately doesn't apply to my sources - some comments to the reasons why further below.

Just FYI: the version I am using is 4.3.1-r5; I have attached the relevant source files referred to by your patches.

Thanks and regards,
Atom2

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 30b0b06..1583498 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2728,7 +2728,7 @@ static void local_device_attach_cb(libxl__egc *egc, 
libxl__ao_device *aodev)
      if (rc < 0)
          goto out;
      be_path = libxl__device_backend_path(gc, &device);
-    rc = libxl__wait_for_backend(gc, be_path, "4");
+    rc = libxl__wait_for_backend_deprecated(gc, be_path, "4", (char*)0);
      if (rc < 0)
          goto out;

This one would apply with an offset of 43 lines - it should therefore be o.k I guess.
diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index fa99f77..11a9885 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -1208,12 +1208,14 @@ int libxl__wait_for_device_model_deprecated(libxl__gc 
*gc,
                                       check_callback, check_callback_userdata);
  }

-int libxl__wait_for_backend(libxl__gc *gc, const char *be_path,
-                            const char *state)
+int libxl__wait_for_backend_deprecated(libxl__gc *gc, const char *be_path,
+                                       ...)
  {
      int watchdog = 100;
      const char *p, *path = GCSPRINTF("%s/state", be_path);
+    const char *want;
      int rc;
+    va_list al;

      while (watchdog-- > 0) {
          rc = libxl__xs_read_checked(gc, XBT_NULL, path, &p);
@@ -1224,8 +1226,14 @@ int libxl__wait_for_backend(libxl__gc *gc, const char 
*be_path,
              return ERROR_FAIL;
          }

-        if (!strcmp(p, state))
-            return 0;
+        va_start(al,be_path);
+        while ((want = va_arg(al, char*))) {
+            if (!strcmp(p, want)) {
+                va_end(al);
+                return 0;
+            }
+        }
+        va_end(al);

          usleep(100000);
      }
This one does not apply, not the least because there is no function libxl__wait_for_device_model_deprecated in the source. Furthermore the definition and the body of libxl__wait_for_backend looks differently to what the patch seems to expect - please see attached source file.
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index b3a200d..bdcce35 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1025,8 +1025,8 @@ _hidden char *libxl__device_frontend_path(libxl__gc *gc, 
libxl__device *device);
  _hidden int libxl__parse_backend_path(libxl__gc *gc, const char *path,
                                        libxl__device *dev);
  _hidden int libxl__device_destroy(libxl__gc *gc, libxl__device *dev);
-_hidden int libxl__wait_for_backend(libxl__gc *gc, const char *be_path,
-                                    const char *state);
+_hidden int libxl__wait_for_backend_deprecated(libxl__gc *gc,
+                   const char *be_path, ...) __attribute__((sentinel));
  _hidden int libxl__nic_type(libxl__gc *gc, libxl__device *dev,
                              libxl_nic_type *nictype);

This one fails because the definition of libxl__wait_for_backend(...) is different (see above) - please see attached source file.
diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 44d0453..43ffd57 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -126,7 +126,7 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc, 
uint32_t domid, libxl_d
          return ERROR_FAIL;

      if (!starting && domtype == LIBXL_DOMAIN_TYPE_PV) {
-        if (libxl__wait_for_backend(gc, be_path, "4") < 0)
+        if (libxl__wait_for_backend_deprecated(gc, be_path, "4", (char*)0) < 0)
              return ERROR_FAIL;
      }

@@ -169,7 +169,8 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, 
uint32_t domid, libx
          return ERROR_FAIL;

      if (domtype == LIBXL_DOMAIN_TYPE_PV) {
-        if (libxl__wait_for_backend(gc, be_path, "4") < 0) {
+        if (libxl__wait_for_backend_deprecated(gc, be_path, "4", "6", (char*)0)
+            < 0) {
              LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "pci backend at %s is not 
ready", be_path);
              return ERROR_FAIL;
          }
@@ -198,7 +199,8 @@ retry_transaction:
              goto retry_transaction;

      if (domtype == LIBXL_DOMAIN_TYPE_PV) {
-        if (libxl__wait_for_backend(gc, be_path, "4") < 0) {
+        if (libxl__wait_for_backend_deprecated(gc, be_path, "4", "6", (char*)0)
+            < 0) {
              LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "pci backend at %s is not 
ready", be_path);
              return ERROR_FAIL;
          }

The last one does apply cleanly - even without any offset.

Attachment: libxl_device.c.7z
Description: Binary data

Attachment: libxl_internal.h.7z
Description: Binary data

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

 


Rackspace

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