debuggers.hg

view xen/include/asm-x86/mem_sharing.h @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents e7afe98afd43
children
line source
1 /******************************************************************************
2 * include/asm-x86/mem_sharing.h
3 *
4 * Memory sharing support.
5 *
6 * Copyright (c) 2009 Citrix Systems, Inc. (Grzegorz Milos)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22 #ifndef __MEM_SHARING_H__
23 #define __MEM_SHARING_H__
25 #ifdef __x86_64__
27 #define sharing_supported(_d) \
28 (is_hvm_domain(_d) && paging_mode_hap(_d))
30 typedef uint64_t shr_handle_t;
32 unsigned int mem_sharing_get_nr_saved_mfns(void);
33 int mem_sharing_nominate_page(struct p2m_domain *p2m,
34 unsigned long gfn,
35 int expected_refcnt,
36 shr_handle_t *phandle);
37 #define MEM_SHARING_MUST_SUCCEED (1<<0)
38 #define MEM_SHARING_DESTROY_GFN (1<<1)
39 int mem_sharing_unshare_page(struct p2m_domain *p2m,
40 unsigned long gfn,
41 uint16_t flags);
42 int mem_sharing_sharing_resume(struct domain *d);
43 int mem_sharing_cache_resize(struct p2m_domain *p2m, int new_size);
44 int mem_sharing_domctl(struct domain *d,
45 xen_domctl_mem_sharing_op_t *mec);
46 void mem_sharing_init(void);
48 #else
50 #define mem_sharing_init() do { } while (0)
52 #endif /* __x86_64__ */
54 #endif /* __MEM_SHARING_H__ */