public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] tools/hv: Fix /var subdirectory
@ 2012-11-09 14:01 Tomas Hozza
  2012-11-09 14:01 ` [PATCH 2/3] tools/hv: Fix string types Tomas Hozza
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Tomas Hozza @ 2012-11-09 14:01 UTC (permalink / raw)
  To: olaf, kys, gregkh, linux-kernel, devel, apw, jasowang, ben; +Cc: Tomas Hozza

Initial patch by Ben Hutchings <ben@decadent.org.uk>

We will install this in /usr, so it must use /var/lib for its state.
Only programs installed under /opt should use /var/opt.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
---
 tools/hv/hv_kvp_daemon.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index 54ecb95..d9b3a74 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -98,7 +98,7 @@ static struct utsname uts_buf;
  * The location of the interface configuration file.
  */
 
-#define KVP_CONFIG_LOC	"/var/opt/"
+#define KVP_CONFIG_LOC	"/var/lib/"
 
 #define MAX_FILE_NAME 100
 #define ENTRIES_PER_BLOCK 50
@@ -235,9 +235,9 @@ static int kvp_file_init(void)
 	int i;
 	int alloc_unit = sizeof(struct kvp_record) * ENTRIES_PER_BLOCK;
 
-	if (access("/var/opt/hyperv", F_OK)) {
-		if (mkdir("/var/opt/hyperv", S_IRUSR | S_IWUSR | S_IROTH)) {
-			syslog(LOG_ERR, " Failed to create /var/opt/hyperv");
+	if (access("/var/lib/hyperv", F_OK)) {
+		if (mkdir("/var/lib/hyperv", S_IRUSR | S_IWUSR | S_IROTH)) {
+			syslog(LOG_ERR, " Failed to create /var/lib/hyperv");
 			exit(EXIT_FAILURE);
 		}
 	}
@@ -246,7 +246,7 @@ static int kvp_file_init(void)
 		fname = kvp_file_info[i].fname;
 		records_read = 0;
 		num_blocks = 1;
-		sprintf(fname, "/var/opt/hyperv/.kvp_pool_%d", i);
+		sprintf(fname, "/var/lib/hyperv/.kvp_pool_%d", i);
 		fd = open(fname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IROTH);
 
 		if (fd == -1)
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2013-01-17 18:41 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-09 14:01 [PATCH 1/3] tools/hv: Fix /var subdirectory Tomas Hozza
2012-11-09 14:01 ` [PATCH 2/3] tools/hv: Fix string types Tomas Hozza
2012-11-09 15:56   ` KY Srinivasan
2012-11-09 14:01 ` [PATCH 3/3] tools/hv: Fix permissions of created directory and files Tomas Hozza
2012-11-09 15:52   ` KY Srinivasan
2012-11-09 15:57   ` KY Srinivasan
2012-11-09 15:56 ` [PATCH 1/3] tools/hv: Fix /var subdirectory KY Srinivasan
2012-11-12  8:55   ` Tomas Hozza
2012-11-12  8:55     ` [PATCH 3/3] tools/hv: Fix permissions of created directory and files Tomas Hozza
2012-11-26 20:40       ` KY Srinivasan
2012-11-26 20:42     ` [PATCH 1/3] tools/hv: Fix /var subdirectory KY Srinivasan
2012-11-26 21:12       ` gregkh
2012-11-26 21:15         ` KY Srinivasan
2012-11-27  7:56           ` [PATCH 1/3] tools/hv: Fix for long file names from readdir Tomas Hozza
2012-11-27  7:56             ` [PATCH 2/3] tools/hv: Fix /var subdirectory Tomas Hozza
2012-11-27 13:59               ` KY Srinivasan
2012-11-27  7:56             ` [PATCH 3/3] tools/hv: Fix permissions of created directory and files Tomas Hozza
2012-11-27 13:59               ` KY Srinivasan
2012-11-27 13:58             ` [PATCH 1/3] tools/hv: Fix for long file names from readdir KY Srinivasan
2012-11-27 14:50             ` Ben Hutchings
2012-11-27 20:28               ` Tomas Hozza
2012-11-27 20:41                 ` Ben Hutchings
2012-12-18  8:06                   ` Tomas Hozza
2012-12-18 12:38                     ` Ben Hutchings
2013-01-17 18:41                       ` Greg KH
2012-11-15 23:38   ` [PATCH 1/3] tools/hv: Fix /var subdirectory gregkh
2012-11-15 23:52     ` KY Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox