WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [qemu-xen-unstable] disable log-throttling in xen_platfo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [qemu-xen-unstable] disable log-throttling in xen_platform after boot
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Fri, 4 Sep 2009 08:35:35 -0700
Delivery-date: Fri, 04 Sep 2009 08:35:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
commit 11d3914df037145a6452cc0f8f9cff8dcaa3beb2
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Fri Sep 4 16:15:27 2009 +0100

    disable log-throttling in xen_platform after boot
    
    currently log throttling in xen_platform can be disabled only if a
    particular key is present on xenstore at boot time.
    Obviously this requirement makes it difficult to use.
    This patch fixes the issue creating a watch on xenstore on the node
    
    /local/domain/$DOMID/log-throttling
    
    so whenever a developer wants to disable log throttling, he just has to
    write 0 to /local/domain/$DOMID/log-throttling at any moment after boot.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 hw/xen_platform.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/hw/xen_platform.c b/hw/xen_platform.c
index 36610a4..d282f8e 100644
--- a/hw/xen_platform.c
+++ b/hw/xen_platform.c
@@ -50,6 +50,17 @@ typedef struct PCIXenPlatformState
   PCIDevice  pci_dev;
 } PCIXenPlatformState;
 
+static void log_throttling(const char *path, void *opaque)
+{
+    int len;
+    char *throttling = xenstore_dom_read(domid, "log-throttling", &len);
+    if (throttling != NULL) {
+        throttling_disabled = !(throttling[0] - '0');
+        free(throttling);
+        fprintf(logfile, "log_throttling %s\n", throttling_disabled ? 
"disabled" : "enabled");
+    }
+}
+
 /* We throttle access to dom0 syslog, to avoid DOS attacks.  This is
    modelled as a token bucket, with one token for every byte of log.
    The bucket size is 128KB (->1024 lines of 128 bytes each) and
@@ -276,7 +287,6 @@ static int platform_fixed_ioport_load(QEMUFile *f, void 
*opaque, int version_id)
 void platform_fixed_ioport_init(void)
 {
     struct stat stbuf;
-    char *throttling;
     int len = 1;
 
     register_savevm("platform_fixed_ioport", 0, 1, platform_fixed_ioport_save,
@@ -288,12 +298,6 @@ void platform_fixed_ioport_init(void)
     register_ioport_read(0x10, 16, 2, platform_fixed_ioport_read2, NULL);
     register_ioport_read(0x10, 16, 1, platform_fixed_ioport_read1, NULL);
 
-    throttling = xenstore_vm_read(domid, "log-throttling", &len);
-    if (throttling != NULL) {
-        throttling_disabled = (throttling[0] - '0');
-        free(throttling);
-    }
-
     platform_fixed_ioport_write1(NULL, 0x10, 0);
 }
 
@@ -477,6 +481,6 @@ void pci_xen_platform_init(PCIBus *bus)
 
     register_savevm("platform", 0, 3, xen_pci_save, xen_pci_load, d);
     printf("Done register platform.\n");
-
+    xenstore_dom_watch(domid, "log-throttling", log_throttling, NULL);
 }
 
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [qemu-xen-unstable] disable log-throttling in xen_platform after boot, Ian Jackson <=