Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen revert the watch.node change, xenbus_watch_path...



details:   https://anonhg.NetBSD.org/src/rev/864830078065
branches:  trunk
changeset: 1008975:864830078065
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Tue Apr 07 13:36:22 2020 +0000

description:
revert the watch.node change, xenbus_watch_path() and xenbus_watch_path2()
need to use non-constant path

diffstat:

 sys/arch/xen/include/xenbus.h      |   4 ++--
 sys/arch/xen/xen/xbdback_xenbus.c  |   5 +++--
 sys/arch/xen/xenbus/xenbus_probe.c |  11 +++++++----
 3 files changed, 12 insertions(+), 8 deletions(-)

diffs (85 lines):

diff -r bc3afaa84efa -r 864830078065 sys/arch/xen/include/xenbus.h
--- a/sys/arch/xen/include/xenbus.h     Tue Apr 07 13:22:05 2020 +0000
+++ b/sys/arch/xen/include/xenbus.h     Tue Apr 07 13:36:22 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus.h,v 1.16 2020/04/07 11:47:05 jdolecek Exp $ */
+/* $NetBSD: xenbus.h,v 1.17 2020/04/07 13:36:22 jdolecek Exp $ */
 /******************************************************************************
  * xenbus.h
  *
@@ -57,7 +57,7 @@
        SLIST_ENTRY(xenbus_watch) watch_next;
 
        /* Path being watched. */
-       const char *node;
+       char *node;
 
        /* Callback (executed in a process context with no locks held). */
        void (*xbw_callback)(struct xenbus_watch *,
diff -r bc3afaa84efa -r 864830078065 sys/arch/xen/xen/xbdback_xenbus.c
--- a/sys/arch/xen/xen/xbdback_xenbus.c Tue Apr 07 13:22:05 2020 +0000
+++ b/sys/arch/xen/xen/xbdback_xenbus.c Tue Apr 07 13:36:22 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbdback_xenbus.c,v 1.75 2020/04/07 11:47:06 jdolecek Exp $      */
+/*      $NetBSD: xbdback_xenbus.c,v 1.76 2020/04/07 13:36:22 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.75 2020/04/07 11:47:06 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.76 2020/04/07 13:36:22 jdolecek Exp $");
 
 #include <sys/atomic.h>
 #include <sys/buf.h>
@@ -489,6 +489,7 @@
        /* unregister watch */
        if (xbdi->xbdi_watch.node) {
                unregister_xenbus_watch(&xbdi->xbdi_watch);
+               free(xbdi->xbdi_watch.node, M_DEVBUF);
                xbdi->xbdi_watch.node = NULL;
        }
        /* unmap ring */
diff -r bc3afaa84efa -r 864830078065 sys/arch/xen/xenbus/xenbus_probe.c
--- a/sys/arch/xen/xenbus/xenbus_probe.c        Tue Apr 07 13:22:05 2020 +0000
+++ b/sys/arch/xen/xenbus/xenbus_probe.c        Tue Apr 07 13:36:22 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_probe.c,v 1.42 2020/04/07 11:47:06 jdolecek Exp $ */
+/* $NetBSD: xenbus_probe.c,v 1.43 2020/04/07 13:36:22 jdolecek Exp $ */
 /******************************************************************************
  * Talks to Xen Store to figure out what devices we have.
  *
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.42 2020/04/07 11:47:06 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.43 2020/04/07 13:36:22 jdolecek Exp $");
 
 #if 0
 #define DPRINTK(fmt, args...) \
@@ -234,6 +234,7 @@
 {
        if (dev->xbusd_otherend_watch.node) {
                unregister_xenbus_watch(&dev->xbusd_otherend_watch);
+               free(dev->xbusd_otherend_watch.node, M_DEVBUF);
                dev->xbusd_otherend_watch.node = NULL;
        }
 }
@@ -614,10 +615,12 @@
        xenbus_probe_backends();
 
        /* Watch for changes. */
-       fe_watch.node = "device";
+       fe_watch.node = malloc(strlen("device") + 1, M_DEVBUF, M_NOWAIT);
+       strcpy(fe_watch.node, "device");
        fe_watch.xbw_callback = frontend_changed;
        register_xenbus_watch(&fe_watch);
-       be_watch.node = "backend";
+       be_watch.node = malloc(strlen("backend") + 1, M_DEVBUF, M_NOWAIT);
+       strcpy(be_watch.node, "backend");
        be_watch.xbw_callback = backend_changed;
        register_xenbus_watch(&be_watch);
 



Home | Main Index | Thread Index | Old Index