>From 0e903207780030521c4dad7f41e5b7b748376d85 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Wed, 7 Oct 2009 10:49:02 +0100 Subject: [PATCH 1/4] Make the default disk be /dev/shm/vhostmd0. Previously we used a subdirectory (/dev/shm/vhostmd/). However the permissions on the subdirectory had to be set by hand by the system administrator, and if the sysadmin didn't set them, then libvirt would fail to start the guest. However by just putting the metrics disk into /dev/shm directly, the permissions can be controlled by vhostmd when it creates the device. Not having the subdirectory is also simpler. --- README | 4 ++-- docs/man/vhostmd.8 | 4 ++-- libmetrics/libmetrics.c | 2 +- vhostmd.xml | 2 +- vhostmd/vhostmd.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README b/README index fbd87c5..13a3449 100644 --- a/README +++ b/README @@ -30,7 +30,7 @@ vhostmd [options] Configuration File ------------------ The default configuration file (example listed below) defines a 256Kbyte -metrics disk in /dev/shm/vhostmd/disk0, updated every 5 seconds. It also +metrics disk in /dev/shm/vhostmd0, updated every 5 seconds. It also includes a few examples of user-defined metrics, which provide a (currently simplistic) mechanism for extending metrics gathered by vhostmd. @@ -38,7 +38,7 @@ includes a few examples of user-defined metrics, which provide a host-metrics-disk - /dev/shm/vhostmd/disk0 + /dev/shm/vhostmd0 256 5 diff --git a/docs/man/vhostmd.8 b/docs/man/vhostmd.8 index 958b24f..af02bc2 100644 --- a/docs/man/vhostmd.8 +++ b/docs/man/vhostmd.8 @@ -32,13 +32,13 @@ if it exists. .B \-f option.) -The default configuration file (listed below) defines a 256Kbyte metrics disk in /dev/shm/vhostmd/disk0, updated every 5 seconds. It also includes a few examples of user-defined metrics, which provide a (currently simplistic) mechanism for extending metrics gathered by vhostmd. +The default configuration file (listed below) defines a 256Kbyte metrics disk in /dev/shm/vhostmd0, updated every 5 seconds. It also includes a few examples of user-defined metrics, which provide a (currently simplistic) mechanism for extending metrics gathered by vhostmd. host-metrics-disk - /dev/shm/vhostmd/disk0 + /dev/shm/vhostmd0 256 5 diff --git a/libmetrics/libmetrics.c b/libmetrics/libmetrics.c index ed1f9b0..3909687 100644 --- a/libmetrics/libmetrics.c +++ b/libmetrics/libmetrics.c @@ -308,7 +308,7 @@ retry: asprintf(&path, "/dev/%s", entry->d_name); #else - path = strdup("/dev/shm/vhostmd/disk0"); + path = strdup("/dev/shm/vhostmd0"); #endif fp = fopen(path, "r"); if (fp == NULL) { diff --git a/vhostmd.xml b/vhostmd.xml index 4928ad8..c97e838 100644 --- a/vhostmd.xml +++ b/vhostmd.xml @@ -24,7 +24,7 @@ within the vm element. host-metrics-disk - /dev/shm/vhostmd/disk0 + /dev/shm/vhostmd0 256 5 diff --git a/vhostmd/vhostmd.c b/vhostmd/vhostmd.c index d66b51f..a5331ad 100644 --- a/vhostmd/vhostmd.c +++ b/vhostmd/vhostmd.c @@ -85,7 +85,7 @@ typedef struct _mdisk_header static int down = 0; static int mdisk_size = MDISK_SIZE_MIN; static int update_period = 5; -static char *def_mdisk_path = "/dev/shm/vhostmd/disk0"; +static char *def_mdisk_path = "/dev/shm/vhostmd0"; static char *mdisk_path = NULL; static char *pid_file = "/var/run/vhostmd.pid"; static metric *metrics = NULL; -- 1.6.2.5