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

Re: [Xen-devel] [PATCH 06/11] mini-os/xenbus: Rename xenbus_events to xenbus_default_watch_queue



Ian Jackson, le Fri 20 Jun 2014 20:04:45 +0100, a écrit :
> This is only used for watch events, and only if xenbus's caller
> doesn't specify a queue of their own.
> 
> Rename the variable because future patches are going to make the
> current name confusing, because "event" is going to mean not just
> watch events.
> 
> perl -i~ -pe 's/\bxenbus_events\b/xenbus_default_watch_queue/' 
> xen/xenbus/xenbus.c include/mini-os/xenbus.h
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>

Acked-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>

> ---
>  include/mini-os/xenbus.h |    2 +-
>  xen/xenbus/xenbus.c      |   14 +++++++-------
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/include/mini-os/xenbus.h b/include/mini-os/xenbus.h
> index 4dad4c8..abf8765 100644
> --- a/include/mini-os/xenbus.h
> +++ b/include/mini-os/xenbus.h
> @@ -44,7 +44,7 @@ char *xenbus_switch_state(xenbus_transaction_t xbt, const 
> char* path, XenbusStat
>  
>  /* When no token is provided, use a global queue. */
>  #define XENBUS_WATCH_PATH_TOKEN "xenbus_watch_path"
> -extern struct xenbus_event_queue xenbus_events;
> +extern struct xenbus_event_queue xenbus_default_watch_queue;
>  #define xenbus_watch_path(xbt, path) xenbus_watch_path_token(xbt, path, 
> XENBUS_WATCH_PATH_TOKEN, NULL)
>  #define xenbus_unwatch_path(xbt, path) xenbus_unwatch_path_token(xbt, path, 
> XENBUS_WATCH_PATH_TOKEN)
>  
> diff --git a/xen/xenbus/xenbus.c b/xen/xenbus/xenbus.c
> index 66fdc8a..947b5c8 100644
> --- a/xen/xenbus/xenbus.c
> +++ b/xen/xenbus/xenbus.c
> @@ -48,7 +48,7 @@ static DECLARE_WAIT_QUEUE_HEAD(xb_waitq);
>  static spinlock_t xb_lock = SPIN_LOCK_UNLOCKED; /* protects xenbus req ring 
> */
>  DECLARE_WAIT_QUEUE_HEAD(xenbus_watch_queue);
>  
> -struct xenbus_event_queue xenbus_events;
> +struct xenbus_event_queue xenbus_default_watch_queue;
>  struct watch {
>      char *token;
>      struct xenbus_event_queue *events;
> @@ -91,7 +91,7 @@ char **xenbus_wait_for_watch_return(struct 
> xenbus_event_queue *queue)
>      struct xenbus_event *event;
>      DEFINE_WAIT(w);
>      if (!queue)
> -        queue = &xenbus_events;
> +        queue = &xenbus_default_watch_queue;
>      while (!(event = MINIOS_STAILQ_FIRST(&queue->events))) {
>          add_waiter(w, xenbus_watch_queue);
>          schedule();
> @@ -105,7 +105,7 @@ void xenbus_wait_for_watch(struct xenbus_event_queue 
> *queue)
>  {
>      char **ret;
>      if (!queue)
> -        queue = &xenbus_events;
> +        queue = &xenbus_default_watch_queue;
>      ret = xenbus_wait_for_watch_return(queue);
>      if (ret)
>          free(ret);
> @@ -116,7 +116,7 @@ void xenbus_wait_for_watch(struct xenbus_event_queue 
> *queue)
>  char* xenbus_wait_for_value(const char* path, const char* value, struct 
> xenbus_event_queue *queue)
>  {
>      if (!queue)
> -        queue = &xenbus_events;
> +        queue = &xenbus_default_watch_queue;
>      for(;;)
>      {
>          char *res, *msg;
> @@ -179,7 +179,7 @@ exit:
>  char *xenbus_wait_for_state_change(const char* path, XenbusState *state, 
> struct xenbus_event_queue *queue)
>  {
>      if (!queue)
> -        queue = &xenbus_events;
> +        queue = &xenbus_default_watch_queue;
>      for(;;)
>      {
>          char *res, *msg;
> @@ -339,7 +339,7 @@ void init_xenbus(void)
>  {
>      int err;
>      DEBUG("init_xenbus called.\n");
> -    xenbus_event_queue_init(&xenbus_events);
> +    xenbus_event_queue_init(&xenbus_default_watch_queue);
>      xenstore_buf = mfn_to_virt(start_info.store_mfn);
>      create_thread("xenstore", xenbus_thread_func, NULL);
>      DEBUG("buf at %p.\n", xenstore_buf);
> @@ -583,7 +583,7 @@ char* xenbus_watch_path_token( xenbus_transaction_t xbt, 
> const char *path, const
>      char *msg;
>  
>      if (!events)
> -        events = &xenbus_events;
> +        events = &xenbus_default_watch_queue;
>  
>      watch->token = strdup(token);
>      watch->events = events;
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel
> 

-- 
Samuel
 > Quelqu'un aurait-il une solution pour réinitialiser un MBR
 Si tu veux qu'il soit complètement blanc (pas souhaitable, à mon avis) :
 dd if=/dev/zero of=/dev/hda bs=512 count=1 (sous Linux)
 -+- OT in Guide du linuxien (très) pervers - "Pour les K difficiles" -+-

_______________________________________________
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®.