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

[Xen-changelog] [xen-4.2-testing] libxl: propagate user supplied values into event for_user field.


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-4.2-testing <patchbot@xxxxxxx>
  • Date: Fri, 02 Nov 2012 05:11:20 +0000
  • Delivery-date: Fri, 02 Nov 2012 05:11:25 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1351266585 -3600
# Node ID 25eda7e7b4e602d2fff2792460c6be748847c683
# Parent  82b61b99d15d92b6eeb075e30202a0afcd2f817b
libxl: propagate user supplied values into event for_user field.

This was ommited in the majority of cases. Add as a parameter to
libxl__event_new and the NEW_EVENT wrapper to help prevent it being
forgotten in the future.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

xen-unstable changeset: 26089:fb5cf014b387
Backport-requested-by: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 82b61b99d15d -r 25eda7e7b4e6 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Fri Oct 26 16:49:33 2012 +0100
+++ b/tools/libxl/libxl.c       Fri Oct 26 16:49:45 2012 +0100
@@ -972,7 +972,7 @@ static void domain_death_occurred(libxl_
     libxl_evgen_domain_death *evg_next = LIBXL_TAILQ_NEXT(evg, entry);
     *evg_upd = evg_next;
 
-    libxl_event *ev = NEW_EVENT(egc, DOMAIN_DEATH, evg->domid);
+    libxl_event *ev = NEW_EVENT(egc, DOMAIN_DEATH, evg->domid, evg->user);
 
     libxl__event_occurred(egc, ev);
 
@@ -1058,8 +1058,9 @@ static void domain_death_xswatch_callbac
 
             if (!evg->shutdown_reported &&
                 (got->flags & XEN_DOMINF_shutdown)) {
-                libxl_event *ev = NEW_EVENT(egc, DOMAIN_SHUTDOWN, got->domain);
-                
+                libxl_event *ev = NEW_EVENT(egc, DOMAIN_SHUTDOWN,
+                                            got->domain, evg->user);
+
                 LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, " shutdown reporting");
 
                 ev->u.domain_shutdown.shutdown_reason =
@@ -1158,7 +1159,7 @@ static void disk_eject_xswatch_callback(
         return;
     }
 
-    libxl_event *ev = NEW_EVENT(egc, DISK_EJECT, evg->domid);
+    libxl_event *ev = NEW_EVENT(egc, DISK_EJECT, evg->domid, evg->user);
     libxl_device_disk *disk = &ev->u.disk_eject.disk;
     
     backend = libxl__xs_read(gc, XBT_NULL,
diff -r 82b61b99d15d -r 25eda7e7b4e6 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Fri Oct 26 16:49:33 2012 +0100
+++ b/tools/libxl/libxl_create.c        Fri Oct 26 16:49:45 2012 +0100
@@ -705,7 +705,8 @@ static void domcreate_console_available(
                                         libxl__domain_create_state *dcs) {
     libxl__ao_progress_report(egc, dcs->ao, &dcs->aop_console_how,
                               NEW_EVENT(egc, DOMAIN_CREATE_CONSOLE_AVAILABLE,
-                                        dcs->guest_domid));
+                                        dcs->guest_domid,
+                                        dcs->aop_console_how.for_event));
 }
 
 static void domcreate_bootloader_done(libxl__egc *egc,
diff -r 82b61b99d15d -r 25eda7e7b4e6 tools/libxl/libxl_event.c
--- a/tools/libxl/libxl_event.c Fri Oct 26 16:49:33 2012 +0100
+++ b/tools/libxl/libxl_event.c Fri Oct 26 16:49:45 2012 +0100
@@ -1157,7 +1157,8 @@ void libxl_event_free(libxl_ctx *ctx, li
 }
 
 libxl_event *libxl__event_new(libxl__egc *egc,
-                              libxl_event_type type, uint32_t domid)
+                              libxl_event_type type, uint32_t domid,
+                              libxl_ev_user for_user)
 {
     EGC_GC;
     libxl_event *ev;
@@ -1168,6 +1169,7 @@ libxl_event *libxl__event_new(libxl__egc
     libxl_event_init_type(ev, type);
 
     ev->domid = domid;
+    ev->for_user = for_user;
 
     return ev;
 }
@@ -1528,9 +1530,8 @@ void libxl__ao_complete_check_progress_r
         LIBXL_TAILQ_INSERT_TAIL(&egc->aos_for_callback, ao, 
entry_for_callback);
     } else {
         libxl_event *ev;
-        ev = NEW_EVENT(egc, OPERATION_COMPLETE, ao->domid);
+        ev = NEW_EVENT(egc, OPERATION_COMPLETE, ao->domid, 
ao->how.u.for_event);
         if (ev) {
-            ev->for_user = ao->how.u.for_event;
             ev->u.operation_complete.rc = ao->rc;
             libxl__event_occurred(egc, ev);
         }
@@ -1662,7 +1663,6 @@ void libxl__ao_progress_report(libxl__eg
         const libxl_asyncprogress_how *how, libxl_event *ev)
 {
     AO_GC;
-    ev->for_user = how->for_event;
     if (how->callback == dummy_asyncprogress_callback_ignore) {
         LOG(DEBUG,"ao %p: progress report: ignored",ao);
         libxl_event_free(CTX,ev);
diff -r 82b61b99d15d -r 25eda7e7b4e6 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Fri Oct 26 16:49:33 2012 +0100
+++ b/tools/libxl/libxl_internal.h      Fri Oct 26 16:49:45 2012 +0100
@@ -778,13 +778,14 @@ _hidden void libxl__event_occurred(libxl
    * event should be suitable for passing to libxl_event_free. */
 
 _hidden libxl_event *libxl__event_new(libxl__egc*, libxl_event_type,
-                                      uint32_t domid);
+                                      uint32_t domid,
+                                      libxl_ev_user for_user);
   /* Convenience function.
    * Allocates a new libxl_event, fills in domid and type.
    * Cannot fail. */
 
-#define NEW_EVENT(egc, type, domid)                              \
-    libxl__event_new((egc), LIBXL_EVENT_TYPE_##type, (domid))
+#define NEW_EVENT(egc, type, domid, user)                        \
+    libxl__event_new((egc), LIBXL_EVENT_TYPE_##type, (domid), (user))
     /* Convenience macro. */
 
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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