Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


added directory creation to the file interface
[palacios.git] / palacios / include / interfaces / vmm_file.h
1 /*
2  * This file is part of the Palacios Virtual Machine Monitor developed
3  * by the V3VEE Project with funding from the United States National 
4  * Science Foundation and the Department of Energy.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2010, Peter Dinda (pdinda@cs.northwestern.edu> 
11  * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org> 
12  * All rights reserved.
13  *
14  * Author: Peter Dinda <pdinda@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20
21 #ifndef __VMM_FILE_H__
22 #define __VMM_FILE_H__
23
24 #include <palacios/vmm.h>
25
26
27 #ifdef __V3VEE__
28 typedef void * v3_file_t;
29
30 int v3_mkdir(char * path, uint16_t permissions, uint8_t recursive);
31
32
33 v3_file_t v3_file_open(struct v3_vm_info * vm, char * path, uint8_t mode);
34 int v3_file_close(v3_file_t file);
35 uint64_t v3_file_size(v3_file_t file);
36
37 uint64_t v3_file_read(v3_file_t file, uint8_t * buf, uint64_t len, uint64_t off);
38 uint64_t v3_file_write(v3_file_t file, uint8_t * buf, uint64_t len, uint64_t off);
39
40 #endif
41
42 #define FILE_OPEN_MODE_READ     (1 << 0)
43 #define FILE_OPEN_MODE_WRITE    (1 << 1)
44 #define FILE_OPEN_MODE_CREATE        (1 << 2)
45
46 struct v3_file_hooks {
47     int (*mkdir)(const char * path, unsigned short perms, int recursive);
48
49     void * (*open)(const char * path, int mode, void * host_data);
50     int (*close)(void * fd);
51
52     long long (*size)(void * fd);
53
54     // blocking reads and writes
55     long long (*read)(void * fd, void * buffer, long long length, long long offset);
56     long long (*write)(void * fd, void * buffer, long long length, long long offset);
57
58 };
59
60
61 extern void V3_Init_File(struct v3_file_hooks * hooks);
62
63 #endif