SHA256
1
0
forked from pool/xen
OBS User unknown 2008-07-18 23:04:37 +00:00 committed by Git OBS Bridge
parent 8ae8ea2a74
commit f5d6338f4d
101 changed files with 2069 additions and 10556 deletions

View File

@ -1,42 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1200407045 0
# Node ID b64be2bc7a91c004982b0ddba0c644744f944141
# Parent e6e165f72e571c12f671c6ad8a70acf8d8090852
xend: Remove hardcoded (and apparently unused) xend version.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
diff -r e6e165f72e57 -r b64be2bc7a91 tools/python/xen/xend/XendNode.py
--- a/tools/python/xen/xend/XendNode.py Tue Jan 15 14:22:50 2008 +0000
+++ b/tools/python/xen/xend/XendNode.py Tue Jan 15 14:24:05 2008 +0000
@@ -377,13 +377,7 @@ class XendNode:
def xen_version(self):
info = self.xc.xeninfo()
- try:
- from xen import VERSION
- info = {'Xen': '%(xen_major)d.%(xen_minor)d' % info,
- 'Xend': VERSION}
- except (ImportError, AttributeError):
- info = {'Xen': '%(xen_major)d.%(xen_minor)d' % info,
- 'Xend': '3.0.3'}
+ info = {'Xen': '%(xen_major)d.%(xen_minor)d' % info}
# Add xend_config_format
info.update(self.xendinfo_dict())
diff -r e6e165f72e57 -r b64be2bc7a91 tools/python/xen/xend/server/SrvDaemon.py
--- a/tools/python/xen/xend/server/SrvDaemon.py Tue Jan 15 14:22:50 2008 +0000
+++ b/tools/python/xen/xend/server/SrvDaemon.py Tue Jan 15 14:24:05 2008 +0000
@@ -335,12 +335,6 @@ class Daemon:
log.info("Xend changeset: %s.", xinfo['xen_changeset'])
del xc
- try:
- from xen import VERSION
- log.info("Xend version: %s", VERSION)
- except ImportError:
- log.info("Xend version: Unknown.")
-
relocate.listenRelocation()
servers = SrvServer.create()
servers.start(status)

View File

@ -1,375 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1200407535 0
# Node ID fba4e7357744e96797916689e3274344b82a8e5f
# Parent 58dfcad8d56d3ebad2e8553c43db499ce727cb36
x86: Allow batched mmu updates which preserve accessed/dirty pte bits.
Signed-off-by: Bruce Rogers <brogers@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Index: xen-3.2.1-testing/xen/arch/x86/mm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm.c
+++ xen-3.2.1-testing/xen/arch/x86/mm.c
@@ -1342,21 +1342,30 @@ static inline int update_intpte(intpte_t
intpte_t old,
intpte_t new,
unsigned long mfn,
- struct vcpu *v)
+ struct vcpu *v,
+ int preserve_ad)
{
int rv = 1;
#ifndef PTE_UPDATE_WITH_CMPXCHG
- rv = paging_write_guest_entry(v, p, new, _mfn(mfn));
-#else
+ if ( !preserve_ad )
+ {
+ rv = paging_write_guest_entry(v, p, new, _mfn(mfn));
+ }
+ else
+#endif
{
intpte_t t = old;
for ( ; ; )
{
- rv = paging_cmpxchg_guest_entry(v, p, &t, new, _mfn(mfn));
+ intpte_t _new = new;
+ if ( preserve_ad )
+ _new |= old & (_PAGE_ACCESSED | _PAGE_DIRTY);
+
+ rv = paging_cmpxchg_guest_entry(v, p, &t, _new, _mfn(mfn));
if ( unlikely(rv == 0) )
{
MEM_LOG("Failed to update %" PRIpte " -> %" PRIpte
- ": saw %" PRIpte, old, new, t);
+ ": saw %" PRIpte, old, _new, t);
break;
}
@@ -1369,20 +1378,19 @@ static inline int update_intpte(intpte_t
old = t;
}
}
-#endif
return rv;
}
/* Macro that wraps the appropriate type-changes around update_intpte().
* Arguments are: type, ptr, old, new, mfn, vcpu */
-#define UPDATE_ENTRY(_t,_p,_o,_n,_m,_v) \
+#define UPDATE_ENTRY(_t,_p,_o,_n,_m,_v,_ad) \
update_intpte(&_t ## e_get_intpte(*(_p)), \
_t ## e_get_intpte(_o), _t ## e_get_intpte(_n), \
- (_m), (_v))
+ (_m), (_v), (_ad))
/* Update the L1 entry at pl1e to new value nl1e. */
static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e,
- unsigned long gl1mfn)
+ unsigned long gl1mfn, int preserve_ad)
{
l1_pgentry_t ol1e;
struct vcpu *curr = current;
@@ -1393,7 +1401,7 @@ static int mod_l1_entry(l1_pgentry_t *pl
return 0;
if ( unlikely(paging_mode_refcounts(d)) )
- return UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr);
+ return UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr, preserve_ad);
if ( l1e_get_flags(nl1e) & _PAGE_PRESENT )
{
@@ -1415,14 +1423,16 @@ static int mod_l1_entry(l1_pgentry_t *pl
if ( !l1e_has_changed(ol1e, nl1e, _PAGE_RW | _PAGE_PRESENT) )
{
adjust_guest_l1e(nl1e, d);
- return UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr);
+ return UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
+ preserve_ad);
}
if ( unlikely(!get_page_from_l1e(nl1e, FOREIGNDOM)) )
return 0;
adjust_guest_l1e(nl1e, d);
- if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr)) )
+ if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
+ preserve_ad)) )
{
put_page_from_l1e(nl1e, d);
return 0;
@@ -1430,7 +1440,8 @@ static int mod_l1_entry(l1_pgentry_t *pl
}
else
{
- if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr)) )
+ if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
+ preserve_ad)) )
return 0;
}
@@ -1443,7 +1454,8 @@ static int mod_l1_entry(l1_pgentry_t *pl
static int mod_l2_entry(l2_pgentry_t *pl2e,
l2_pgentry_t nl2e,
unsigned long pfn,
- unsigned long type)
+ unsigned long type,
+ int preserve_ad)
{
l2_pgentry_t ol2e;
struct vcpu *curr = current;
@@ -1471,20 +1483,22 @@ static int mod_l2_entry(l2_pgentry_t *pl
if ( !l2e_has_changed(ol2e, nl2e, _PAGE_PRESENT) )
{
adjust_guest_l2e(nl2e, d);
- return UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr);
+ return UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr, preserve_ad);
}
if ( unlikely(!get_page_from_l2e(nl2e, pfn, d)) )
return 0;
adjust_guest_l2e(nl2e, d);
- if ( unlikely(!UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr)) )
+ if ( unlikely(!UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr,
+ preserve_ad)) )
{
put_page_from_l2e(nl2e, pfn);
return 0;
}
}
- else if ( unlikely(!UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr)) )
+ else if ( unlikely(!UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr,
+ preserve_ad)) )
{
return 0;
}
@@ -1498,7 +1512,8 @@ static int mod_l2_entry(l2_pgentry_t *pl
/* Update the L3 entry at pl3e to new value nl3e. pl3e is within frame pfn. */
static int mod_l3_entry(l3_pgentry_t *pl3e,
l3_pgentry_t nl3e,
- unsigned long pfn)
+ unsigned long pfn,
+ int preserve_ad)
{
l3_pgentry_t ol3e;
struct vcpu *curr = current;
@@ -1536,20 +1551,22 @@ static int mod_l3_entry(l3_pgentry_t *pl
if ( !l3e_has_changed(ol3e, nl3e, _PAGE_PRESENT) )
{
adjust_guest_l3e(nl3e, d);
- return UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr);
+ return UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr, preserve_ad);
}
if ( unlikely(!get_page_from_l3e(nl3e, pfn, d)) )
return 0;
adjust_guest_l3e(nl3e, d);
- if ( unlikely(!UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr)) )
+ if ( unlikely(!UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr,
+ preserve_ad)) )
{
put_page_from_l3e(nl3e, pfn);
return 0;
}
}
- else if ( unlikely(!UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr)) )
+ else if ( unlikely(!UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr,
+ preserve_ad)) )
{
return 0;
}
@@ -1570,7 +1587,8 @@ static int mod_l3_entry(l3_pgentry_t *pl
/* Update the L4 entry at pl4e to new value nl4e. pl4e is within frame pfn. */
static int mod_l4_entry(l4_pgentry_t *pl4e,
l4_pgentry_t nl4e,
- unsigned long pfn)
+ unsigned long pfn,
+ int preserve_ad)
{
struct vcpu *curr = current;
struct domain *d = curr->domain;
@@ -1598,20 +1616,22 @@ static int mod_l4_entry(l4_pgentry_t *pl
if ( !l4e_has_changed(ol4e, nl4e, _PAGE_PRESENT) )
{
adjust_guest_l4e(nl4e, d);
- return UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr);
+ return UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr, preserve_ad);
}
if ( unlikely(!get_page_from_l4e(nl4e, pfn, d)) )
return 0;
adjust_guest_l4e(nl4e, d);
- if ( unlikely(!UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr)) )
+ if ( unlikely(!UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr,
+ preserve_ad)) )
{
put_page_from_l4e(nl4e, pfn);
return 0;
}
}
- else if ( unlikely(!UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr)) )
+ else if ( unlikely(!UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr,
+ preserve_ad)) )
{
return 0;
}
@@ -1954,7 +1974,7 @@ int new_guest_cr3(unsigned long mfn)
l4e_from_pfn(
mfn,
(_PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_ACCESSED)),
- pagetable_get_pfn(v->arch.guest_table));
+ pagetable_get_pfn(v->arch.guest_table), 0);
if ( unlikely(!okay) )
{
MEM_LOG("Error while installing new compat baseptr %lx", mfn);
@@ -2466,13 +2486,16 @@ int do_mmu_update(
{
/*
* MMU_NORMAL_PT_UPDATE: Normal update to any level of page table.
+ * MMU_UPDATE_PT_PRESERVE_AD: As above but also preserve (OR)
+ * current A/D bits.
*/
case MMU_NORMAL_PT_UPDATE:
-
+ case MMU_PT_UPDATE_PRESERVE_AD:
rc = xsm_mmu_normal_update(d, req.val);
if ( rc )
break;
+ req.ptr -= cmd;
gmfn = req.ptr >> PAGE_SHIFT;
mfn = gmfn_to_mfn(d, gmfn);
@@ -2509,20 +2532,23 @@ int do_mmu_update(
case PGT_l1_page_table:
{
l1_pgentry_t l1e = l1e_from_intpte(req.val);
- okay = mod_l1_entry(va, l1e, mfn);
+ okay = mod_l1_entry(va, l1e, mfn,
+ cmd == MMU_PT_UPDATE_PRESERVE_AD);
}
break;
case PGT_l2_page_table:
{
l2_pgentry_t l2e = l2e_from_intpte(req.val);
- okay = mod_l2_entry(va, l2e, mfn, type_info);
+ okay = mod_l2_entry(va, l2e, mfn, type_info,
+ cmd == MMU_PT_UPDATE_PRESERVE_AD);
}
break;
#if CONFIG_PAGING_LEVELS >= 3
case PGT_l3_page_table:
{
l3_pgentry_t l3e = l3e_from_intpte(req.val);
- okay = mod_l3_entry(va, l3e, mfn);
+ okay = mod_l3_entry(va, l3e, mfn,
+ cmd == MMU_PT_UPDATE_PRESERVE_AD);
}
break;
#endif
@@ -2530,7 +2556,8 @@ int do_mmu_update(
case PGT_l4_page_table:
{
l4_pgentry_t l4e = l4e_from_intpte(req.val);
- okay = mod_l4_entry(va, l4e, mfn);
+ okay = mod_l4_entry(va, l4e, mfn,
+ cmd == MMU_PT_UPDATE_PRESERVE_AD);
}
break;
#endif
@@ -2660,7 +2687,7 @@ static int create_grant_pte_mapping(
}
ol1e = *(l1_pgentry_t *)va;
- if ( !UPDATE_ENTRY(l1, (l1_pgentry_t *)va, ol1e, nl1e, mfn, v) )
+ if ( !UPDATE_ENTRY(l1, (l1_pgentry_t *)va, ol1e, nl1e, mfn, v, 0) )
{
put_page_type(page);
rc = GNTST_general_error;
@@ -2728,9 +2755,11 @@ static int destroy_grant_pte_mapping(
}
/* Delete pagetable entry. */
- if ( unlikely(!UPDATE_ENTRY(l1,
- (l1_pgentry_t *)va, ol1e, l1e_empty(), mfn,
- d->vcpu[0] /* Change if we go to per-vcpu shadows. */)) )
+ if ( unlikely(!UPDATE_ENTRY
+ (l1,
+ (l1_pgentry_t *)va, ol1e, l1e_empty(), mfn,
+ d->vcpu[0] /* Change if we go to per-vcpu shadows. */,
+ 0)) )
{
MEM_LOG("Cannot delete PTE entry at %p", va);
put_page_type(page);
@@ -2766,7 +2795,7 @@ static int create_grant_va_mapping(
return GNTST_general_error;
}
ol1e = *pl1e;
- okay = UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, v);
+ okay = UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, v, 0);
guest_unmap_l1e(v, pl1e);
pl1e = NULL;
@@ -2804,7 +2833,7 @@ static int replace_grant_va_mapping(
}
/* Delete pagetable entry. */
- if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, v)) )
+ if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, v, 0)) )
{
MEM_LOG("Cannot delete PTE entry at %p", (unsigned long *)pl1e);
rc = GNTST_general_error;
@@ -2868,7 +2897,8 @@ int replace_grant_host_mapping(
}
ol1e = *pl1e;
- if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, l1e_empty(), gl1mfn, curr)) )
+ if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, l1e_empty(),
+ gl1mfn, curr, 0)) )
{
MEM_LOG("Cannot delete PTE entry at %p", (unsigned long *)pl1e);
guest_unmap_l1e(curr, pl1e);
@@ -2956,7 +2986,7 @@ int do_update_va_mapping(unsigned long v
pl1e = guest_map_l1e(v, va, &gl1mfn);
- if ( unlikely(!pl1e || !mod_l1_entry(pl1e, val, gl1mfn)) )
+ if ( unlikely(!pl1e || !mod_l1_entry(pl1e, val, gl1mfn, 0)) )
rc = -EINVAL;
if ( pl1e )
@@ -3525,7 +3555,7 @@ static int ptwr_emulated_update(
else
{
ol1e = *pl1e;
- if ( !UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, mfn, v) )
+ if ( !UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, mfn, v, 0) )
BUG();
}
Index: xen-3.2.1-testing/xen/include/public/xen.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/public/xen.h
+++ xen-3.2.1-testing/xen/include/public/xen.h
@@ -168,9 +168,14 @@
* ptr[:2] -- Machine address within the frame whose mapping to modify.
* The frame must belong to the FD, if one is specified.
* val -- Value to write into the mapping entry.
- */
-#define MMU_NORMAL_PT_UPDATE 0 /* checked '*ptr = val'. ptr is MA. */
-#define MMU_MACHPHYS_UPDATE 1 /* ptr = MA of frame to modify entry for */
+ *
+ * ptr[1:0] == MMU_PT_UPDATE_PRESERVE_AD:
+ * As MMU_NORMAL_PT_UPDATE above, but A/D bits currently in the PTE are ORed
+ * with those in @val.
+ */
+#define MMU_NORMAL_PT_UPDATE 0 /* checked '*ptr = val'. ptr is MA. */
+#define MMU_MACHPHYS_UPDATE 1 /* ptr = MA of frame to modify entry for */
+#define MMU_PT_UPDATE_PRESERVE_AD 2 /* atomically: *ptr = val | (*ptr&(A|D)) */
/*
* MMU EXTENDED OPERATIONS

View File

@ -1,48 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1200582857 0
# Node ID 68673ad57302abd57702652877457e84e2284416
# Parent 33dcf04d77152fe7086ceb1e89218e1e703d862d
network scripts: SUSE has sensible use of ifup nowadays
While wading through the patches made to Xen by OpenSUSE in their
[s]rpm, I found that they have removed various special casing for ifup
on ther distribution.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Index: xen-3.2-testing/tools/examples/xen-network-common.sh
===================================================================
--- xen-3.2-testing.orig/tools/examples/xen-network-common.sh
+++ xen-3.2-testing/tools/examples/xen-network-common.sh
@@ -16,11 +16,6 @@
#
-# On SuSE it is necessary to run a command before transfering addresses and
-# routes from the physical interface to the virtual. This command creates a
-# variable $HWD_CONFIG_0 that specifies the appropriate configuration for
-# ifup.
-
# Gentoo doesn't have ifup/ifdown, so we define appropriate alternatives.
# Other platforms just use ifup / ifdown directly.
@@ -32,17 +27,7 @@
# that the virtual device will take once the physical device has
# been renamed.
-if [ -e /etc/SuSE-release ]
-then
- preiftransfer()
- {
- eval `/sbin/getcfg -d /etc/sysconfig/network/ -f ifcfg- -- $1`
- }
- ifup()
- {
- /sbin/ifup ${HWD_CONFIG_0} $1
- }
-elif ! which ifup >/dev/null 2>/dev/null
+if ! which ifup >/dev/null 2>/dev/null
then
preiftransfer()
{

File diff suppressed because it is too large Load Diff

View File

@ -1,129 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1201185473 0
# Node ID 86c32269ba604f968c7abe5cf7360d7c00902ff8
# Parent 1190d50ce18c5a8237fc592d59cff8396bc435c5
network-nat: Fix NAT scripts.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Index: xen-3.2.1-testing/tools/examples/network-nat
===================================================================
--- xen-3.2.1-testing.orig/tools/examples/network-nat
+++ xen-3.2.1-testing/tools/examples/network-nat
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
#============================================================================
# Default Xen network start/stop script when using NAT.
# Xend calls a network script when it starts.
@@ -27,7 +27,15 @@ evalVariables "$@"
netdev=${netdev:-eth0}
# antispoofing not yet implemented
antispoof=${antispoof:-no}
-dhcp=${dhcp:-no}
+
+# turn on dhcp feature by default if dhcpd is installed
+if [ -f /etc/dhcpd.conf ]
+then
+ dhcp=${dhcp:-yes}
+else
+ dhcp=${dhcp:-no}
+fi
+
if [ "$dhcp" != 'no' ]
then
Index: xen-3.2.1-testing/tools/examples/vif-nat
===================================================================
--- xen-3.2.1-testing.orig/tools/examples/vif-nat
+++ xen-3.2.1-testing/tools/examples/vif-nat
@@ -28,15 +28,22 @@
dir=$(dirname "$0")
. "$dir/vif-common.sh"
-dhcp=${dhcp:-no}
+# turn on dhcp feature by default if dhcpd is installed
+if [ -f /etc/dhcpd.conf ]
+then
+ dhcp=${dhcp:-yes}
+else
+ dhcp=${dhcp:-no}
+fi
if [ "$dhcp" != 'no' ]
then
dhcpd_conf_file=$(find_dhcpd_conf_file)
dhcpd_init_file=$(find_dhcpd_init_file)
- if [ -z "$dhcpd_conf_file" ] || [ -z "$dhcpd_init_file" ]
+ dhcpd_arg_file=$(find_dhcpd_arg_file)
+ if [ -z "$dhcpd_conf_file" ] || [ -z "$dhcpd_init_file" ] || [ -z "$dhcpd_arg_file" ]
then
- echo 'Failed to find dhcpd configuration or init file.' >&2
+ echo 'Failed to find dhcpd configuration or init or args file.' >&2
exit 1
fi
fi
@@ -88,6 +95,31 @@ then
hostname="$hostname-$vifid"
fi
+dhcparg_remove_entry()
+{
+ local tmpfile=$(mktemp)
+ sed -e "s/$vif //" "$dhcpd_arg_file" >"$tmpfile"
+ if diff "$tmpfile" "$dhcpd_arg_file" >/dev/null
+ then
+ rm "$tmpfile"
+ else
+ mv "$tmpfile" "$dhcpd_arg_file"
+ fi
+}
+
+dhcparg_add_entry()
+{
+ dhcparg_remove_entry
+ local tmpfile=$(mktemp)
+ # handle Red Hat, SUSE, and Debian styles, with or without quotes
+ sed -e 's/^DHCPDARGS="*\([^"]*\)"*/DHCPDARGS="\1'"$vif "'"/' \
+ "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
+ sed -e 's/^DHCPD_INTERFACE="*\([^"]*\)"*/DHCPD_INTERFACE="\1'"$vif "'"/' \
+ "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
+ sed -e 's/^INTERFACES="*\([^"]*\)"*/INTERFACES="\1'"$vif "'"/' \
+ "$dhcpd_arg_file" >"$tmpfile" && mv "$tmpfile" "$dhcpd_arg_file"
+ rm -f "$tmpfile"
+}
dhcp_remove_entry()
{
@@ -99,6 +131,7 @@ dhcp_remove_entry()
else
mv "$tmpfile" "$dhcpd_conf_file"
fi
+ dhcparg_remove_entry
}
@@ -109,6 +142,7 @@ dhcp_up()
mac=$(xenstore_read "$XENBUS_PATH/mac")
echo >>"$dhcpd_conf_file" \
"host $hostname { hardware ethernet $mac; fixed-address $vif_ip; option routers $router_ip; option host-name \"$hostname\"; }"
+ dhcparg_add_entry
release_lock "vif-nat-dhcp"
"$dhcpd_init_file" restart || true
}
Index: xen-3.2.1-testing/tools/examples/xen-network-common.sh
===================================================================
--- xen-3.2.1-testing.orig/tools/examples/xen-network-common.sh
+++ xen-3.2.1-testing/tools/examples/xen-network-common.sh
@@ -74,6 +74,11 @@ find_dhcpd_init_file()
first_file -x /etc/init.d/{dhcp3-server,dhcp,dhcpd}
}
+find_dhcpd_arg_file()
+{
+ first_file -f /etc/sysconfig/dhcpd /etc/defaults/dhcp
+}
+
# configure interfaces which act as pure bridge ports:
setup_bridge_port() {
local dev="$1"

View File

@ -1,32 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1201185686 0
# Node ID 31adb5c972d03e45cb746cd2305126ea2571282f
# Parent 6269a3ce7b830f6903a61e1116331590b47f7e99
block scripts: use fatal() in xen-hotplug-common.sh if the file does not exist.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
diff -r 6269a3ce7b83 -r 31adb5c972d0 tools/examples/blktap
--- a/tools/examples/blktap Thu Jan 24 14:40:35 2008 +0000
+++ b/tools/examples/blktap Thu Jan 24 14:41:26 2008 +0000
@@ -71,9 +71,9 @@ fi
fi
# some versions of readlink cannot be passed a regular file
if [ -L "$p" ]; then
- file=$(readlink -f "$p") || ebusy "$p link does not exist."
+ file=$(readlink -f "$p") || fatal "$p link does not exist."
else
- [ -f "$p" ] || { ebusy "$p file does not exist."; }
+ [ -f "$p" ] || { fatal "$p file does not exist."; }
file="$p"
fi
@@ -85,7 +85,7 @@ fi
if [ "$command" = 'add' ]
then
- [ -e "$file" ] || { ebusy $file does not exist; }
+ [ -e "$file" ] || { fatal $file does not exist; }
success
fi

View File

@ -1,209 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1201267705 0
# Node ID 666573856c5928371435b72d907dd7f06965965f
# Parent b321ef006189e10d3b733747f508b1fb608810e9
(Re)introduce notion of crashed VM power state.
The crashed power state is necessary to allow both core-dumping a
crashed but preserved VM and renaming/restarting a crashed VM.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Index: xen-3.2.1-testing/docs/xen-api/vm-lifecycle.tex
===================================================================
--- xen-3.2.1-testing.orig/docs/xen-api/vm-lifecycle.tex
+++ xen-3.2.1-testing/docs/xen-api/vm-lifecycle.tex
@@ -21,7 +21,10 @@
\end{figure}
Figure~\ref{fig-vm-lifecycle} shows the states that a VM can be in
-and the API calls that can be used to move the VM between these states.
+and the API calls that can be used to move the VM between these states. The crashed
+state indicates that the guest OS running within the VM has crashed. There is no
+API to explicitly move to the crashed state, however a hardShutdown will move the
+VM to the powered down state.
\section{VM boot parameters}
Index: xen-3.2.1-testing/docs/xen-api/vm_lifecycle.dot
===================================================================
--- xen-3.2.1-testing.orig/docs/xen-api/vm_lifecycle.dot
+++ xen-3.2.1-testing/docs/xen-api/vm_lifecycle.dot
@@ -1,6 +1,6 @@
digraph g{
-node [shape=box]; "powered down" paused running suspended;
+node [shape=box]; "powered down" paused running suspended crashed;
"powered down" -> paused [label="start(paused=true)"];
"powered down" -> running [label="start(paused=false)"];
@@ -11,5 +11,7 @@ paused -> suspended [label="suspend"];
paused -> running [label="resume"];
running -> "powered down" [label="cleanShutdown /\nhardShutdown"];
running -> paused [label="pause"];
+running -> crashed [label="guest OS crash"]
+crashed -> "powered down" [label="hardShutdown"]
}
\ No newline at end of file
Index: xen-3.2.1-testing/docs/xen-api/xenapi-datamodel.tex
===================================================================
--- xen-3.2.1-testing.orig/docs/xen-api/xenapi-datamodel.tex
+++ xen-3.2.1-testing/docs/xen-api/xenapi-datamodel.tex
@@ -156,6 +156,7 @@ The following enumeration types are used
\hspace{0.5cm}{\tt Paused} & Paused \\
\hspace{0.5cm}{\tt Running} & Running \\
\hspace{0.5cm}{\tt Suspended} & Suspended \\
+\hspace{0.5cm}{\tt Crashed} & Crashed \\
\hspace{0.5cm}{\tt Unknown} & Some other unknown state \\
\hline
\end{longtable}
Index: xen-3.2.1-testing/tools/libxen/include/xen/api/xen_vm_power_state.h
===================================================================
--- xen-3.2.1-testing.orig/tools/libxen/include/xen/api/xen_vm_power_state.h
+++ xen-3.2.1-testing/tools/libxen/include/xen/api/xen_vm_power_state.h
@@ -46,6 +46,11 @@ enum xen_vm_power_state
XEN_VM_POWER_STATE_SUSPENDED,
/**
+ * Crashed
+ */
+ XEN_VM_POWER_STATE_CRASHED,
+
+ /**
* Some other unknown state
*/
XEN_VM_POWER_STATE_UNKNOWN
Index: xen-3.2.1-testing/tools/libxen/src/xen_vm_power_state.c
===================================================================
--- xen-3.2.1-testing.orig/tools/libxen/src/xen_vm_power_state.c
+++ xen-3.2.1-testing/tools/libxen/src/xen_vm_power_state.c
@@ -32,6 +32,7 @@ static const char *lookup_table[] =
"Paused",
"Running",
"Suspended",
+ "Crashed",
"Unknown"
};
Index: xen-3.2.1-testing/tools/python/xen/xend/XendAPIConstants.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendAPIConstants.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendAPIConstants.py
@@ -25,6 +25,7 @@ XEN_API_VM_POWER_STATE = [
'Running',
'Suspended',
'Halted',
+ 'Crashed',
'Unknown'
]
@@ -33,7 +34,8 @@ XEN_API_VM_POWER_STATE_PAUSED = 1
XEN_API_VM_POWER_STATE_RUNNING = 2
XEN_API_VM_POWER_STATE_SUSPENDED = 3
XEN_API_VM_POWER_STATE_SHUTTINGDOWN = 4
-XEN_API_VM_POWER_STATE_UNKNOWN = 5
+XEN_API_VM_POWER_STATE_CRASHED = 5
+XEN_API_VM_POWER_STATE_UNKNOWN = 6
XEN_API_ON_NORMAL_EXIT = [
'destroy',
Index: xen-3.2.1-testing/tools/python/xen/xend/XendConstants.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendConstants.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendConstants.py
@@ -61,6 +61,7 @@ DOM_STATES = [
'running',
'suspended',
'shutdown',
+ 'crashed',
'unknown',
]
@@ -69,6 +70,7 @@ DOM_STATE_PAUSED = XEN_API_VM_POWER_STAT
DOM_STATE_RUNNING = XEN_API_VM_POWER_STATE_RUNNING
DOM_STATE_SUSPENDED = XEN_API_VM_POWER_STATE_SUSPENDED
DOM_STATE_SHUTDOWN = XEN_API_VM_POWER_STATE_SHUTTINGDOWN
+DOM_STATE_CRASHED = XEN_API_VM_POWER_STATE_CRASHED
DOM_STATE_UNKNOWN = XEN_API_VM_POWER_STATE_UNKNOWN
DOM_STATES_OLD = [
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomain.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomain.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomain.py
@@ -43,6 +43,7 @@ from xen.xend.XendConstants import XS_VM
from xen.xend.XendConstants import DOM_STATE_HALTED, DOM_STATE_PAUSED
from xen.xend.XendConstants import DOM_STATE_RUNNING, DOM_STATE_SUSPENDED
from xen.xend.XendConstants import DOM_STATE_SHUTDOWN, DOM_STATE_UNKNOWN
+from xen.xend.XendConstants import DOM_STATE_CRASHED
from xen.xend.XendConstants import TRIGGER_TYPE
from xen.xend.XendDevices import XendDevices
from xen.xend.XendAPIConstants import *
@@ -69,6 +70,7 @@ POWER_STATE_NAMES = dict([(x, XEN_API_VM
DOM_STATE_RUNNING,
DOM_STATE_SUSPENDED,
DOM_STATE_SHUTDOWN,
+ DOM_STATE_CRASHED,
DOM_STATE_UNKNOWN]])
POWER_STATE_ALL = 'all'
@@ -1191,13 +1193,14 @@ class XendDomain:
if dominfo.getDomid() == DOM0_ID:
raise XendError("Cannot pause privileged domain %s" % domid)
ds = dominfo._stateGet()
- if ds not in (DOM_STATE_RUNNING, DOM_STATE_PAUSED):
+ if ds not in (DOM_STATE_RUNNING, DOM_STATE_PAUSED, DOM_STATE_CRASHED):
raise VMBadState("Domain '%s' is not started" % domid,
POWER_STATE_NAMES[DOM_STATE_RUNNING],
POWER_STATE_NAMES[ds])
log.info("Domain %s (%d) paused.", dominfo.getName(),
int(dominfo.getDomid()))
- dominfo.pause()
+ if ds == DOM_STATE_RUNNING:
+ dominfo.pause()
if state:
return ds
except XendInvalidDomain:
@@ -1216,7 +1219,7 @@ class XendDomain:
if dominfo.getDomid() == DOM0_ID:
raise XendError("Cannot dump core for privileged domain %s" % domid)
- if dominfo._stateGet() not in (DOM_STATE_PAUSED, DOM_STATE_RUNNING):
+ if dominfo._stateGet() not in (DOM_STATE_PAUSED, DOM_STATE_RUNNING, DOM_STATE_CRASHED):
raise VMBadState("Domain '%s' is not started" % domid,
POWER_STATE_NAMES[DOM_STATE_PAUSED],
POWER_STATE_NAMES[dominfo._stateGet()])
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -414,7 +414,7 @@ class XendDomainInfo:
"""
from xen.xend import XendDomain
- if self._stateGet() in (XEN_API_VM_POWER_STATE_HALTED, XEN_API_VM_POWER_STATE_SUSPENDED):
+ if self._stateGet() in (XEN_API_VM_POWER_STATE_HALTED, XEN_API_VM_POWER_STATE_SUSPENDED, XEN_API_VM_POWER_STATE_CRASHED):
try:
XendTask.log_progress(0, 30, self._constructDomain)
XendTask.log_progress(31, 60, self._initDomain)
@@ -648,7 +648,7 @@ class XendDomainInfo:
return rc
def getDeviceSxprs(self, deviceClass):
- if self._stateGet() in (DOM_STATE_RUNNING, DOM_STATE_PAUSED):
+ if self._stateGet() in (DOM_STATE_RUNNING, DOM_STATE_PAUSED, DOM_STATE_CRASHED):
return self.getDeviceController(deviceClass).sxprs()
else:
sxprs = []
@@ -2257,6 +2257,9 @@ class XendDomainInfo:
return XEN_API_VM_POWER_STATE_SUSPENDED
else:
return XEN_API_VM_POWER_STATE_HALTED
+ elif info['crashed']:
+ # Crashed
+ return XEN_API_VM_POWER_STATE_CRASHED
else:
# We are either RUNNING or PAUSED
if info['paused']:

View File

@ -1,64 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1201267747 0
# Node ID 367902a19412ba2cb6b3dff88a83ba624457e8e0
# Parent 666573856c5928371435b72d907dd7f06965965f
Fix 'on_*=rename-restart' domain configuration option.
When setting e.g. 'on_crash=rename-restart' option in domain config
and crashing guest OS running in the domain, the new domain is
restarted with same name as renamed domain.
jfehlig4: # xm li
Name ID Mem VCPUs State Time(s)
Domain-0 0 1233 4 r----- 937.9
Domain-e64b12a0-0493-44d7-afde-55c776513426 21 384 1 ---c- 14.3
Domain-e64b12a0-0493-44d7-afde-55c776513426 22 384 1 r----- 7.3
This patch copies the domain info prior to setting new name and uuid
in the crashed domain info and uses the copied domain info to
construct the restarted domain.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1391,9 +1391,10 @@ class XendDomainInfo:
self._writeVm('xend/previous_restart_time', str(now))
+ new_dom_info = self.info
try:
if rename:
- self._preserveForRestart()
+ new_dom_info = self._preserveForRestart()
else:
self._unwatchVm()
self.destroyDomain()
@@ -1407,7 +1408,7 @@ class XendDomainInfo:
new_dom = None
try:
new_dom = XendDomain.instance().domain_create_from_dict(
- self.info)
+ new_dom_info)
new_dom.waitForDevices()
new_dom.unpause()
rst_cnt = self._readVm('xend/restart_count')
@@ -1438,11 +1439,15 @@ class XendDomainInfo:
new_name, new_uuid)
self._unwatchVm()
self._releaseDevices()
+ new_dom_info = self.info.copy()
+ new_dom_info['name_label'] = self.info['name_label']
+ new_dom_info['uuid'] = self.info['uuid']
self.info['name_label'] = new_name
self.info['uuid'] = new_uuid
self.vmpath = XS_VMROOT + new_uuid
self._storeVmDetails()
self._preserve()
+ return new_dom_info
def _preserve(self):

View File

@ -1,23 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1201267771 0
# Node ID dc6264577b5905a82a41d082544280867f259d81
# Parent 367902a19412ba2cb6b3dff88a83ba624457e8e0
Remove outdated comments concerning Xen API in xend configuration file.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
diff -r 367902a19412 -r dc6264577b59 tools/examples/xend-config.sxp
--- a/tools/examples/xend-config.sxp Fri Jan 25 13:29:07 2008 +0000
+++ b/tools/examples/xend-config.sxp Fri Jan 25 13:29:31 2008 +0000
@@ -15,9 +15,7 @@
#(loglevel DEBUG)
-# The Xen-API server configuration. (Please note that this server is
-# available as an UNSUPPORTED PREVIEW in Xen 3.0.4, and should not be relied
-# upon).
+# The Xen-API server configuration.
#
# This value configures the ports, interfaces, and access controls for the
# Xen-API server. Each entry in the list starts with either unix, a port

View File

@ -1,83 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1201267791 0
# Node ID 7f9646fcffe8075a75ba831832773ace485a8608
# Parent dc6264577b5905a82a41d082544280867f259d81
Fix leaking of /vm/<uuid> path in xenstore on various VM lifecycle events.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Index: xen-3.2.1-testing/tools/python/xen/xend/XendCheckpoint.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendCheckpoint.py
@@ -128,10 +128,10 @@ def save(fd, dominfo, network, live, dst
if checkpoint:
dominfo.resumeDomain()
else:
- dominfo.destroyDomain()
+ dominfo.destroy()
dominfo.testDeviceComplete()
try:
- dominfo.setName(domain_name)
+ dominfo.setName(domain_name, False)
except VmError:
# Ignore this. The name conflict (hopefully) arises because we
# are doing localhost migration; if we are doing a suspend of a
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1120,10 +1120,11 @@ class XendDomainInfo:
def getDomid(self):
return self.domid
- def setName(self, name):
+ def setName(self, name, to_store = True):
self._checkName(name)
self.info['name_label'] = name
- self.storeVm("name", name)
+ if to_store:
+ self.storeVm("name", name)
def getName(self):
return self.info['name_label']
@@ -1397,7 +1398,7 @@ class XendDomainInfo:
new_dom_info = self._preserveForRestart()
else:
self._unwatchVm()
- self.destroyDomain()
+ self.destroy()
# new_dom's VM will be the same as this domain's VM, except where
# the rename flag has instructed us to call preserveForRestart.
@@ -1411,9 +1412,6 @@ class XendDomainInfo:
new_dom_info)
new_dom.waitForDevices()
new_dom.unpause()
- rst_cnt = self._readVm('xend/restart_count')
- rst_cnt = int(rst_cnt) + 1
- self._writeVm('xend/restart_count', str(rst_cnt))
new_dom._removeVm(RESTART_IN_PROGRESS)
except:
if new_dom:
@@ -1439,13 +1437,19 @@ class XendDomainInfo:
new_name, new_uuid)
self._unwatchVm()
self._releaseDevices()
+ # Remove existing vm node in xenstore
+ self._removeVm()
new_dom_info = self.info.copy()
new_dom_info['name_label'] = self.info['name_label']
new_dom_info['uuid'] = self.info['uuid']
self.info['name_label'] = new_name
self.info['uuid'] = new_uuid
self.vmpath = XS_VMROOT + new_uuid
+ # Write out new vm node to xenstore
self._storeVmDetails()
+ rst_cnt = self._readVm('xend/restart_count')
+ rst_cnt = int(rst_cnt) + 1
+ self._writeVm('xend/restart_count', str(rst_cnt))
self._preserve()
return new_dom_info

View File

@ -1,43 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1201278634 0
# Node ID c2216dce87fba6866de8814b19ab580a852f65b6
# Parent c360bb765b25b5a83550741e6ff80007ffb00885
Update XenAPI version number, changelog, and cover sheet.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
diff -r c360bb765b25 -r c2216dce87fb docs/xen-api/revision-history.tex
--- a/docs/xen-api/revision-history.tex Fri Jan 25 16:26:31 2008 +0000
+++ b/docs/xen-api/revision-history.tex Fri Jan 25 16:30:34 2008 +0000
@@ -16,5 +16,12 @@
\end{flushleft}
\end{minipage}\\
\hline
+ 1.0.2 & 25th Jan. 08 & J. Fehlig &
+ \begin{minipage}[t]{7cm}
+ \begin{flushleft}
+ Added Crashed VM power state.
+ \end{flushleft}
+ \end{minipage}\\
+ \hline
\end{tabular}
\end{center}
\ No newline at end of file
diff -r c360bb765b25 -r c2216dce87fb docs/xen-api/xenapi-coversheet.tex
--- a/docs/xen-api/xenapi-coversheet.tex Fri Jan 25 16:26:31 2008 +0000
+++ b/docs/xen-api/xenapi-coversheet.tex Fri Jan 25 16:30:34 2008 +0000
@@ -17,12 +17,12 @@
\newcommand{\coversheetlogo}{xen.eps}
%% Document date
-\newcommand{\datestring}{10th December 2007}
+\newcommand{\datestring}{25th January 2008}
\newcommand{\releasestatement}{Stable Release}
%% Document revision
-\newcommand{\revstring}{API Revision 1.0.1}
+\newcommand{\revstring}{API Revision 1.0.2}
%% Document authors
\newcommand{\docauthors}{

View File

@ -1,285 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1201614376 0
# Node ID 98c2665056ea4fe63e02c943536db686fcedc459
# Parent 193afcdb85b211d72f940e086397490ce72f06e6
x86, hvm: Add a per-domain parameter to specify shadow or hap.
Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
Index: xen-3.2.1-testing/tools/python/xen/lowlevel/xc/xc.c
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/lowlevel/xc/xc.c
+++ xen-3.2.1-testing/tools/python/xen/lowlevel/xc/xc.c
@@ -97,16 +97,16 @@ static PyObject *pyxc_domain_create(XcOb
PyObject *kwds)
{
uint32_t dom = 0, ssidref = 0, flags = 0;
- int ret, i, hvm = 0;
+ int ret, i;
PyObject *pyhandle = NULL;
xen_domain_handle_t handle = {
0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef,
0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef };
- static char *kwd_list[] = { "domid", "ssidref", "handle", "hvm", NULL };
+ static char *kwd_list[] = { "domid", "ssidref", "handle", "flags", NULL };
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iiOi", kwd_list,
- &dom, &ssidref, &pyhandle, &hvm))
+ &dom, &ssidref, &pyhandle, &flags))
return NULL;
if ( pyhandle != NULL )
@@ -124,9 +124,6 @@ static PyObject *pyxc_domain_create(XcOb
}
}
- if ( hvm )
- flags |= XEN_DOMCTL_CDF_hvm_guest;
-
if ( (ret = xc_domain_create(self->xc_handle, ssidref,
handle, flags, &dom)) < 0 )
return pyxc_error_to_exception();
Index: xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py
@@ -130,7 +130,7 @@ XENAPI_PLATFORM_CFG = [ 'acpi', 'apic',
'soundhw','stdvga', 'usb', 'usbdevice', 'vnc',
'vncconsole', 'vncdisplay', 'vnclisten', 'timer_mode',
'vncpasswd', 'vncunused', 'xauthority', 'pci', 'vhpt',
- 'guest_os_type' ]
+ 'guest_os_type', 'hap']
# Xen API console 'other_config' keys.
XENAPI_CONSOLE_OTHER_CFG = ['vncunused', 'vncdisplay', 'vnclisten',
@@ -1589,3 +1589,6 @@ class XendConfig(dict):
def image_type(self):
stored_type = self['platform'].get('image_type')
return stored_type or (self.is_hvm() and 'hvm' or 'linux')
+
+ def is_hap(self):
+ return self['platform']['hap']
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1624,11 +1624,18 @@ class XendDomainInfo:
@raise: VmError on error
"""
+ hvm_bit_offset = 0
+
+ hap_bit_offset = 1
+
log.debug('XendDomainInfo.constructDomain')
self.shutdownStartTime = None
hvm = self.info.is_hvm()
+
+ hap = self.info.is_hap()
+
if hvm:
info = xc.xeninfo()
if 'hvm' not in info['xen_caps']:
@@ -1654,7 +1661,7 @@ class XendDomainInfo:
domid = 0,
ssidref = ssidref,
handle = uuid.fromString(self.info['uuid']),
- hvm = int(hvm))
+ flags = int((hvm << hvm_bit_offset) | (hap << hap_bit_offset)))
except Exception, e:
# may get here if due to ACM the operation is not permitted
if security.on():
Index: xen-3.2.1-testing/tools/python/xen/xm/create.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.2.1-testing/tools/python/xen/xm/create.py
@@ -521,6 +521,11 @@ gopts.var('on_xend_stop', val='ignore|sh
- suspend: Domain is suspended;
""")
+gopts.var('hap', val='HAP',
+ fn=set_int, default=1,
+ use="""Hap status (0=hap is disabled;
+ 1=hap is enabled.""")
+
def err(msg):
"""Print an error to stderr and exit.
"""
@@ -724,7 +729,7 @@ def configure_hvm(config_image, vals):
'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten',
'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor',
'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci',
- 'guest_os_type']
+ 'guest_os_type', 'hap']
for a in args:
if a in vals.__dict__ and vals.__dict__[a] is not None:
Index: xen-3.2.1-testing/tools/python/xen/xm/xenapi_create.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xm/xenapi_create.py
+++ xen-3.2.1-testing/tools/python/xen/xm/xenapi_create.py
@@ -818,7 +818,7 @@ class sxp2xml:
def extract_platform(self, image, document):
- platform_keys = ['acpi', 'apic', 'pae', 'vhpt', 'timer_mode']
+ platform_keys = ['acpi', 'apic', 'pae', 'vhpt', 'timer_mode', 'hap']
def extract_platform_key(key):
platform = document.createElement("platform")
Index: xen-3.2.1-testing/xen/arch/ia64/xen/domain.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/ia64/xen/domain.c
+++ xen-3.2.1-testing/xen/arch/ia64/xen/domain.c
@@ -550,7 +550,7 @@ static int opt_pervcpu_vhpt = 1;
integer_param("pervcpu_vhpt", opt_pervcpu_vhpt);
#endif
-int arch_domain_create(struct domain *d)
+int arch_domain_create(struct domain *d, unsigned int domcr_flags)
{
int i;
Index: xen-3.2.1-testing/xen/arch/powerpc/domain.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/powerpc/domain.c
+++ xen-3.2.1-testing/xen/arch/powerpc/domain.c
@@ -76,7 +76,7 @@ unsigned long hypercall_create_continuat
return XEN_MARK(op);
}
-int arch_domain_create(struct domain *d)
+int arch_domain_create(struct domain *d, unsigned int domcr_flags)
{
if (d->domain_id == IDLE_DOMAIN_ID) {
d->shared_info = (void *)alloc_xenheap_page();
Index: xen-3.2.1-testing/xen/arch/x86/domain.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/domain.c
+++ xen-3.2.1-testing/xen/arch/x86/domain.c
@@ -436,7 +436,7 @@ void vcpu_destroy(struct vcpu *v)
hvm_vcpu_destroy(v);
}
-int arch_domain_create(struct domain *d)
+int arch_domain_create(struct domain *d, unsigned int domcr_flags)
{
#ifdef __x86_64__
struct page_info *pg;
@@ -446,6 +446,11 @@ int arch_domain_create(struct domain *d)
int vcpuid, pdpt_order, paging_initialised = 0;
int rc = -ENOMEM;
+ d->arch.hvm_domain.hap_enabled =
+ is_hvm_domain(d) &&
+ hvm_funcs.hap_supported &&
+ (domcr_flags & DOMCRF_hap);
+
d->arch.relmem = RELMEM_not_started;
INIT_LIST_HEAD(&d->arch.relmem_list);
Index: xen-3.2.1-testing/xen/arch/x86/mm/paging.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/paging.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/paging.c
@@ -28,7 +28,7 @@
#include <asm/guest_access.h>
#include <xsm/xsm.h>
-#define hap_enabled(d) (hvm_funcs.hap_supported && is_hvm_domain(d))
+#define hap_enabled(d) (is_hvm_domain(d) && (d)->arch.hvm_domain.hap_enabled)
/* Printouts */
#define PAGING_PRINTK(_f, _a...) \
Index: xen-3.2.1-testing/xen/common/domain.c
===================================================================
--- xen-3.2.1-testing.orig/xen/common/domain.c
+++ xen-3.2.1-testing/xen/common/domain.c
@@ -231,7 +231,7 @@ struct domain *domain_create(
init_status |= INIT_gnttab;
}
- if ( arch_domain_create(d) != 0 )
+ if ( arch_domain_create(d, domcr_flags) != 0 )
goto fail;
init_status |= INIT_arch;
Index: xen-3.2.1-testing/xen/common/domctl.c
===================================================================
--- xen-3.2.1-testing.orig/xen/common/domctl.c
+++ xen-3.2.1-testing/xen/common/domctl.c
@@ -325,7 +325,8 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
ret = -EINVAL;
if ( supervisor_mode_kernel ||
- (op->u.createdomain.flags & ~XEN_DOMCTL_CDF_hvm_guest) )
+ (op->u.createdomain.flags &
+ ~(XEN_DOMCTL_CDF_hvm_guest | XEN_DOMCTL_CDF_hap)) )
break;
dom = op->domain;
@@ -355,6 +356,8 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
domcr_flags = 0;
if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_hvm_guest )
domcr_flags |= DOMCRF_hvm;
+ if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_hap )
+ domcr_flags |= DOMCRF_hap;
ret = -ENOMEM;
d = domain_create(dom, domcr_flags, op->u.createdomain.ssidref);
Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/domain.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hvm/domain.h
+++ xen-3.2.1-testing/xen/include/asm-x86/hvm/domain.h
@@ -73,6 +73,8 @@ struct hvm_domain {
/* Pass-through */
struct hvm_iommu hvm_iommu;
+
+ bool_t hap_enabled;
};
#endif /* __ASM_X86_HVM_DOMAIN_H__ */
Index: xen-3.2.1-testing/xen/include/public/domctl.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/public/domctl.h
+++ xen-3.2.1-testing/xen/include/public/domctl.h
@@ -53,6 +53,9 @@ struct xen_domctl_createdomain {
/* Is this an HVM guest (as opposed to a PV guest)? */
#define _XEN_DOMCTL_CDF_hvm_guest 0
#define XEN_DOMCTL_CDF_hvm_guest (1U<<_XEN_DOMCTL_CDF_hvm_guest)
+ /* Use hardware-assisted paging if available? */
+#define _XEN_DOMCTL_CDF_hap 1
+#define XEN_DOMCTL_CDF_hap (1U<<_XEN_DOMCTL_CDF_hap)
uint32_t flags;
};
typedef struct xen_domctl_createdomain xen_domctl_createdomain_t;
Index: xen-3.2.1-testing/xen/include/xen/domain.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/xen/domain.h
+++ xen-3.2.1-testing/xen/include/xen/domain.h
@@ -40,7 +40,7 @@ void free_vcpu_struct(struct vcpu *v);
int vcpu_initialise(struct vcpu *v);
void vcpu_destroy(struct vcpu *v);
-int arch_domain_create(struct domain *d);
+int arch_domain_create(struct domain *d, unsigned int domcr_flags);
void arch_domain_destroy(struct domain *d);
Index: xen-3.2.1-testing/xen/include/xen/sched.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/xen/sched.h
+++ xen-3.2.1-testing/xen/include/xen/sched.h
@@ -311,6 +311,8 @@ struct domain *domain_create(
/* DOMCRF_hvm: Create an HVM domain, as opposed to a PV domain. */
#define _DOMCRF_hvm 0
#define DOMCRF_hvm (1U<<_DOMCRF_hvm)
+#define _DOMCRF_hap 1
+#define DOMCRF_hap (1U<<_DOMCRF_hap)
int construct_dom0(
struct domain *d,

View File

@ -1,53 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1201619795 0
# Node ID 233f40973e1d689d66b25e439b2f48524dd579ea
# Parent 04e24b9dcc1649e86d3e94a81489dab9c6ec82bc
xend: Fix building PV guests after introducing new HVM-HAP config option.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Index: xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py
@@ -1591,4 +1591,4 @@ class XendConfig(dict):
return stored_type or (self.is_hvm() and 'hvm' or 'linux')
def is_hap(self):
- return self['platform']['hap']
+ return self['platform'].get('hap', 0)
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1624,19 +1624,14 @@ class XendDomainInfo:
@raise: VmError on error
"""
- hvm_bit_offset = 0
-
- hap_bit_offset = 1
-
log.debug('XendDomainInfo.constructDomain')
self.shutdownStartTime = None
+ hap = 0
hvm = self.info.is_hvm()
-
- hap = self.info.is_hap()
-
if hvm:
+ hap = self.info.is_hap()
info = xc.xeninfo()
if 'hvm' not in info['xen_caps']:
raise VmError("HVM guest support is unavailable: is VT/AMD-V "
@@ -1661,7 +1656,7 @@ class XendDomainInfo:
domid = 0,
ssidref = ssidref,
handle = uuid.fromString(self.info['uuid']),
- flags = int((hvm << hvm_bit_offset) | (hap << hap_bit_offset)))
+ flags = int((hvm << 0) | (hap << 1)))
except Exception, e:
# may get here if due to ACM the operation is not permitted
if security.on():

View File

@ -1,21 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1201685890 0
# Node ID 47b7ec3b4055d59a09a1af26a29e8ef90e0d8d9c
# Parent 92aa029e7cb19ac32c7e3ff2a3d78bd67af047f3
xend: Small fix for hvm/hap flags.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1656,7 +1656,7 @@ class XendDomainInfo:
domid = 0,
ssidref = ssidref,
handle = uuid.fromString(self.info['uuid']),
- flags = int((hvm << 0) | (hap << 1)))
+ flags = (int(hvm) << 0) | (int(hap) << 1))
except Exception, e:
# may get here if due to ACM the operation is not permitted
if security.on():

View File

@ -1,69 +0,0 @@
Index: xen-3.2.1-testing/tools/ioemu/hw/xen_machine_fv.c
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/hw/xen_machine_fv.c
+++ xen-3.2.1-testing/tools/ioemu/hw/xen_machine_fv.c
@@ -205,6 +205,8 @@ static void xen_init_fv(uint64_t ram_siz
}
#endif
+ xenstore_parse_domain_config(domid);
+
xc_get_hvm_param(xc_handle, domid, HVM_PARAM_IOREQ_PFN, &ioreq_pfn);
fprintf(logfile, "shared page at pfn %lx\n", ioreq_pfn);
shared_page = xc_map_foreign_range(xc_handle, domid, XC_PAGE_SIZE,
Index: xen-3.2.1-testing/tools/ioemu/vl.c
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/vl.c
+++ xen-3.2.1-testing/tools/ioemu/vl.c
@@ -7613,7 +7613,7 @@ int main(int argc, char **argv)
#ifdef CONFIG_DM
bdrv_init();
xc_handle = xc_interface_open();
- xenstore_parse_domain_config(domid);
+ xenstore_daemon_open();
#endif /* CONFIG_DM */
#ifdef USE_KQEMU
Index: xen-3.2.1-testing/tools/ioemu/vl.h
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/vl.h
+++ xen-3.2.1-testing/tools/ioemu/vl.h
@@ -1456,6 +1456,7 @@ void readline_start(const char *prompt,
ReadLineFunc *readline_func, void *opaque);
/* xenstore.c */
+void xenstore_daemon_open(void);
void xenstore_parse_domain_config(int domid);
int xenstore_fd(void);
void xenstore_process_event(void *opaque);
Index: xen-3.2.1-testing/tools/ioemu/xenstore.c
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/xenstore.c
+++ xen-3.2.1-testing/tools/ioemu/xenstore.c
@@ -77,6 +77,13 @@ static void waitForDevice(char *fn)
return;
}
+void xenstore_daemon_open(void)
+{
+ xsh = xs_daemon_open();
+ if (xsh == NULL)
+ fprintf(logfile, "Could not contact xenstore for domain config\n");
+}
+
void xenstore_parse_domain_config(int domid)
{
char **e = NULL;
@@ -90,12 +97,6 @@ void xenstore_parse_domain_config(int do
for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++)
media_filename[i] = NULL;
- xsh = xs_daemon_open();
- if (xsh == NULL) {
- fprintf(logfile, "Could not contact xenstore for domain config\n");
- return;
- }
-
path = xs_get_domain_path(xsh, domid);
if (path == NULL) {
fprintf(logfile, "xs_get_domain_path() error\n");

View File

@ -1,61 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1202207975 0
# Node ID def2adbce510a31711f22cf15f5afe51f875e3ea
# Parent 32e9c52fc6d9a6104afb2dbd84a89395b16f0e34
xend: Restore values of /vm/uuid/xend/* to recreated domains.
When guest domains are restarted, previous values of /vm/uuid/xend/*
in xenstore are lost. (e.g. previous_restart_time,
last_shutdown_reason). This patch restores them to restarting domains.
And we should update /vm/uuid/xend/restart_count of restarting
domains, not previous domains.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -882,6 +882,9 @@ class XendDomainInfo:
def _gatherVm(self, *args):
return xstransact.Gather(self.vmpath, *args)
+ def _listRecursiveVm(self, *args):
+ return xstransact.ListRecursive(self.vmpath, *args)
+
def storeVm(self, *args):
return xstransact.Store(self.vmpath, *args)
@@ -1392,6 +1395,7 @@ class XendDomainInfo:
self._writeVm('xend/previous_restart_time', str(now))
+ prev_vm_xend = self._listRecursiveVm('xend')
new_dom_info = self.info
try:
if rename:
@@ -1410,8 +1414,13 @@ class XendDomainInfo:
try:
new_dom = XendDomain.instance().domain_create_from_dict(
new_dom_info)
+ for x in prev_vm_xend[0][1]:
+ new_dom._writeVm('xend/%s' % x[0], x[1])
new_dom.waitForDevices()
new_dom.unpause()
+ rst_cnt = new_dom._readVm('xend/restart_count')
+ rst_cnt = int(rst_cnt) + 1
+ new_dom._writeVm('xend/restart_count', str(rst_cnt))
new_dom._removeVm(RESTART_IN_PROGRESS)
except:
if new_dom:
@@ -1447,9 +1456,6 @@ class XendDomainInfo:
self.vmpath = XS_VMROOT + new_uuid
# Write out new vm node to xenstore
self._storeVmDetails()
- rst_cnt = self._readVm('xend/restart_count')
- rst_cnt = int(rst_cnt) + 1
- self._writeVm('xend/restart_count', str(rst_cnt))
self._preserve()
return new_dom_info

View File

@ -1,250 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1202376535 0
# Node ID 58e5e9ae0f8dcc4abb390d46d89e49c65e62607b
# Parent d04593aa1605fd337423b2c1296e275424e06656
Add 'coredump-destroy' and 'coredump-restart' actions for crashed domains.
Xen-API already specifies these actions for the 'on_crash' domain exit
event. This patch makes them available for use in traditional domU
config files and through the xm tool as well.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Index: xen-3.2.1-testing/docs/man/xmdomain.cfg.pod.5
===================================================================
--- xen-3.2.1-testing.orig/docs/man/xmdomain.cfg.pod.5
+++ xen-3.2.1-testing/docs/man/xmdomain.cfg.pod.5
@@ -298,6 +298,22 @@ it holds, so that the new one may take t
=back
+=over 4
+
+Additionally, the "on_crash" event can also take:
+
+=item B<coredump-destroy>
+
+Dump the crashed domain's core and then destroy it.
+
+=back
+
+=item B<coredump-restart>
+
+Dump the crashed domain's core and then restart it.
+
+=back
+
=head1 EXAMPLES
The following are quick examples of ways that domains might be
Index: xen-3.2.1-testing/tools/examples/xmexample.hvm
===================================================================
--- xen-3.2.1-testing.orig/tools/examples/xmexample.hvm
+++ xen-3.2.1-testing/tools/examples/xmexample.hvm
@@ -87,6 +87,11 @@ disk = [ 'file:/var/images/min-el3-i386.
# "rename-restart", meaning that the old domain is not cleaned up, but is
# renamed and a new domain started in its place.
#
+# In the event a domain stops due to a crash, you have the additional options:
+#
+# "coredump-destroy", meaning dump the crashed domain's core and then destroy;
+# "coredump-restart', meaning dump the crashed domain's core and the restart.
+#
# The default is
#
# on_poweroff = 'destroy'
Index: xen-3.2.1-testing/tools/examples/xmexample1
===================================================================
--- xen-3.2.1-testing.orig/tools/examples/xmexample1
+++ xen-3.2.1-testing/tools/examples/xmexample1
@@ -155,6 +155,11 @@ extra = "4"
# "rename-restart", meaning that the old domain is not cleaned up, but is
# renamed and a new domain started in its place.
#
+# In the event a domain stops due to a crash, you have the additional options:
+#
+# "coredump-destroy", meaning dump the crashed domain's core and then destroy;
+# "coredump-restart', meaning dump the crashed domain's core and the restart.
+#
# The default is
#
# on_poweroff = 'destroy'
Index: xen-3.2.1-testing/tools/examples/xmexample2
===================================================================
--- xen-3.2.1-testing.orig/tools/examples/xmexample2
+++ xen-3.2.1-testing/tools/examples/xmexample2
@@ -191,6 +191,11 @@ extra = "4 VMID=%d usr=/dev/sda6" % vmid
# "rename-restart", meaning that the old domain is not cleaned up, but is
# renamed and a new domain started in its place.
#
+# In the event a domain stops due to a crash, you have the additional options:
+#
+# "coredump-destroy", meaning dump the crashed domain's core and then destroy;
+# "coredump-restart', meaning dump the crashed domain's core and the restart.
+#
# The default is
#
# on_poweroff = 'destroy'
Index: xen-3.2.1-testing/tools/examples/xmexample3
===================================================================
--- xen-3.2.1-testing.orig/tools/examples/xmexample3
+++ xen-3.2.1-testing/tools/examples/xmexample3
@@ -177,6 +177,11 @@ extra = "4 VMID=%d" % vmid
# "rename-restart", meaning that the old domain is not cleaned up, but is
# renamed and a new domain started in its place.
#
+# In the event a domain stops due to a crash, you have the additional options:
+#
+# "coredump-destroy", meaning dump the crashed domain's core and then destroy;
+# "coredump-restart', meaning dump the crashed domain's core and the restart.
+#
# The default is
#
# on_poweroff = 'destroy'
Index: xen-3.2.1-testing/tools/python/xen/xend/XendAPIConstants.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendAPIConstants.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendAPIConstants.py
@@ -51,6 +51,18 @@ XEN_API_ON_CRASH_BEHAVIOUR = [
'rename_restart'
]
+XEN_API_ON_CRASH_BEHAVIOUR_FILTER = {
+ 'destroy' : 'destroy',
+ 'coredump-destroy' : 'coredump_and_destroy',
+ 'coredump_and_destroy' : 'coredump_and_destroy',
+ 'restart' : 'restart',
+ 'coredump-restart' : 'coredump_and_restart',
+ 'coredump_and_restart' : 'coredump_and_restart',
+ 'preserve' : 'preserve',
+ 'rename-restart' : 'rename_restart',
+ 'rename_restart' : 'rename_restart',
+}
+
XEN_API_VBD_MODE = ['RO', 'RW']
XEN_API_VDI_TYPE = ['system', 'user', 'ephemeral']
XEN_API_VBD_TYPE = ['CD', 'Disk']
Index: xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py
@@ -241,7 +241,8 @@ LEGACY_XENSTORE_VM_PARAMS = [
## Config Choices
##
-CONFIG_RESTART_MODES = ('restart', 'destroy', 'preserve', 'rename-restart')
+CONFIG_RESTART_MODES = ('restart', 'destroy', 'preserve', 'rename-restart',
+ 'coredump-destroy', 'coredump-restart')
CONFIG_OLD_DOM_STATES = ('running', 'blocked', 'paused', 'shutdown',
'crashed', 'dying')
Index: xen-3.2.1-testing/tools/python/xen/xend/XendConstants.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendConstants.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendConstants.py
@@ -52,7 +52,9 @@ restart_modes = [
"restart",
"destroy",
"preserve",
- "rename-restart"
+ "rename-restart",
+ "coredump-destroy",
+ "coredump-restart"
]
DOM_STATES = [
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1262,14 +1262,6 @@ class XendDomainInfo:
self.info['name_label'], self.domid)
self._writeVm(LAST_SHUTDOWN_REASON, 'crash')
- if xoptions.get_enable_dump():
- try:
- self.dumpCore()
- except XendError:
- # This error has been logged -- there's nothing more
- # we can do in this context.
- pass
-
restart_reason = 'crash'
self._stateSet(DOM_STATE_HALTED)
@@ -1337,14 +1329,30 @@ class XendDomainInfo:
def _clearRestart(self):
self._removeDom("xend/shutdown_start_time")
+ def _maybeDumpCore(self, reason):
+ if reason == 'crash':
+ if xoptions.get_enable_dump() or self.get_on_crash() \
+ in ['coredump_and_destroy', 'coredump_and_restart']:
+ try:
+ self.dumpCore()
+ except XendError:
+ # This error has been logged -- there's nothing more
+ # we can do in this context.
+ pass
def _maybeRestart(self, reason):
+ # Before taking configured action, dump core if configured to do so.
+ #
+ self._maybeDumpCore(reason)
+
# Dispatch to the correct method based upon the configured on_{reason}
# behaviour.
actions = {"destroy" : self.destroy,
"restart" : self._restart,
"preserve" : self._preserve,
- "rename-restart" : self._renameRestart}
+ "rename-restart" : self._renameRestart,
+ "coredump-destroy" : self.destroy,
+ "coredump-restart" : self._restart}
action_conf = {
'poweroff': 'actions_after_shutdown',
@@ -2558,9 +2566,10 @@ class XendDomainInfo:
def get_on_crash(self):
after_crash = self.info.get('actions_after_crash')
- if not after_crash or after_crash not in XEN_API_ON_CRASH_BEHAVIOUR:
+ if not after_crash or after_crash not in \
+ XEN_API_ON_CRASH_BEHAVIOUR + restart_modes:
return XEN_API_ON_CRASH_BEHAVIOUR[0]
- return after_crash
+ return XEN_API_ON_CRASH_BEHAVIOUR_FILTER[after_crash]
def get_dev_config_by_uuid(self, dev_class, dev_uuid):
""" Get's a device configuration either from XendConfig or
Index: xen-3.2.1-testing/tools/python/xen/xm/create.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.2.1-testing/tools/python/xen/xm/create.py
@@ -260,15 +260,17 @@ gopts.var('on_reboot', val='destroy|rest
renamed and a new domain started in its place.
""")
-gopts.var('on_crash', val='destroy|restart|preserve|rename-restart',
+gopts.var('on_crash', val='destroy|restart|preserve|rename-restart|coredump-destroy|ciredump-restart',
fn=set_value, default=None,
- use="""Behaviour when a domain exits with reason 'crash'.
- - destroy: the domain is cleaned up as normal;
- - restart: a new domain is started in place of the old one;
- - preserve: no clean-up is done until the domain is manually
- destroyed (using xm destroy, for example);
- - rename-restart: the old domain is not cleaned up, but is
- renamed and a new domain started in its place.
+ use="""Behaviour when a domain exits with reason 'crash'.
+ - destroy: the domain is cleaned up as normal;
+ - restart: a new domain is started in place of the old one;
+ - preserve: no clean-up is done until the domain is manually
+ destroyed (using xm destroy, for example);
+ - rename-restart: the old domain is not cleaned up, but is
+ renamed and a new domain started in its place.
+ - coredump-destroy: dump the domain's core, followed by destroy
+ - coredump-restart: dump the domain's core, followed by restart
""")
gopts.var('blkif', val='no|yes',

View File

@ -1,64 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1202724185 0
# Node ID dbb60ed6bc22ea17d34d18ae4a769b917acd5ef4
# Parent 54bd38dab5ef5713623cd5b83721820a1fd61a06
ioemu: make AIO optional (already done upstream)
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Index: xen-3.2.1-testing/tools/ioemu/block-raw.c
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/block-raw.c
+++ xen-3.2.1-testing/tools/ioemu/block-raw.c
@@ -25,7 +25,9 @@
#include "block_int.h"
#include <assert.h>
#ifndef _WIN32
+#ifndef NO_AIO
#include <aio.h>
+#endif
#ifndef QEMU_TOOL
#include "exec-all.h"
@@ -268,6 +270,7 @@ label__raw_write__success:
/***********************************************************/
/* Unix AIO using POSIX AIO */
+#ifndef NO_AIO
typedef struct RawAIOCB {
BlockDriverAIOCB common;
struct aiocb aiocb;
@@ -493,6 +496,7 @@ static void raw_aio_cancel(BlockDriverAI
pacb = &acb->next;
}
}
+#endif
static void raw_close(BlockDriverState *bs)
{
@@ -613,10 +617,12 @@ BlockDriver bdrv_raw = {
raw_create,
raw_flush,
+#ifndef NO_AIO
.bdrv_aio_read = raw_aio_read,
.bdrv_aio_write = raw_aio_write,
.bdrv_aio_cancel = raw_aio_cancel,
.aiocb_size = sizeof(RawAIOCB),
+#endif
.protocol_name = "file",
.bdrv_pread = raw_pread,
.bdrv_pwrite = raw_pwrite,
@@ -949,10 +955,12 @@ BlockDriver bdrv_host_device = {
NULL,
raw_flush,
+#ifndef NO_AIO
.bdrv_aio_read = raw_aio_read,
.bdrv_aio_write = raw_aio_write,
.bdrv_aio_cancel = raw_aio_cancel,
.aiocb_size = sizeof(RawAIOCB),
+#endif
.bdrv_pread = raw_pread,
.bdrv_pwrite = raw_pwrite,
.bdrv_getlength = raw_getlength,

File diff suppressed because it is too large Load Diff

View File

@ -1,85 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1204038008 0
# Node ID 6ef22eefc36056daa4f7e6c6f14873ea72658161
# Parent c8b58f82d893d821d60cb96225f94170bd7ae595
xend: Add free memory size of every node in physinfo to help user to
get usage of memory of their NUMA machine.
Signed-off-by: Duan Ronghui <ronghui.duan@intel.com>
Index: xen-3.2.1-testing/tools/python/xen/lowlevel/xc/xc.c
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/lowlevel/xc/xc.c
+++ xen-3.2.1-testing/tools/python/xen/lowlevel/xc/xc.c
@@ -780,7 +780,8 @@ static PyObject *pyxc_physinfo(XcObject
xc_physinfo_t info;
char cpu_cap[128], *p=cpu_cap, *q=cpu_cap;
int i, j, max_cpu_id;
- PyObject *ret_obj, *node_to_cpu_obj;
+ uint64_t free_heap;
+ PyObject *ret_obj, *node_to_cpu_obj, *node_to_memory_obj;
xc_cpu_to_node_t map[MAX_CPU_ID + 1];
set_xen_guest_handle(info.cpu_to_node, map);
@@ -828,7 +829,17 @@ static PyObject *pyxc_physinfo(XcObject
PyList_Append(node_to_cpu_obj, cpus);
}
+ node_to_memory_obj = PyList_New(0);
+
+ for ( i = 0; i < info.nr_nodes; i++ )
+ {
+ xc_availheap(self->xc_handle, 0, 0, i, &free_heap);
+ PyList_Append(node_to_memory_obj,
+ PyInt_FromLong(free_heap / 1024));
+ }
+
PyDict_SetItemString(ret_obj, "node_to_cpu", node_to_cpu_obj);
+ PyDict_SetItemString(ret_obj, "node_to_memory", node_to_memory_obj);
return ret_obj;
#undef MAX_CPU_ID
Index: xen-3.2.1-testing/tools/python/xen/xend/XendNode.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendNode.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendNode.py
@@ -573,6 +573,20 @@ class XendNode:
except:
str='none\n'
return str[:-1];
+ def format_node_to_memory(self, pinfo):
+ str=''
+ whitespace=''
+ try:
+ node_to_memory=pinfo['node_to_memory']
+ for i in range(0, pinfo['nr_nodes']):
+ str+='%snode%d:%d\n' % (whitespace,
+ i,
+ node_to_memory[i] / 1024)
+ whitespace='%25s' % ''
+ except:
+ str='none\n'
+ return str[:-1];
+
def physinfo(self):
info = self.xc.physinfo()
@@ -583,6 +597,7 @@ class XendNode:
info['total_memory'] = info['total_memory'] / 1024
info['free_memory'] = info['free_memory'] / 1024
info['node_to_cpu'] = self.format_node_to_cpu(info)
+ info['node_to_memory'] = self.format_node_to_memory(info)
ITEM_ORDER = ['nr_cpus',
'nr_nodes',
@@ -592,7 +607,8 @@ class XendNode:
'hw_caps',
'total_memory',
'free_memory',
- 'node_to_cpu'
+ 'node_to_cpu',
+ 'node_to_memory'
]
return [[k, info[k]] for k in ITEM_ORDER]

View File

@ -1,52 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1204118269 0
# Node ID b58180cf8ab8c69def4129f7152f136daf5e1596
# Parent 2b940e46857c0ddf5ef1e255e201a42caf310df6
xend: Set default vcpu affinity for better performance in NUMA systems.
Signed-off-by: Duan Ronghui <ronghui.duan@intel.com>
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1753,6 +1753,39 @@ class XendDomainInfo:
if self.info['cpus'] is not None and len(self.info['cpus']) > 0:
for v in range(0, self.info['VCPUs_max']):
xc.vcpu_setaffinity(self.domid, v, self.info['cpus'])
+ else:
+ info = xc.physinfo()
+ if info['nr_nodes'] > 1:
+ node_memory_list = info['node_to_memory']
+ needmem = self.image.getRequiredAvailableMemory(self.info['memory_dynamic_max']) / 1024
+ candidate_node_list = []
+ for i in range(0, info['nr_nodes']):
+ if node_memory_list[i] >= needmem:
+ candidate_node_list.append(i)
+ if candidate_node_list is None or len(candidate_node_list) == 1:
+ index = node_memory_list.index( max(node_memory_list) )
+ cpumask = info['node_to_cpu'][index]
+ else:
+ nodeload = [0]
+ nodeload = nodeload * info['nr_nodes']
+ from xen.xend import XendDomain
+ doms = XendDomain.instance().list('all')
+ for dom in doms:
+ cpuinfo = dom.getVCPUInfo()
+ for vcpu in sxp.children(cpuinfo, 'vcpu'):
+ def vinfo(n, t):
+ return t(sxp.child_value(vcpu, n))
+ cpumap = vinfo('cpumap', list)
+ for i in candidate_node_list:
+ node_cpumask = info['node_to_cpu'][i]
+ for j in node_cpumask:
+ if j in cpumap:
+ nodeload[i] += 1
+ break
+ index = nodeload.index( min(nodeload) )
+ cpumask = info['node_to_cpu'][index]
+ for v in range(0, self.info['VCPUs_max']):
+ xc.vcpu_setaffinity(self.domid, v, cpumask)
# Use architecture- and image-specific calculations to determine
# the various headrooms necessary, given the raw configured

View File

@ -1,44 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1204715792 0
# Node ID f85b379fa9436be0ecd733d7bedbebdf1838a310
# Parent 86e64b684fb2751f8d2db7e07e88da8505008255
x86 hvm: Remove global 'hap' boot parameter now that their is a
per-domain configuration option.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Index: xen-3.2-testing/xen/arch/x86/hvm/hvm.c
===================================================================
--- xen-3.2-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-3.2-testing/xen/arch/x86/hvm/hvm.c
@@ -50,16 +50,6 @@
#include <public/version.h>
#include <public/memory.h>
-/*
- * Xen command-line option to allow/disallow hardware-assisted paging.
- * Since the phys-to-machine table of AMD NPT is in host format, 32-bit Xen
- * can only support guests using NPT with up to a 4GB memory map. Therefore
- * we disallow HAP by default on PAE Xen (by default we want to support an
- * 8GB pseudophysical memory map for HVM guests on a PAE host).
- */
-static int opt_hap_permitted = (CONFIG_PAGING_LEVELS != 3);
-boolean_param("hap", opt_hap_permitted);
-
int hvm_enabled __read_mostly;
unsigned int opt_hvm_debug_level __read_mostly;
@@ -87,12 +77,7 @@ void hvm_enable(struct hvm_function_tabl
hvm_enabled = 1;
if ( hvm_funcs.hap_supported )
- {
- if ( !opt_hap_permitted )
- hvm_funcs.hap_supported = 0;
- printk("HVM: Hardware Assisted Paging detected %s.\n",
- hvm_funcs.hap_supported ? "and enabled" : "but disabled");
- }
+ printk("HVM: Hardware Assisted Paging detected.\n");
}
void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc)

View File

@ -1,22 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1204715870 0
# Node ID 1166ee0f476539a2cd5830854b7a22d5004ed291
# Parent f85b379fa9436be0ecd733d7bedbebdf1838a310
docs: Remove 'hap' boot parameter from the user manual.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
diff -r f85b379fa943 -r 1166ee0f4765 docs/src/user.tex
--- a/docs/src/user.tex Wed Mar 05 11:16:32 2008 +0000
+++ b/docs/src/user.tex Wed Mar 05 11:17:50 2008 +0000
@@ -4209,10 +4209,6 @@ writing to the VGA console after domain
\item [ dma\_emergency\_pool=xxx ] Specify lower bound on size of DMA
pool below which ordinary allocations will fail rather than fall
back to allocating from the DMA pool.
-\item [ hap ] Instruct Xen to detect hardware-assisted paging support, such
- as AMD-V's nested paging or Intel\textregistered VT's extended paging. If
- available, Xen will use hardware-assisted paging instead of shadow paging
- for guest memory management.
\end{description}
In addition, the following options may be specified on the Xen command

View File

@ -1,21 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1205838260 0
# Node ID 2ed94b9b10b3770d7bfd7346f532b70e70be35c1
# Parent 3ab6635f783d61e1f73ccf26074f80d8e9259a6d
Add periodic fflush to xentop batch mode.
From: Yusuke KANEKI <Kaneki.Yusuke@ea.MitsubishiElectric.co.jp>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Index: xen-3.2-testing/tools/xenstat/xentop/xentop.c
===================================================================
--- xen-3.2-testing.orig/tools/xenstat/xentop/xentop.c
+++ xen-3.2-testing/tools/xenstat/xentop/xentop.c
@@ -1121,6 +1121,7 @@ int main(int argc, char **argv)
do {
gettimeofday(&curtime, NULL);
top();
+ fflush(stdout);
oldtime = curtime;
if ((!loop) && !(--iterations))
break;

View File

@ -1,32 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1205838353 0
# Node ID 939ceafa5ef9244829b7347a0338002c7ae1a8a0
# Parent 2ed94b9b10b3770d7bfd7346f532b70e70be35c1
Initialization of new domU config options via XenAPI
Many of the new domU config options related to hvm guests (e.g. hpet,
rtc_timeoffset, etc.) are not initialized with default values via
XenAPI, which prevents starting an hvm domU created through XenAPI.
This patch ensures the new options are set with appropriate default
values in XendConfig platform sanity check.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Index: xen-3.2-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-3.2-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.2-testing/tools/python/xen/xend/XendConfig.py
@@ -403,6 +403,12 @@ class XendConfig(dict):
self['platform']['device_model'] = xen.util.auxbin.pathTo("qemu-dm")
if self.is_hvm():
+ if 'timer_mode' not in self['platform']:
+ self['platform']['timer_mode'] = 0
+ if 'rtc_timeoffset' not in self['platform']:
+ self['platform']['rtc_timeoffset'] = 0
+ if 'hpet' not in self['platform']:
+ self['platform']['hpet'] = 0
# Compatibility hack, can go away soon.
if 'soundhw' not in self['platform'] and \
self['platform'].get('enable_audio'):

View File

@ -1,31 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1205838386 0
# Node ID 06dbce4a60f973ccdb925a29a0b34b72774a5d0b
# Parent 939ceafa5ef9244829b7347a0338002c7ae1a8a0
Set device model when creating rfb console via XenAPI
When creating a rfb console via XenAPI the device model is not being
set to qemu-dm, resulting in no pvfb since qemu-dm is not launched
when domU is started. This patch sets device model when a rfb console
is created via XenAPI.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Index: xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py
@@ -1272,6 +1272,12 @@ class XendConfig(dict):
target['devices'][dev_uuid] = ('vfb', dev_info)
target['console_refs'].append(dev_uuid)
+ # if console is rfb, set device_model ensuring qemu
+ # is invoked for pvfb services
+ if 'device_model' not in target['platform']:
+ target['platform']['device_model'] = \
+ xen.util.auxbin.pathTo("qemu-dm")
+
# Finally, if we are a pvfb, we need to make a vkbd
# as well that is not really exposed to Xen API
vkbd_uuid = uuid.createString()

View File

@ -1,140 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1205838420 0
# Node ID c949248d590a59ee558780b636fe753434b5c933
# Parent 06dbce4a60f973ccdb925a29a0b34b72774a5d0b
Convert XenAPI platform values to appropriate types.
XenAPI defines the platform attribute of a VM as a string-string map
but in various code paths in xend the platform entries are expected to be
another type, e.g. int. This patch defines the types of each platform
entry and converts the entry values to appropriate type when new domU
configuration is created via XenAPI.
Alternatively the values could be casted to appropriate type when used
but seems prudent to do the conversion when domU configuration is
created.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Index: xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py
@@ -123,14 +123,43 @@ XENAPI_CFG_TO_LEGACY_CFG = {
LEGACY_CFG_TO_XENAPI_CFG = reverse_dict(XENAPI_CFG_TO_LEGACY_CFG)
-# Platform configuration keys.
-XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 'boot', 'device_model', 'display',
- 'fda', 'fdb', 'keymap', 'isa', 'localtime', 'monitor',
- 'nographic', 'pae', 'rtc_timeoffset', 'serial', 'sdl',
- 'soundhw','stdvga', 'usb', 'usbdevice', 'hpet', 'vnc',
- 'vncconsole', 'vncdisplay', 'vnclisten', 'timer_mode',
- 'vncpasswd', 'vncunused', 'xauthority', 'pci', 'vhpt',
- 'guest_os_type', 'hap']
+# Platform configuration keys and their types.
+XENAPI_PLATFORM_CFG_TYPES = {
+ 'acpi': int,
+ 'apic': int,
+ 'boot': str,
+ 'device_model': str,
+ 'loader': str,
+ 'display' : str,
+ 'fda': str,
+ 'fdb': str,
+ 'keymap': str,
+ 'isa' : int,
+ 'localtime': int,
+ 'monitor': int,
+ 'nographic': int,
+ 'pae' : int,
+ 'rtc_timeoffset': int,
+ 'serial': str,
+ 'sdl': int,
+ 'soundhw': str,
+ 'stdvga': int,
+ 'usb': int,
+ 'usbdevice': str,
+ 'hpet': int,
+ 'vnc': int,
+ 'vncconsole': int,
+ 'vncdisplay': int,
+ 'vnclisten': str,
+ 'timer_mode': int,
+ 'vncpasswd': str,
+ 'vncunused': int,
+ 'xauthority': str,
+ 'pci': str,
+ 'vhpt': int,
+ 'guest_os_type': str,
+ 'hap': int,
+}
# Xen API console 'other_config' keys.
XENAPI_CONSOLE_OTHER_CFG = ['vncunused', 'vncdisplay', 'vnclisten',
@@ -529,7 +558,7 @@ class XendConfig(dict):
cfg['platform']['localtime'] = localtime
# Compatibility hack -- can go soon.
- for key in XENAPI_PLATFORM_CFG:
+ for key in XENAPI_PLATFORM_CFG_TYPES.keys():
val = sxp.child_value(sxp_cfg, "platform_" + key, None)
if val is not None:
self['platform'][key] = val
@@ -708,7 +737,7 @@ class XendConfig(dict):
self.update_with_image_sxp(image_sxp)
# Convert Legacy HVM parameters to Xen API configuration
- for key in XENAPI_PLATFORM_CFG:
+ for key in XENAPI_PLATFORM_CFG_TYPES.keys():
if key in cfg:
self['platform'][key] = cfg[key]
@@ -758,7 +787,7 @@ class XendConfig(dict):
if image_type != 'hvm' and image_type != 'linux':
self['platform']['image_type'] = image_type
- for key in XENAPI_PLATFORM_CFG:
+ for key in XENAPI_PLATFORM_CFG_TYPES.keys():
val = sxp.child_value(image_sxp, key, None)
if val is not None and val != '':
self['platform'][key] = val
@@ -842,6 +871,19 @@ class XendConfig(dict):
self[key] = type_conv(val)
else:
self[key] = val
+
+ # XenAPI defines platform as a string-string map. If platform
+ # configuration exists, convert values to appropriate type.
+ if 'platform' in xapi:
+ for key, val in xapi['platform'].items():
+ type_conv = XENAPI_PLATFORM_CFG_TYPES.get(key)
+ if type_conv is None:
+ key = key.lower()
+ type_conv = XENAPI_PLATFORM_CFG_TYPES.get(key)
+ if callable(type_conv):
+ self['platform'][key] = type_conv(val)
+ else:
+ self['platform'][key] = val
self['vcpus_params']['weight'] = \
int(self['vcpus_params'].get('weight', 256))
@@ -1521,7 +1563,7 @@ class XendConfig(dict):
if self.has_key('PV_args') and self['PV_args']:
image.append(['args', self['PV_args']])
- for key in XENAPI_PLATFORM_CFG:
+ for key in XENAPI_PLATFORM_CFG_TYPES.keys():
if key in self['platform']:
image.append([key, self['platform'][key]])
@@ -1557,7 +1599,7 @@ class XendConfig(dict):
self['PV_ramdisk'] = sxp.child_value(image_sxp, 'ramdisk','')
self['PV_args'] = kernel_args
- for key in XENAPI_PLATFORM_CFG:
+ for key in XENAPI_PLATFORM_CFG_TYPES.keys():
val = sxp.child_value(image_sxp, key, None)
if val is not None and val != '':
self['platform'][key] = val

View File

@ -1,28 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1205852623 0
# Node ID 64b19db801b6ab63588e8fc767aa9c57bfc5a4aa
# Parent c978ecfc4f41a1dced268ff31f377156d392aaf2
p2m: hap enabled/supported fix
Check for per domain hap_enabled rather than hvm_funcs hap_supported,
in case hap has been disabled.
Alleviates problem booting >=4Gig shadow HVM guests on PAE hypervisor
on AMD-V platforms.
Signed-off-by: Tom Woller <thomas.woller@amd.com>
Index: xen-3.2.1-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/p2m.c
@@ -229,7 +229,7 @@ set_p2m_entry(struct domain *d, unsigned
if ( !p2m_next_level(d, &table_mfn, &table, &gfn_remainder, gfn,
L3_PAGETABLE_SHIFT - PAGE_SHIFT,
((CONFIG_PAGING_LEVELS == 3)
- ? (hvm_funcs.hap_supported ? 4 : 8)
+ ? (d->arch.hvm_domain.hap_enabled ? 4 : 8)
: L3_PAGETABLE_ENTRIES),
PGT_l2_page_table) )
goto out;

View File

@ -1,84 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1205922017 0
# Node ID 258c528c874f820a75abe932004433cbde0d3b3b
# Parent c69524c462ff8a8f7f44957d9012e28159b14d55
xend: Fix and improve default NUMA node selection.
Add the missing condition check and use average value instead of the
sum value of Vcpus pinning cpus on certain node to choose relaxed node.
Signed-off-by: Duan Ronghui <ronghui.duan@intel.com>
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1754,36 +1754,44 @@ class XendDomainInfo:
for v in range(0, self.info['VCPUs_max']):
xc.vcpu_setaffinity(self.domid, v, self.info['cpus'])
else:
+ def find_relaxed_node(node_list):
+ import sys
+ if node_list is None:
+ node_list = range(0, info['nr_nodes'])
+ nodeload = [0]
+ nodeload = nodeload * info['nr_nodes']
+ from xen.xend import XendDomain
+ doms = XendDomain.instance().list('all')
+ for dom in doms:
+ cpuinfo = dom.getVCPUInfo()
+ for vcpu in sxp.children(cpuinfo, 'vcpu'):
+ def vinfo(n, t):
+ return t(sxp.child_value(vcpu, n))
+ cpumap = vinfo('cpumap', list)
+ for i in node_list:
+ node_cpumask = info['node_to_cpu'][i]
+ for j in node_cpumask:
+ if j in cpumap:
+ nodeload[i] += 1
+ break
+ for i in node_list:
+ if len(info['node_to_cpu'][i]) > 0:
+ nodeload[i] = int(nodeload[i] / len(info['node_to_cpu'][i]))
+ else:
+ nodeload[i] = sys.maxint
+ index = nodeload.index( min(nodeload) )
+ return index
+
info = xc.physinfo()
if info['nr_nodes'] > 1:
node_memory_list = info['node_to_memory']
needmem = self.image.getRequiredAvailableMemory(self.info['memory_dynamic_max']) / 1024
candidate_node_list = []
for i in range(0, info['nr_nodes']):
- if node_memory_list[i] >= needmem:
+ if node_memory_list[i] >= needmem and len(info['node_to_cpu'][i]) > 0:
candidate_node_list.append(i)
- if candidate_node_list is None or len(candidate_node_list) == 1:
- index = node_memory_list.index( max(node_memory_list) )
- cpumask = info['node_to_cpu'][index]
- else:
- nodeload = [0]
- nodeload = nodeload * info['nr_nodes']
- from xen.xend import XendDomain
- doms = XendDomain.instance().list('all')
- for dom in doms:
- cpuinfo = dom.getVCPUInfo()
- for vcpu in sxp.children(cpuinfo, 'vcpu'):
- def vinfo(n, t):
- return t(sxp.child_value(vcpu, n))
- cpumap = vinfo('cpumap', list)
- for i in candidate_node_list:
- node_cpumask = info['node_to_cpu'][i]
- for j in node_cpumask:
- if j in cpumap:
- nodeload[i] += 1
- break
- index = nodeload.index( min(nodeload) )
- cpumask = info['node_to_cpu'][index]
+ index = find_relaxed_node(candidate_node_list)
+ cpumask = info['node_to_cpu'][index]
for v in range(0, self.info['VCPUs_max']):
xc.vcpu_setaffinity(self.domid, v, cpumask)

View File

@ -1,69 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1205922169 0
# Node ID 70f9a2110421cc6f4ce066eb80d4c639a28643bd
# Parent b8e3dbca1677e3fffeb8bf8baedc895c90d4e619
Intel VTD: Ignore USB RMRR for HVM guest
USB controller RMRR (0xed000 - 0xeffff) conflicts with HVM guest bios
region. Setting identity mapping for it will cover the guest bios
region in p2m table. This causes system crash.
As VT-d spec says, USB controller RMRR is used in case of DMA
performed by a USB controller under BIOS SMM control for legacy
keyboard emulation. Whereas, current guest BIOS doesn't support
emulating stardand Keyboard/mouse, and it also doesn't support SMM
mode. Actually it is no chance to use USB controller RMRR now.
This patch ignores the USB controller RMRR for HVM guest.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Index: xen-3.2-testing/xen/arch/x86/hvm/vmx/vtd/dmar.h
===================================================================
--- xen-3.2-testing.orig/xen/arch/x86/hvm/vmx/vtd/dmar.h
+++ xen-3.2-testing/xen/arch/x86/hvm/vmx/vtd/dmar.h
@@ -95,5 +95,6 @@ struct acpi_ioapic_unit {
int vtd_hw_check(void);
void disable_pmr(struct iommu *iommu);
+int is_usb_device(struct pci_dev *pdev);
#endif // _DMAR_H_
Index: xen-3.2-testing/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
===================================================================
--- xen-3.2-testing.orig/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
+++ xen-3.2-testing/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
@@ -1868,6 +1868,12 @@ int assign_device(struct domain *d, u8 b
for_each_rmrr_device( rmrr, pdev )
if ( pdev->bus == bus && pdev->devfn == devfn )
{
+ /* FIXME: Because USB RMRR conflicts with guest bios region,
+ * ignore USB RMRR temporarily.
+ */
+ if ( is_usb_device(pdev) )
+ return 0;
+
ret = iommu_prepare_rmrr_dev(d, rmrr, pdev);
if ( ret )
{
Index: xen-3.2-testing/xen/arch/x86/hvm/vmx/vtd/utils.c
===================================================================
--- xen-3.2-testing.orig/xen/arch/x86/hvm/vmx/vtd/utils.c
+++ xen-3.2-testing/xen/arch/x86/hvm/vmx/vtd/utils.c
@@ -38,6 +38,15 @@
#define SEABURG 0x4000
#define C_STEP 2
+int is_usb_device(struct pci_dev *pdev)
+{
+ u8 bus = pdev->bus;
+ u8 dev = PCI_SLOT(pdev->devfn);
+ u8 func = PCI_FUNC(pdev->devfn);
+ u16 class = read_pci_config_16(bus, dev, func, PCI_CLASS_DEVICE);
+ return (class == 0xc03);
+}
+
int vtd_hw_check(void)
{
u16 vendor, device;

View File

@ -1,302 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1206697850 0
# Node ID 50efc4b3ffdb7996ab58a4cb6d4d48fed197454f
# Parent 7a3702ff0e8c2c9783de6e24edd79203d5e4c070
ioemu: Perform emulated IDE flushes asynchronously.
Fixes 'Windows Bug Check 0x101 issue' in which a VCPU gets tied up for
so long doing a synchronous flush to disc that it misses critical
timer events.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Modified-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Index: xen-3.2.1-testing/tools/ioemu/block-qcow.c
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/block-qcow.c
+++ xen-3.2.1-testing/tools/ioemu/block-qcow.c
@@ -725,6 +725,13 @@ static void qcow_aio_cancel(BlockDriverA
qemu_aio_release(acb);
}
+static BlockDriverAIOCB *qcow_aio_flush(BlockDriverState *bs,
+ BlockDriverCompletionFunc *cb, void *opaque)
+{
+ BDRVQcowState *s = bs->opaque;
+ return bdrv_aio_flush(s->hd, cb, opaque);
+}
+
static void qcow_close(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
@@ -899,6 +906,7 @@ BlockDriver bdrv_qcow = {
.bdrv_aio_read = qcow_aio_read,
.bdrv_aio_write = qcow_aio_write,
.bdrv_aio_cancel = qcow_aio_cancel,
+ .bdrv_aio_flush = qcow_aio_flush,
.aiocb_size = sizeof(QCowAIOCB),
.bdrv_write_compressed = qcow_write_compressed,
.bdrv_get_info = qcow_get_info,
Index: xen-3.2.1-testing/tools/ioemu/block-qcow2.c
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/block-qcow2.c
+++ xen-3.2.1-testing/tools/ioemu/block-qcow2.c
@@ -1007,6 +1007,13 @@ static void qcow_aio_cancel(BlockDriverA
qemu_aio_release(acb);
}
+static BlockDriverAIOCB *qcow_aio_flush(BlockDriverState *bs,
+ BlockDriverCompletionFunc *cb, void *opaque)
+{
+ BDRVQcowState *s = bs->opaque;
+ return bdrv_aio_flush(s->hd, cb, opaque);
+}
+
static void qcow_close(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
@@ -2241,6 +2248,7 @@ BlockDriver bdrv_qcow2 = {
.bdrv_aio_read = qcow_aio_read,
.bdrv_aio_write = qcow_aio_write,
.bdrv_aio_cancel = qcow_aio_cancel,
+ .bdrv_aio_flush = qcow_aio_flush,
.aiocb_size = sizeof(QCowAIOCB),
.bdrv_write_compressed = qcow_write_compressed,
Index: xen-3.2.1-testing/tools/ioemu/block-raw.c
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/block-raw.c
+++ xen-3.2.1-testing/tools/ioemu/block-raw.c
@@ -496,6 +496,21 @@ static void raw_aio_cancel(BlockDriverAI
pacb = &acb->next;
}
}
+
+static BlockDriverAIOCB *raw_aio_flush(BlockDriverState *bs,
+ BlockDriverCompletionFunc *cb, void *opaque)
+{
+ RawAIOCB *acb;
+
+ acb = raw_aio_setup(bs, 0, NULL, 0, cb, opaque);
+ if (!acb)
+ return NULL;
+ if (aio_fsync(O_SYNC, &acb->aiocb) < 0) {
+ qemu_aio_release(acb);
+ return NULL;
+ }
+ return &acb->common;
+}
#endif
static void raw_close(BlockDriverState *bs)
@@ -621,6 +636,7 @@ BlockDriver bdrv_raw = {
.bdrv_aio_read = raw_aio_read,
.bdrv_aio_write = raw_aio_write,
.bdrv_aio_cancel = raw_aio_cancel,
+ .bdrv_aio_flush = raw_aio_flush,
.aiocb_size = sizeof(RawAIOCB),
#endif
.protocol_name = "file",
@@ -959,6 +975,7 @@ BlockDriver bdrv_host_device = {
.bdrv_aio_read = raw_aio_read,
.bdrv_aio_write = raw_aio_write,
.bdrv_aio_cancel = raw_aio_cancel,
+ .bdrv_aio_flush = raw_aio_flush,
.aiocb_size = sizeof(RawAIOCB),
#endif
.bdrv_pread = raw_pread,
Index: xen-3.2.1-testing/tools/ioemu/block.c
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/block.c
+++ xen-3.2.1-testing/tools/ioemu/block.c
@@ -48,6 +48,8 @@ static BlockDriverAIOCB *bdrv_aio_write_
int64_t sector_num, const uint8_t *buf, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque);
static void bdrv_aio_cancel_em(BlockDriverAIOCB *acb);
+static BlockDriverAIOCB *bdrv_aio_flush_em(BlockDriverState *bs,
+ BlockDriverCompletionFunc *cb, void *opaque);
static int bdrv_read_em(BlockDriverState *bs, int64_t sector_num,
uint8_t *buf, int nb_sectors);
static int bdrv_write_em(BlockDriverState *bs, int64_t sector_num,
@@ -155,6 +157,8 @@ void bdrv_register(BlockDriver *bdrv)
bdrv->bdrv_read = bdrv_read_em;
bdrv->bdrv_write = bdrv_write_em;
}
+ if (!bdrv->bdrv_aio_flush)
+ bdrv->bdrv_aio_flush = bdrv_aio_flush_em;
bdrv->next = first_drv;
first_drv = bdrv;
}
@@ -1138,6 +1142,17 @@ void bdrv_aio_cancel(BlockDriverAIOCB *a
drv->bdrv_aio_cancel(acb);
}
+BlockDriverAIOCB *bdrv_aio_flush(BlockDriverState *bs,
+ BlockDriverCompletionFunc *cb, void *opaque)
+{
+ BlockDriver *drv = bs->drv;
+
+ if (!drv)
+ return NULL;
+
+ return drv->bdrv_aio_flush(bs, cb, opaque);
+}
+
/**************************************************************/
/* async block device emulation */
@@ -1214,6 +1229,14 @@ static void bdrv_aio_cancel_em(BlockDriv
}
#endif /* !QEMU_TOOL */
+static BlockDriverAIOCB *bdrv_aio_flush_em(BlockDriverState *bs,
+ BlockDriverCompletionFunc *cb, void *opaque)
+{
+ bdrv_flush(bs);
+ cb(opaque, 0);
+ return NULL;
+}
+
/**************************************************************/
/* sync block device emulation */
Index: xen-3.2.1-testing/tools/ioemu/block_int.h
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/block_int.h
+++ xen-3.2.1-testing/tools/ioemu/block_int.h
@@ -49,6 +49,8 @@ struct BlockDriver {
int64_t sector_num, const uint8_t *buf, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque);
void (*bdrv_aio_cancel)(BlockDriverAIOCB *acb);
+ BlockDriverAIOCB *(*bdrv_aio_flush)(BlockDriverState *bs,
+ BlockDriverCompletionFunc *cb, void *opaque);
int aiocb_size;
const char *protocol_name;
Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/hw/ide.c
+++ xen-3.2.1-testing/tools/ioemu/hw/ide.c
@@ -742,6 +742,7 @@ static inline void ide_abort_command(IDE
static inline void ide_set_irq(IDEState *s)
{
BMDMAState *bm = s->bmdma;
+ if (!s->bs) return; /* yikes */
if (!(s->cmd & IDE_CMD_DISABLE_IRQ)) {
if (bm) {
bm->status |= BM_STATUS_INT;
@@ -907,6 +908,8 @@ static void ide_read_dma_cb(void *opaque
int n;
int64_t sector_num;
+ if (!s->bs) return; /* yikes */
+
n = s->io_buffer_size >> 9;
sector_num = ide_get_sector(s);
if (n > 0) {
@@ -1015,6 +1018,8 @@ static void ide_write_dma_cb(void *opaqu
int n;
int64_t sector_num;
+ if (!s->bs) return; /* yikes */
+
n = s->io_buffer_size >> 9;
sector_num = ide_get_sector(s);
if (n > 0) {
@@ -1063,6 +1068,39 @@ static void ide_sector_write_dma(IDEStat
ide_dma_start(s, ide_write_dma_cb);
}
+static void ide_device_utterly_broken(IDEState *s) {
+ s->status |= BUSY_STAT;
+ s->bs = NULL;
+ /* This prevents all future commands from working. All of the
+ * asynchronous callbacks (and ide_set_irq, as a safety measure)
+ * check to see whether this has happened and bail if so.
+ */
+}
+
+static void ide_flush_cb(void *opaque, int ret)
+{
+ IDEState *s = opaque;
+
+ if (!s->bs) return; /* yikes */
+
+ if (ret) {
+ /* We are completely doomed. The IDE spec does not permit us
+ * to return an error from a flush except via a protocol which
+ * requires us to say where the error is and which
+ * contemplates the guest repeating the flush attempt to
+ * attempt flush the remaining data. We can't support that
+ * because f(data)sync (which is what the block drivers use
+ * eventually) doesn't report the necessary information or
+ * give us the necessary control. So we make the disk vanish.
+ */
+ ide_device_utterly_broken(s);
+ return;
+ }
+ else
+ s->status = READY_STAT;
+ ide_set_irq(s);
+}
+
static void ide_atapi_cmd_ok(IDEState *s)
{
s->error = 0;
@@ -1289,6 +1327,8 @@ static void ide_atapi_cmd_read_dma_cb(vo
IDEState *s = bm->ide_if;
int data_offset, n;
+ if (!s->bs) return; /* yikes */
+
if (ret < 0) {
ide_atapi_io_error(s, ret);
goto eot;
@@ -1694,6 +1734,8 @@ static void cdrom_change_cb(void *opaque
IDEState *s = opaque;
int64_t nb_sectors;
+ if (!s->bs) return; /* yikes */
+
/* XXX: send interrupt too */
bdrv_get_geometry(s->bs, &nb_sectors);
s->nb_sectors = nb_sectors;
@@ -1797,8 +1839,8 @@ static void ide_ioport_write(void *opaqu
printf("ide: CMD=%02x\n", val);
#endif
s = ide_if->cur_drive;
- /* ignore commands to non existant slave */
- if (s != ide_if && !s->bs)
+ /* ignore commands to non existant device */
+ if (!s->bs)
break;
switch(val) {
@@ -1967,10 +2009,8 @@ static void ide_ioport_write(void *opaqu
break;
case WIN_FLUSH_CACHE:
case WIN_FLUSH_CACHE_EXT:
- if (s->bs)
- bdrv_flush(s->bs);
- s->status = READY_STAT;
- ide_set_irq(s);
+ s->status = BUSY_STAT;
+ bdrv_aio_flush(s->bs, ide_flush_cb, s);
break;
case WIN_IDLEIMMEDIATE:
case WIN_STANDBY:
Index: xen-3.2.1-testing/tools/ioemu/vl.h
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/vl.h
+++ xen-3.2.1-testing/tools/ioemu/vl.h
@@ -650,6 +650,8 @@ BlockDriverAIOCB *bdrv_aio_write(BlockDr
const uint8_t *buf, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque);
void bdrv_aio_cancel(BlockDriverAIOCB *acb);
+BlockDriverAIOCB *bdrv_aio_flush(BlockDriverState *bs,
+ BlockDriverCompletionFunc *cb, void *opaque);
void qemu_aio_init(void);
void qemu_aio_poll(void);

View File

@ -1,29 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1208871634 -3600
# Node ID 5355726f01b66565a55ef2201bebd283c1f9a384
# Parent 451ae3b8e5c82a9954f33c65bd4ba11337287e8d
x86/hvm: fix copy-and-paste mistakes
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/hvm.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/hvm.c
@@ -358,14 +358,14 @@ static int hvm_load_cpu_ctxt(struct doma
((ctxt.cr0 & (X86_CR0_PE|X86_CR0_PG)) == X86_CR0_PG) )
{
gdprintk(XENLOG_ERR, "HVM restore: bad CR0 0x%"PRIx64"\n",
- ctxt.msr_efer);
+ ctxt.cr0);
return -EINVAL;
}
if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS )
{
gdprintk(XENLOG_ERR, "HVM restore: bad CR4 0x%"PRIx64"\n",
- ctxt.msr_efer);
+ ctxt.cr4);
return -EINVAL;
}

View File

@ -1,25 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1208953978 -3600
# Node ID bc7ee2f93852b0ac1e644a5604dda223f12b8604
# Parent 08321f572e37747dd3fd53403996314e3179d6bf
x86: Fix a typo in shadow_get_and_create_l1e().
The typo is benign because sh_page_fault() gates the call to
shadow_get_and_create_l1e() on an equivalent test.
Signed-off-by: Tim Deegan <tim.deegan@citrix.com>
Index: xen-3.2.1-testing/xen/arch/x86/mm/shadow/multi.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/shadow/multi.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/shadow/multi.c
@@ -2006,7 +2006,7 @@ static shadow_l1e_t * shadow_get_and_cre
else
{
/* Shadowing an actual guest l1 table */
- if ( !mfn_valid(gw->l2mfn) ) return NULL; /* No guest page. */
+ if ( !mfn_valid(gw->l1mfn) ) return NULL; /* No guest page. */
*sl1mfn = get_shadow_status(v, gw->l1mfn, SH_type_l1_shadow);
if ( !mfn_valid(*sl1mfn) )
{

View File

@ -1,52 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1209631544 -3600
# Node ID 013a47065e8c4e815e3b1aba0883341c19238e82
# Parent 483d006cc60765357dcdb66ab0fc43c955ecd8fe
x86 time: Read platform time before locally-extrapolated time during
calibration and frequency changes. This places the variable delay
(acquiring the platform_timer_lock) safely as the very first thing we
do, avoiding a variable delay /between/ computing the two timestamps.
Problem diagnosed by Dave Winchell <dwinchell@virtualiron.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Index: xen-3.2.1-testing/xen/arch/x86/time.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/time.c
+++ xen-3.2.1-testing/xen/arch/x86/time.c
@@ -738,12 +738,13 @@ int cpu_frequency_change(u64 freq)
}
local_irq_disable();
- rdtscll(curr_tsc);
- t->local_tsc_stamp = curr_tsc;
+ /* Platform time /first/, as we may be delayed by platform_timer_lock. */
t->stime_master_stamp = read_platform_stime();
/* TSC-extrapolated time may be bogus after frequency change. */
/*t->stime_local_stamp = get_s_time();*/
t->stime_local_stamp = t->stime_master_stamp;
+ rdtscll(curr_tsc);
+ t->local_tsc_stamp = curr_tsc;
set_time_scale(&t->tsc_scale, freq);
local_irq_enable();
@@ -813,11 +814,14 @@ static void local_time_calibration(void
prev_local_stime = t->stime_local_stamp;
prev_master_stime = t->stime_master_stamp;
- /* Disable IRQs to get 'instantaneous' current timestamps. */
+ /*
+ * Disable IRQs to get 'instantaneous' current timestamps. We read platform
+ * time first, as we may be delayed when acquiring platform_timer_lock.
+ */
local_irq_disable();
- rdtscll(curr_tsc);
- curr_local_stime = get_s_time();
curr_master_stime = read_platform_stime();
+ curr_local_stime = get_s_time();
+ rdtscll(curr_tsc);
local_irq_enable();
#if 0

View File

@ -1,79 +0,0 @@
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1209632400 -3600
# Node ID 5e5bc5b2bb6d4d71c0de97c15448f2f991f4271d
# Parent 2cf9a8736babe63fe1783286f666c3d6fc9af58b
xemnstored: Fix xenstored abort when connection dropped.
If a connection is dropped with pending input and output data then the
connection will be dereferenced by both handle_input and handle_output
resulting in a double free when the main loop dereferences the
connection.
Fix this issue by taking/releasing a reference over the calls to
handle_input and handle_output separately and checking the result of
talloc_free to see if the connection went away.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Index: xen-3.2.1-testing/tools/xenstore/xenstored_core.c
===================================================================
--- xen-3.2.1-testing.orig/tools/xenstore/xenstored_core.c
+++ xen-3.2.1-testing/tools/xenstore/xenstored_core.c
@@ -1915,7 +1915,7 @@ int main(int argc, char *argv[])
/* Main loop. */
for (;;) {
- struct connection *conn, *old_conn;
+ struct connection *conn, *next;
if (select(max+1, &inset, &outset, NULL, timeout) < 0) {
if (errno == EINTR)
@@ -1939,27 +1939,39 @@ int main(int argc, char *argv[])
if (evtchn_fd != -1 && FD_ISSET(evtchn_fd, &inset))
handle_event();
- conn = list_entry(connections.next, typeof(*conn), list);
- while (&conn->list != &connections) {
- talloc_increase_ref_count(conn);
+ next = list_entry(connections.next, typeof(*conn), list);
+ while (&next->list != &connections) {
+ conn = next;
+
+ next = list_entry(conn->list.next,
+ typeof(*conn), list);
if (conn->domain) {
+ talloc_increase_ref_count(conn);
if (domain_can_read(conn))
handle_input(conn);
+ if (talloc_free(conn) == 0)
+ continue;
+
+ talloc_increase_ref_count(conn);
if (domain_can_write(conn) &&
!list_empty(&conn->out_list))
handle_output(conn);
+ if (talloc_free(conn) == 0)
+ continue;
} else {
+ talloc_increase_ref_count(conn);
if (FD_ISSET(conn->fd, &inset))
handle_input(conn);
+ if (talloc_free(conn) == 0)
+ continue;
+
+ talloc_increase_ref_count(conn);
if (FD_ISSET(conn->fd, &outset))
handle_output(conn);
+ if (talloc_free(conn) == 0)
+ continue;
}
-
- old_conn = conn;
- conn = list_entry(old_conn->list.next,
- typeof(*conn), list);
- talloc_free(old_conn);
}
max = initialize_set(&inset, &outset, *sock, *ro_sock,

View File

@ -1,11 +1,11 @@
bug #239173 bug #239173
bug #242953 bug #242953
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py +++ xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -2150,7 +2150,7 @@ class XendDomainInfo: @@ -2586,7 +2586,7 @@ class XendDomainInfo:
(fn, BOOTLOADER_LOOPBACK_DEVICE)) (fn, BOOTLOADER_LOOPBACK_DEVICE))
vbd = { vbd = {
@ -14,11 +14,11 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
'device': BOOTLOADER_LOOPBACK_DEVICE, 'device': BOOTLOADER_LOOPBACK_DEVICE,
} }
Index: xen-3.2.1-testing/tools/ioemu/xenstore.c Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/xenstore.c --- xen-3.3.0-testing.orig/tools/ioemu/xenstore.c
+++ xen-3.2.1-testing/tools/ioemu/xenstore.c +++ xen-3.3.0-testing/tools/ioemu/xenstore.c
@@ -88,9 +88,9 @@ void xenstore_parse_domain_config(int do @@ -85,9 +85,9 @@ void xenstore_parse_domain_config(int hv
{ {
char **e = NULL; char **e = NULL;
char *buf = NULL, *path; char *buf = NULL, *path;
@ -27,10 +27,10 @@ Index: xen-3.2.1-testing/tools/ioemu/xenstore.c
*dev = NULL, *params = NULL, *type = NULL, *drv = NULL; *dev = NULL, *params = NULL, *type = NULL, *drv = NULL;
- int i, is_scsi, is_hdN = 0; - int i, is_scsi, is_hdN = 0;
+ int i, is_scsi, is_tap, is_hdN = 0; + int i, is_scsi, is_tap, is_hdN = 0;
unsigned int len, num, hd_index; unsigned int len, num, hd_index, pci_devid = 0;
BlockDriverState *bs; BlockDriverState *bs;
BlockDriver *format;
@@ -118,6 +118,14 @@ void xenstore_parse_domain_config(int do @@ -122,6 +122,14 @@ void xenstore_parse_domain_config(int hv
bpath = xs_read(xsh, XBT_NULL, buf, &len); bpath = xs_read(xsh, XBT_NULL, buf, &len);
if (bpath == NULL) if (bpath == NULL)
continue; continue;
@ -45,7 +45,7 @@ Index: xen-3.2.1-testing/tools/ioemu/xenstore.c
/* read the name of the device */ /* read the name of the device */
if (pasprintf(&buf, "%s/dev", bpath) == -1) if (pasprintf(&buf, "%s/dev", bpath) == -1)
continue; continue;
@@ -262,6 +270,7 @@ void xenstore_parse_domain_config(int do @@ -364,6 +372,7 @@ void xenstore_parse_domain_config(int hv
free(type); free(type);
free(params); free(params);
free(dev); free(dev);

View File

@ -0,0 +1,55 @@
Index: xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/drivers/blktapctrl.c
+++ xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
@@ -503,6 +503,7 @@ static int launch_tapdisk_provider(char
return child;
}
+#if 0
static int launch_tapdisk(char *wrctldev, char *rdctldev)
{
char *argv[] = { "tapdisk", wrctldev, rdctldev, NULL };
@@ -512,6 +513,7 @@ static int launch_tapdisk(char *wrctldev
return 0;
}
+#endif
static int launch_tapdisk_ioemu(void)
{
@@ -583,6 +585,7 @@ static int connect_qemu(blkif_t *blkif,
return 0;
}
+#if 0
/* Launch tapdisk instance */
static int connect_tapdisk(blkif_t *blkif, int minor)
{
@@ -626,6 +629,7 @@ fail:
return ret;
}
+#endif
int blktapctrl_new_blkif(blkif_t *blkif)
{
@@ -650,6 +654,7 @@ int blktapctrl_new_blkif(blkif_t *blkif)
blkif->cookie = next_cookie++;
if (!exist) {
+#if 0
if (type == DISK_TYPE_IOEMU) {
if (connect_qemu(blkif, blkif->domid))
goto fail;
@@ -657,6 +662,10 @@ int blktapctrl_new_blkif(blkif_t *blkif)
if (connect_tapdisk(blkif, minor))
goto fail;
}
+#else
+ if (connect_qemu(blkif, blkif->domid))
+ goto fail;
+#endif
} else {
DPRINTF("Process exists!\n");

View File

@ -1,7 +1,7 @@
Index: xen-3.2.1-testing/tools/python/xen/xend/server/HalDaemon.py Index: xen-3.3.0-testing/tools/python/xen/xend/server/HalDaemon.py
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2.1-testing/tools/python/xen/xend/server/HalDaemon.py +++ xen-3.3.0-testing/tools/python/xen/xend/server/HalDaemon.py
@@ -0,0 +1,238 @@ @@ -0,0 +1,238 @@
+#!/usr/bin/env python +#!/usr/bin/env python
+# -*- mode: python; -*- +# -*- mode: python; -*-
@ -241,10 +241,10 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/server/HalDaemon.py
+ print 'Falling off end' + print 'Falling off end'
+ +
+ +
Index: xen-3.2.1-testing/tools/python/xen/xend/server/Hald.py Index: xen-3.3.0-testing/tools/python/xen/xend/server/Hald.py
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2.1-testing/tools/python/xen/xend/server/Hald.py +++ xen-3.3.0-testing/tools/python/xen/xend/server/Hald.py
@@ -0,0 +1,125 @@ @@ -0,0 +1,125 @@
+#============================================================================ +#============================================================================
+# This library is free software; you can redistribute it and/or +# This library is free software; you can redistribute it and/or
@ -371,10 +371,10 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/server/Hald.py
+ watcher.run() + watcher.run()
+ time.sleep(10) + time.sleep(10)
+ watcher.shutdown() + watcher.shutdown()
Index: xen-3.2.1-testing/tools/python/xen/xend/server/SrvServer.py Index: xen-3.3.0-testing/tools/python/xen/xend/server/SrvServer.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/server/SrvServer.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/server/SrvServer.py
+++ xen-3.2.1-testing/tools/python/xen/xend/server/SrvServer.py +++ xen-3.3.0-testing/tools/python/xen/xend/server/SrvServer.py
@@ -56,6 +56,7 @@ from xen.web.SrvDir import SrvDir @@ -56,6 +56,7 @@ from xen.web.SrvDir import SrvDir
from SrvRoot import SrvRoot from SrvRoot import SrvRoot
@ -392,14 +392,14 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/server/SrvServer.py
def create(): def create():
root = SrvDir() root = SrvDir()
Index: xen-3.2.1-testing/tools/ioemu/xenstore.c Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/xenstore.c --- xen-3.3.0-testing.orig/tools/ioemu/xenstore.c
+++ xen-3.2.1-testing/tools/ioemu/xenstore.c +++ xen-3.3.0-testing/tools/ioemu/xenstore.c
@@ -232,6 +232,16 @@ void xenstore_parse_domain_config(int do @@ -230,6 +230,16 @@ void xenstore_parse_domain_config(int hv
fprintf(stderr, "qemu: could not open hard disk image '%s'\n", */
params); waitForDevice(params);
} }
+ /* if pyhsical CDROM put a watch on media-present after creating it */ + /* if pyhsical CDROM put a watch on media-present after creating it */
+ if (type && !strcmp(type, "cdrom") && drv && !strcmp(drv, "phy")) { + if (type && !strcmp(type, "cdrom") && drv && !strcmp(drv, "phy")) {
+ if (pasprintf(&buf, "%s/media-present", bpath) != -1) { + if (pasprintf(&buf, "%s/media-present", bpath) != -1) {
@ -410,11 +410,11 @@ Index: xen-3.2.1-testing/tools/ioemu/xenstore.c
+ xs_watch(xsh, buf, "media-present"); + xs_watch(xsh, buf, "media-present");
+ } + }
+ } + }
} }
/* Set a watch for log-dirty requests from the migration tools */ bs = bs_table[hd_index + (is_scsi ? MAX_DISKS : 0)] = bdrv_new(dev);
@@ -425,6 +435,50 @@ void xenstore_record_dm_state(char *stat @@ -566,6 +576,50 @@ void xenstore_record_dm_state(char *stat
free(path); xenstore_record_dm("state", state);
} }
+void xenstore_process_media_change_event(char **vec) +void xenstore_process_media_change_event(char **vec)
@ -464,7 +464,7 @@ Index: xen-3.2.1-testing/tools/ioemu/xenstore.c
void xenstore_process_event(void *opaque) void xenstore_process_event(void *opaque)
{ {
char **vec, *offset, *bpath = NULL, *buf = NULL, *drv = NULL, *image = NULL; char **vec, *offset, *bpath = NULL, *buf = NULL, *drv = NULL, *image = NULL;
@@ -444,6 +498,11 @@ void xenstore_process_event(void *opaque @@ -585,6 +639,11 @@ void xenstore_process_event(void *opaque
goto out; goto out;
} }
@ -476,22 +476,22 @@ Index: xen-3.2.1-testing/tools/ioemu/xenstore.c
if (strncmp(vec[XS_WATCH_TOKEN], "hd", 2) || if (strncmp(vec[XS_WATCH_TOKEN], "hd", 2) ||
strlen(vec[XS_WATCH_TOKEN]) != 3) strlen(vec[XS_WATCH_TOKEN]) != 3)
goto out; goto out;
Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c Index: xen-3.3.0-testing/tools/ioemu/hw/ide.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/hw/ide.c --- xen-3.3.0-testing.orig/tools/ioemu/hw/ide.c
+++ xen-3.2.1-testing/tools/ioemu/hw/ide.c +++ xen-3.3.0-testing/tools/ioemu/hw/ide.c
@@ -350,6 +350,7 @@ typedef struct IDEState { @@ -361,6 +361,7 @@ typedef struct IDEState {
uint8_t io_buffer[MAX_MULT_SECTORS*512 + 4]; uint8_t *io_buffer;
QEMUTimer *sector_write_timer; /* only used for win2k instal hack */ QEMUTimer *sector_write_timer; /* only used for win2k instal hack */
uint32_t irq_count; /* counts IRQs when using win2k install hack */ uint32_t irq_count; /* counts IRQs when using win2k install hack */
+ uint8_t send_ua; /* send SENSE_UNIT_ATTENTION on next ready */ + uint8_t send_ua; /* send SENSE_UNIT_ATTENTION on next ready */
} IDEState; } IDEState;
#define BM_STATUS_DMAING 0x01 #define BM_STATUS_DMAING 0x01
@@ -1446,8 +1447,15 @@ static void ide_atapi_cmd(IDEState *s) @@ -1462,8 +1463,15 @@ static void ide_atapi_cmd(IDEState *s)
switch(s->io_buffer[0]) { ASC_MEDIUM_MAY_HAVE_CHANGED);
case GPCMD_TEST_UNIT_READY: break;
if (bdrv_is_inserted(s->bs)) { }
+ if (s->send_ua) { + if (s->send_ua) {
+ ide_atapi_cmd_error(s, SENSE_UNIT_ATTENTION, + ide_atapi_cmd_error(s, SENSE_UNIT_ATTENTION,
+ ASC_MEDIUM_NOT_PRESENT); + ASC_MEDIUM_NOT_PRESENT);

View File

@ -13,16 +13,15 @@ Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
tools/Makefile | 2 +- tools/Makefile | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-) 2 files changed, 5 insertions(+), 3 deletions(-)
Index: xen-3.2-testing/config/x86_32.mk Index: xen-3.3.0-testing/config/x86_32.mk
=================================================================== ===================================================================
--- xen-3.2-testing.orig/config/x86_32.mk --- xen-3.3.0-testing.orig/config/x86_32.mk
+++ xen-3.2-testing/config/x86_32.mk +++ xen-3.3.0-testing/config/x86_32.mk
@@ -7,8 +7,10 @@ CONFIG_MIGRATE := y @@ -7,7 +7,10 @@ CONFIG_MIGRATE := y
CONFIG_XCUTILS := y CONFIG_XCUTILS := y
CONFIG_IOEMU := y CONFIG_IOEMU := y
-CFLAGS += -m32 -march=i686 -CFLAGS += -m32 -march=i686
-LIBDIR := lib
+CFLAGS += -m32 -march=i686 +CFLAGS += -m32 -march=i686
+LDFLAGS += -m32 +LDFLAGS += -m32
+ASFLAGS += -m32 +ASFLAGS += -m32
@ -30,16 +29,16 @@ Index: xen-3.2-testing/config/x86_32.mk
# Use only if calling $(LD) directly. # Use only if calling $(LD) directly.
LDFLAGS_DIRECT_OpenBSD = _obsd LDFLAGS_DIRECT_OpenBSD = _obsd
Index: xen-3.2-testing/tools/Makefile Index: xen-3.3.0-testing/tools/Makefile
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/Makefile --- xen-3.3.0-testing.orig/tools/Makefile
+++ xen-3.2-testing/tools/Makefile +++ xen-3.3.0-testing/tools/Makefile
@@ -63,7 +63,7 @@ check_clean: @@ -23,7 +23,7 @@ SUBDIRS-y += blktap
$(MAKE) -C check clean SUBDIRS-y += libfsimage
SUBDIRS-$(LIBXENAPI_BINDINGS) += libxen
.PHONY: ioemu ioemuinstall ioemuclean -ifeq (ioemu,$(CONFIG_QEMU))
-ifeq ($(CONFIG_IOEMU),y)
+ifeq ($(XEN_COMPILE_ARCH)$(CONFIG_IOEMU),$(XEN_TARGET_ARCH)y) +ifeq ($(XEN_COMPILE_ARCH)$(CONFIG_IOEMU),$(XEN_TARGET_ARCH)y)
export IOEMU_DIR ?= ioemu SUBDIRS-$(CONFIG_IOEMU) += ioemu
ioemu ioemuinstall: else
[ -f $(IOEMU_DIR)/config-host.mak ] || \ SUBDIRS-$(CONFIG_IOEMU) += ioemu-dir

View File

@ -1,672 +0,0 @@
Index: xen-3.2.1-testing/tools/libxc/xc_hvm_build.c
===================================================================
--- xen-3.2.1-testing.orig/tools/libxc/xc_hvm_build.c
+++ xen-3.2.1-testing/tools/libxc/xc_hvm_build.c
@@ -208,26 +208,47 @@ static int setup_guest(int xc_handle,
for ( i = HVM_BELOW_4G_RAM_END >> PAGE_SHIFT; i < nr_pages; i++ )
page_array[i] += HVM_BELOW_4G_MMIO_LENGTH >> PAGE_SHIFT;
- /*
- * Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000.
- * We allocate pages in batches of no more than 2048 to ensure that
- * we can be preempted and hence dom0 remains responsive.
+ /* Allocate memory for HVM guest:
+ * 1) skip VGA hole 0xA0000-0xC0000;
+ * 2) Allocate 4K pages for the first 2M guest memory;
+ * 3) try to allocate 2M pages for the left guest memory, or use 4k pages;
*/
rc = xc_domain_memory_populate_physmap(
xc_handle, dom, 0xa0, 0, 0, &page_array[0x00]);
cur_pages = 0xc0;
- while ( (rc == 0) && (nr_pages > cur_pages) )
+ while ( (rc == 0) && (0x200 > cur_pages) )
{
- unsigned long count = nr_pages - cur_pages;
+ unsigned long count = 0x200 - cur_pages;
if ( count > 2048 )
count = 2048;
rc = xc_domain_memory_populate_physmap(
xc_handle, dom, count, 0, 0, &page_array[cur_pages]);
cur_pages += count;
}
+
+ if ( rc != 0 )
+ {
+ PERROR("Cannot allocate memory for HVM guest 1.\n");
+ goto error_out;
+ }
+
+ /* Allocate 2M pages */
+ for ( i = 0x200; (i + 0x1ff) < nr_pages; i += 0x200 )
+ {
+ rc = xc_domain_memory_populate_physmap(
+ xc_handle, dom, 1, 9, 0, &page_array[i]);
+ if ( rc != 0 )
+ {
+ PERROR("Cannot allocate more 2M pages for HVM guest.\n");
+ break;
+ }
+ }
+ if ( i < nr_pages )
+ rc = xc_domain_memory_populate_physmap(
+ xc_handle, dom, nr_pages - i, 0, 0, &page_array[i]);
if ( rc != 0 )
{
- PERROR("Could not allocate memory for HVM guest.\n");
+ PERROR("Cannot allocate memory for HVM guest 2.\n");
goto error_out;
}
Index: xen-3.2.1-testing/xen/arch/ia64/xen/mm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/ia64/xen/mm.c
+++ xen-3.2.1-testing/xen/arch/ia64/xen/mm.c
@@ -2416,7 +2416,7 @@ steal_page(struct domain *d, struct page
int
guest_physmap_add_page(struct domain *d, unsigned long gpfn,
- unsigned long mfn)
+ unsigned long mfn, int order)
{
BUG_ON(!mfn_valid(mfn));
BUG_ON(mfn_to_page(mfn)->count_info != (PGC_allocated | 1));
@@ -2433,7 +2433,7 @@ guest_physmap_add_page(struct domain *d,
void
guest_physmap_remove_page(struct domain *d, unsigned long gpfn,
- unsigned long mfn)
+ unsigned long mfn, int order)
{
BUG_ON(mfn == 0);//XXX
zap_domain_page_one(d, gpfn << PAGE_SHIFT, 0, mfn);
@@ -2836,7 +2836,7 @@ arch_memory_op(int op, XEN_GUEST_HANDLE(
if (prev_mfn && mfn_valid(prev_mfn)) {
if (is_xen_heap_mfn(prev_mfn))
/* Xen heap frames are simply unhooked from this phys slot. */
- guest_physmap_remove_page(d, xatp.gpfn, prev_mfn);
+ guest_physmap_remove_page(d, xatp.gpfn, prev_mfn, 0);
else
/* Normal domain memory is freed, to avoid leaking memory. */
guest_remove_page(d, xatp.gpfn);
@@ -2845,10 +2845,10 @@ arch_memory_op(int op, XEN_GUEST_HANDLE(
/* Unmap from old location, if any. */
gpfn = get_gpfn_from_mfn(mfn);
if (gpfn != INVALID_M2P_ENTRY)
- guest_physmap_remove_page(d, gpfn, mfn);
+ guest_physmap_remove_page(d, gpfn, mfn, 0);
/* Map at new location. */
- guest_physmap_add_page(d, xatp.gpfn, mfn);
+ guest_physmap_add_page(d, xatp.gpfn, mfn, 0);
out:
UNLOCK_BIGLOCK(d);
Index: xen-3.2.1-testing/xen/arch/powerpc/mm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/powerpc/mm.c
+++ xen-3.2.1-testing/xen/arch/powerpc/mm.c
@@ -591,7 +591,7 @@ void guest_physmap_add_page(
}
void guest_physmap_remove_page(
- struct domain *d, unsigned long gpfn, unsigned long mfn)
+ struct domain *d, unsigned long gpfn, unsigned long mfn, int order)
{
if (page_get_owner(mfn_to_page(mfn)) != d) {
printk("Won't unmap foreign MFN 0x%lx for DOM%d\n", mfn, d->domain_id);
Index: xen-3.2.1-testing/xen/arch/x86/mm.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm.c
+++ xen-3.2.1-testing/xen/arch/x86/mm.c
@@ -3376,7 +3376,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
{
if ( is_xen_heap_mfn(prev_mfn) )
/* Xen heap frames are simply unhooked from this phys slot. */
- guest_physmap_remove_page(d, xatp.gpfn, prev_mfn);
+ guest_physmap_remove_page(d, xatp.gpfn, prev_mfn, 0);
else
/* Normal domain memory is freed, to avoid leaking memory. */
guest_remove_page(d, xatp.gpfn);
@@ -3385,10 +3385,10 @@ long arch_memory_op(int op, XEN_GUEST_HA
/* Unmap from old location, if any. */
gpfn = get_gpfn_from_mfn(mfn);
if ( gpfn != INVALID_M2P_ENTRY )
- guest_physmap_remove_page(d, gpfn, mfn);
+ guest_physmap_remove_page(d, gpfn, mfn, 0);
/* Map at new location. */
- guest_physmap_add_page(d, xatp.gpfn, mfn);
+ guest_physmap_add_page(d, xatp.gpfn, mfn, 0);
UNLOCK_BIGLOCK(d);
Index: xen-3.2.1-testing/xen/arch/x86/mm/p2m-ept.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/p2m-ept.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/p2m-ept.c
@@ -20,6 +20,7 @@
#include <xen/domain_page.h>
#include <xen/sched.h>
#include <asm/current.h>
+#include <asm/paging.h>
#include <asm/types.h>
#include <asm/domain.h>
#include <asm/hvm/vmx/vmx.h>
@@ -53,7 +54,6 @@ static int ept_next_level(struct domain
u32 index;
index = *gfn_remainder >> shift;
- *gfn_remainder &= (1UL << shift) - 1;
ept_entry = (*table) + index;
@@ -80,31 +80,51 @@ static int ept_next_level(struct domain
/* last step */
ept_entry->r = ept_entry->w = ept_entry->x = 1;
}
-
- next = map_domain_page(ept_entry->mfn);
- unmap_domain_page(*table);
- *table = next;
-
- return 1;
+ if ( !ept_entry->sp_avail )
+ {
+ *gfn_remainder &= (1UL << shift) - 1;
+ next = map_domain_page(ept_entry->mfn);
+ unmap_domain_page(*table);
+ *table = next;
+ return 1;
+ }
+ else
+ return 2;
}
+#define GUEST_TABLE_SUPER_PAGE 2
static int
-ept_set_entry(struct domain *d, unsigned long gfn, mfn_t mfn, p2m_type_t p2mt)
+ept_set_entry(struct domain *d, unsigned long gfn, mfn_t mfn, int order, p2m_type_t p2mt)
{
ept_entry_t *table =
map_domain_page(mfn_x(pagetable_get_mfn(d->arch.phys_table)));
- unsigned long gfn_remainder = gfn;
+ unsigned long gfn_remainder = gfn, offset = 0;
ept_entry_t *ept_entry;
u32 index;
- int i, rv = 0;
+ int i, rv = 0, ret = 0;
+ int walk_level = order / EPT_TABLE_ORDER;
+
+ ASSERT(table != NULL);
/* should check if gfn obeys GAW here */
- for ( i = EPT_DEFAULT_GAW; i > 0; i-- )
- if ( !ept_next_level(d, 0, &table, &gfn_remainder, i * EPT_TABLE_ORDER) )
+ if ( order != 0 )
+ if ( (gfn & ((1UL << order) - 1)) )
+ return 1;
+ for ( i = EPT_DEFAULT_GAW; i > walk_level; i-- )
+ {
+ ret = ept_next_level(d, 0, &table,
+ &gfn_remainder, i * EPT_TABLE_ORDER);
+ if ( !ret )
goto out;
+ else if ( ret == GUEST_TABLE_SUPER_PAGE )
+ break;
+ }
+
+ index = gfn_remainder >> ( i ? (i * EPT_TABLE_ORDER): order);
+ walk_level = ( i ? ( i * EPT_TABLE_ORDER) : order) / EPT_TABLE_ORDER;
+ offset = (gfn_remainder & ( ((1 << (i*EPT_TABLE_ORDER)) - 1)));
- index = gfn_remainder;
ept_entry = table + index;
if ( mfn_valid(mfn_x(mfn)) )
@@ -114,9 +134,20 @@ ept_set_entry(struct domain *d, unsigned
d->arch.p2m.max_mapped_pfn = gfn;
ept_entry->emt = EPT_DEFAULT_MT;
- ept_entry->sp_avail = 0;
+ ept_entry->sp_avail = walk_level ? 1 : 0;
+
+ if ( ret == 2)
+ {
+ ept_entry->mfn = mfn_x(mfn) - offset;
+ if ( ept_entry->avail1 == p2m_ram_logdirty &&
+ p2mt == p2m_ram_rw )
+ for ( i = 0; i < 512; i++ )
+ paging_mark_dirty(d, mfn_x(mfn)-offset+i);
+ }
+ else
+ ept_entry->mfn = mfn_x(mfn);
+
ept_entry->avail1 = p2mt;
- ept_entry->mfn = mfn_x(mfn);
ept_entry->rsvd = 0;
ept_entry->avail2 = 0;
/* last step */
@@ -144,7 +175,7 @@ static mfn_t ept_get_entry(struct domain
unsigned long gfn_remainder = gfn;
ept_entry_t *ept_entry;
u32 index;
- int i;
+ int i, ret=0;
mfn_t mfn = _mfn(INVALID_MFN);
*t = p2m_mmio_dm;
@@ -156,16 +187,30 @@ static mfn_t ept_get_entry(struct domain
/* should check if gfn obeys GAW here */
for ( i = EPT_DEFAULT_GAW; i > 0; i-- )
- if ( !ept_next_level(d, 1, &table, &gfn_remainder, i * EPT_TABLE_ORDER) )
+ {
+ ret = ept_next_level(d, 1, &table, &gfn_remainder, i * EPT_TABLE_ORDER);
+ if ( ret == 0 )
goto out;
+ else if ( ret == 2 )
+ break;
+ }
- index = gfn_remainder;
+ index = gfn_remainder >> ( i * EPT_TABLE_ORDER);
ept_entry = table + index;
if ( ept_entry->avail1 != p2m_invalid )
{
*t = ept_entry->avail1;
mfn = _mfn(ept_entry->mfn);
+ if ( i )
+ {
+ /* we may meet super pages, and to split into 4k pages
+ * to emulate p2m table
+ */
+ unsigned long split_mfn =
+ mfn_x(mfn) + (gfn_remainder & ( ((1 << (i*EPT_TABLE_ORDER)) - 1 )));
+ mfn = _mfn(split_mfn);
+ }
}
out:
@@ -195,18 +240,24 @@ static void ept_change_entry_type_global
l4e = map_domain_page(mfn_x(pagetable_get_mfn(d->arch.phys_table)));
for (i4 = 0; i4 < EPT_PAGETABLE_ENTRIES; i4++ )
{
- if ( !(l4e+i4)->epte || (l4e+i4)->sp_avail)
+ if ( !(l4e+i4)->epte )
continue;
+ if ( !(l4e+i4)->sp_avail )
+ {
l3e = map_domain_page((l4e+i4)->mfn);
for ( i3 = 0; i3 < EPT_PAGETABLE_ENTRIES; i3++ )
{
- if ( !(l3e+i3)->epte || (l3e+i3)->sp_avail )
+ if ( !(l3e+i3)->epte )
continue;
+ if ( !(l3e+i3)->sp_avail )
+ {
l2e = map_domain_page((l3e+i3)->mfn);
for ( i2 = 0; i2 < EPT_PAGETABLE_ENTRIES; i2++ )
{
- if ( !(l2e+i2)->epte || (l2e+i2)->sp_avail )
+ if ( !(l2e+i2)->epte )
continue;
+ if ( !(l2e+i2)->sp_avail )
+ {
l1e = map_domain_page((l2e+i2)->mfn);
for ( i1 = 0; i1 < EPT_PAGETABLE_ENTRIES; i1++ )
{
@@ -218,10 +269,34 @@ static void ept_change_entry_type_global
ept_p2m_type_to_flags(l1e+i1, nt);
}
unmap_domain_page(l1e);
+ }
+ else
+ {
+ if ( (l2e+i2)->avail1 != ot )
+ continue;
+ (l2e+i2)->avail1 = nt;
+ ept_p2m_type_to_flags(l2e+i2, nt);
+ }
}
unmap_domain_page(l2e);
+ }
+ else
+ {
+ if ( (l3e+i3)->avail1 != ot )
+ continue;
+ (l3e+i3)->avail1 = nt;
+ ept_p2m_type_to_flags(l3e+i3, nt);
+ }
}
unmap_domain_page(l3e);
+ }
+ else
+ {
+ if ( (l4e+i4)->avail1 != ot )
+ continue;
+ (l4e+i4)->avail1 = nt;
+ ept_p2m_type_to_flags(l4e+i4, nt);
+ }
}
unmap_domain_page(l4e);
Index: xen-3.2.1-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/p2m.c
@@ -203,7 +203,7 @@ p2m_next_level(struct domain *d, mfn_t *
// Returns 0 on error (out of memory)
static int
-p2m_set_entry(struct domain *d, unsigned long gfn, mfn_t mfn, p2m_type_t p2mt)
+p2m_set_entry(struct domain *d, unsigned long gfn, mfn_t mfn, int order, p2m_type_t p2mt)
{
// XXX -- this might be able to be faster iff current->domain == d
mfn_t table_mfn = pagetable_get_mfn(d->arch.phys_table);
@@ -293,9 +293,9 @@ void p2m_change_entry_type_global(struct
}
static inline
-int set_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn, p2m_type_t p2mt)
+int set_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn, int order, p2m_type_t p2mt)
{
- return d->arch.p2m.set_entry(d, gfn, mfn, p2mt);
+ return d->arch.p2m.set_entry(d, gfn, mfn, order, p2mt);
}
// Allocate a new p2m table for a domain.
@@ -357,7 +357,7 @@ int p2m_alloc_table(struct domain *d,
P2M_PRINTK("populating p2m table\n");
/* Initialise physmap tables for slot zero. Other code assumes this. */
- if ( !set_p2m_entry(d, 0, _mfn(INVALID_MFN), p2m_invalid) )
+ if ( !set_p2m_entry(d, 0, _mfn(INVALID_MFN), 0, p2m_invalid) )
goto error;
/* Copy all existing mappings from the page list and m2p */
@@ -376,7 +376,7 @@ int p2m_alloc_table(struct domain *d,
(gfn != 0x55555555L)
#endif
&& gfn != INVALID_M2P_ENTRY
- && !set_p2m_entry(d, gfn, mfn, p2m_ram_rw) )
+ && !set_p2m_entry(d, gfn, mfn, 0, p2m_ram_rw) )
goto error;
}
@@ -690,30 +690,31 @@ static void audit_p2m(struct domain *d)
static void
-p2m_remove_page(struct domain *d, unsigned long gfn, unsigned long mfn)
+p2m_remove_page(struct domain *d, unsigned long gfn, unsigned long mfn, int order)
{
if ( !paging_mode_translate(d) )
return;
P2M_DEBUG("removing gfn=%#lx mfn=%#lx\n", gfn, mfn);
- set_p2m_entry(d, gfn, _mfn(INVALID_MFN), p2m_invalid);
+ set_p2m_entry(d, gfn, _mfn(INVALID_MFN), order, p2m_invalid);
set_gpfn_from_mfn(mfn, INVALID_M2P_ENTRY);
}
void
guest_physmap_remove_page(struct domain *d, unsigned long gfn,
- unsigned long mfn)
+ unsigned long mfn, int order)
{
p2m_lock(d);
audit_p2m(d);
- p2m_remove_page(d, gfn, mfn);
+ for ( int i = 0; i < ( 1<< order); i++ )
+ p2m_remove_page(d, gfn+i, mfn+i, order);
audit_p2m(d);
p2m_unlock(d);
}
int
guest_physmap_add_entry(struct domain *d, unsigned long gfn,
- unsigned long mfn, p2m_type_t t)
+ unsigned long mfn, int order, p2m_type_t t)
{
unsigned long ogfn;
p2m_type_t ot;
@@ -764,13 +765,13 @@ guest_physmap_add_entry(struct domain *d
P2M_DEBUG("old gfn=%#lx -> mfn %#lx\n",
ogfn , mfn_x(omfn));
if ( mfn_x(omfn) == mfn )
- p2m_remove_page(d, ogfn, mfn);
+ p2m_remove_page(d, ogfn, mfn, order);
}
}
if ( mfn_valid(_mfn(mfn)) )
{
- if ( !set_p2m_entry(d, gfn, _mfn(mfn), t) )
+ if ( !set_p2m_entry(d, gfn, _mfn(mfn), order, t) )
rc = -EINVAL;
set_gpfn_from_mfn(mfn, gfn);
}
@@ -778,7 +779,7 @@ guest_physmap_add_entry(struct domain *d
{
gdprintk(XENLOG_WARNING, "Adding bad mfn to p2m map (%#lx -> %#lx)\n",
gfn, mfn);
- if ( !set_p2m_entry(d, gfn, _mfn(INVALID_MFN), p2m_invalid) )
+ if ( !set_p2m_entry(d, gfn, _mfn(INVALID_MFN), order, p2m_invalid) )
rc = -EINVAL;
}
@@ -898,7 +899,7 @@ p2m_type_t p2m_change_type(struct domain
mfn = gfn_to_mfn(d, gfn, &pt);
if ( pt == ot )
- set_p2m_entry(d, gfn, mfn, nt);
+ set_p2m_entry(d, gfn, mfn, 0, nt);
p2m_unlock(d);
@@ -922,7 +923,7 @@ set_mmio_p2m_entry(struct domain *d, uns
set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
}
- rc = set_p2m_entry(d, gfn, mfn, p2m_mmio_direct);
+ rc = set_p2m_entry(d, gfn, mfn, 0, p2m_mmio_direct);
if ( 0 == rc )
gdprintk(XENLOG_ERR,
"set_mmio_p2m_entry: set_p2m_entry failed! mfn=%08lx\n",
@@ -946,7 +947,7 @@ clear_mmio_p2m_entry(struct domain *d, u
"clear_mmio_p2m_entry: gfn_to_mfn failed! gfn=%08lx\n", gfn);
return 0;
}
- rc = set_p2m_entry(d, gfn, _mfn(INVALID_MFN), 0);
+ rc = set_p2m_entry(d, gfn, _mfn(INVALID_MFN), 0, 0);
return rc;
}
Index: xen-3.2.1-testing/xen/common/grant_table.c
===================================================================
--- xen-3.2.1-testing.orig/xen/common/grant_table.c
+++ xen-3.2.1-testing/xen/common/grant_table.c
@@ -1154,7 +1154,7 @@ gnttab_transfer(
spin_lock(&e->grant_table->lock);
sha = &shared_entry(e->grant_table, gop.ref);
- guest_physmap_add_page(e, sha->frame, mfn);
+ guest_physmap_add_page(e, sha->frame, mfn, 0);
sha->frame = mfn;
wmb();
sha->flags |= GTF_transfer_completed;
Index: xen-3.2.1-testing/xen/common/memory.c
===================================================================
--- xen-3.2.1-testing.orig/xen/common/memory.c
+++ xen-3.2.1-testing/xen/common/memory.c
@@ -113,8 +113,11 @@ static void populate_physmap(struct memo
goto out;
}
- if ( unlikely(__copy_from_guest_offset(&gpfn, a->extent_list, i, 1)) )
+ if ( unlikely(__copy_from_guest_offset(&gpfn, a->extent_list, i << a->extent_order, 1)) )
+ {
+ printk("copy_from_guest failed.\n");
goto out;
+ }
page = __alloc_domheap_pages(d, cpu, a->extent_order, a->memflags);
if ( unlikely(page == NULL) )
@@ -129,11 +132,7 @@ static void populate_physmap(struct memo
mfn = page_to_mfn(page);
if ( unlikely(paging_mode_translate(d)) )
- {
- for ( j = 0; j < (1 << a->extent_order); j++ )
- if ( guest_physmap_add_page(d, gpfn + j, mfn + j) )
- goto out;
- }
+ guest_physmap_add_page(d, gpfn, mfn, a->extent_order);
else
{
for ( j = 0; j < (1 << a->extent_order); j++ )
@@ -175,7 +174,7 @@ int guest_remove_page(struct domain *d,
if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
put_page(page);
- guest_physmap_remove_page(d, gmfn, mfn);
+ guest_physmap_remove_page(d, gmfn, mfn, 0);
put_page(page);
@@ -416,7 +415,7 @@ static long memory_exchange(XEN_GUEST_HA
if ( !test_and_clear_bit(_PGC_allocated, &page->count_info) )
BUG();
mfn = page_to_mfn(page);
- guest_physmap_remove_page(d, mfn_to_gmfn(d, mfn), mfn);
+ guest_physmap_remove_page(d, mfn_to_gmfn(d, mfn), mfn, 0);
put_page(page);
}
@@ -438,8 +437,7 @@ static long memory_exchange(XEN_GUEST_HA
if ( unlikely(paging_mode_translate(d)) )
{
/* Ignore failure here. There's nothing we can do. */
- for ( k = 0; k < (1UL << exch.out.extent_order); k++ )
- (void)guest_physmap_add_page(d, gpfn + k, mfn + k);
+ (void)guest_physmap_add_page(d, gpfn, mfn, exch.out.extent_order);
}
else
{
Index: xen-3.2.1-testing/xen/include/asm-ia64/grant_table.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-ia64/grant_table.h
+++ xen-3.2.1-testing/xen/include/asm-ia64/grant_table.h
@@ -13,7 +13,7 @@ int create_grant_host_mapping(unsigned l
int replace_grant_host_mapping(unsigned long gpaddr, unsigned long mfn, unsigned long new_gpaddr, unsigned int flags);
// for grant transfer
-int guest_physmap_add_page(struct domain *d, unsigned long gpfn, unsigned long mfn);
+int guest_physmap_add_page(struct domain *d, unsigned long gpfn, unsigned long mfn, int order);
/* XXX
* somewhere appropriate
Index: xen-3.2.1-testing/xen/include/asm-ia64/shadow.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-ia64/shadow.h
+++ xen-3.2.1-testing/xen/include/asm-ia64/shadow.h
@@ -40,8 +40,10 @@
* Utilities to change relationship of gpfn->mfn for designated domain,
* which is required by gnttab transfer, balloon, device model and etc.
*/
-int guest_physmap_add_page(struct domain *d, unsigned long gpfn, unsigned long mfn);
-void guest_physmap_remove_page(struct domain *d, unsigned long gpfn, unsigned long mfn);
+int guest_physmap_add_page(struct domain *d, unsigned long gpfn,
+ unsigned long mfn, int order);
+void guest_physmap_remove_page(struct domain *d, unsigned long gpfn,
+ unsigned long mfn, int order);
static inline int
shadow_mode_enabled(struct domain *d)
Index: xen-3.2.1-testing/xen/include/asm-powerpc/mm.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-powerpc/mm.h
+++ xen-3.2.1-testing/xen/include/asm-powerpc/mm.h
@@ -278,9 +278,9 @@ extern int steal_page(struct domain *d,
extern int guest_physmap_max_mem_pages(struct domain *d, unsigned long new_max);
extern void guest_physmap_add_page(
- struct domain *d, unsigned long gpfn, unsigned long mfn);
+ struct domain *d, unsigned long gpfn, unsigned long mfn, int order);
extern void guest_physmap_remove_page(
- struct domain *d, unsigned long gpfn, unsigned long mfn);
+ struct domain *d, unsigned long gpfn, unsigned long mfn, int order);
#endif
Index: xen-3.2.1-testing/xen/include/asm-x86/domain.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/domain.h
+++ xen-3.2.1-testing/xen/include/asm-x86/domain.h
@@ -166,7 +166,7 @@ struct p2m_domain {
void (*free_page )(struct domain *d,
struct page_info *pg);
int (*set_entry )(struct domain *d, unsigned long gfn,
- mfn_t mfn, p2m_type_t p2mt);
+ mfn_t mfn, int order, p2m_type_t p2mt);
mfn_t (*get_entry )(struct domain *d, unsigned long gfn,
p2m_type_t *p2mt);
mfn_t (*get_entry_fast)(unsigned long gfn, p2m_type_t *p2mt);
Index: xen-3.2.1-testing/xen/include/asm-x86/p2m.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/p2m.h
+++ xen-3.2.1-testing/xen/include/asm-x86/p2m.h
@@ -191,21 +191,32 @@ void p2m_teardown(struct domain *d);
/* Add a page to a domain's p2m table */
int guest_physmap_add_entry(struct domain *d, unsigned long gfn,
- unsigned long mfn, p2m_type_t t);
+ unsigned long mfn, int order, p2m_type_t t);
/* Untyped version for RAM only, for compatibility
*
* Return 0 for success
*/
static inline int guest_physmap_add_page(struct domain *d, unsigned long gfn,
- unsigned long mfn)
+ unsigned long mfn, int order)
{
- return guest_physmap_add_entry(d, gfn, mfn, p2m_ram_rw);
+ int ret;
+
+ for ( int i = 0; i < (1 << order); i++ )
+ {
+ ret = guest_physmap_add_entry(d, gfn+i, mfn+i, order, p2m_ram_rw);
+ if ( ret != 0 )
+ break;
+ }
+
+ /* TODO: fix exit path when failure */
+
+ return ret;
}
/* Remove a page from a domain's p2m table */
void guest_physmap_remove_page(struct domain *d, unsigned long gfn,
- unsigned long mfn);
+ unsigned long mfn, int order);
/* Change types across all p2m entries in a domain */
void p2m_change_type_global(struct domain *d, p2m_type_t ot, p2m_type_t nt);
Index: xen-3.2.1-testing/xen/include/xen/paging.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/xen/paging.h
+++ xen-3.2.1-testing/xen/include/xen/paging.h
@@ -18,8 +18,8 @@
#else
#define paging_mode_translate(d) (0)
-#define guest_physmap_add_page(d, p, m) (0)
-#define guest_physmap_remove_page(d, p, m) ((void)0)
+#define guest_physmap_add_page(d, p, m, order) (0)
+#define guest_physmap_remove_page(d, p, m, order) ((void)0)
#endif

View File

@ -1,122 +0,0 @@
Index: xen-3.2.1-testing/xen/arch/x86/mm/p2m-ept.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/p2m-ept.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/p2m-ept.c
@@ -23,6 +23,27 @@
#include <asm/types.h>
#include <asm/domain.h>
#include <asm/hvm/vmx/vmx.h>
+#include <asm/hap.h>
+
+static void ept_p2m_type_to_flags(ept_entry_t *entry, p2m_type_t type)
+{
+ switch(type)
+ {
+ case p2m_invalid:
+ case p2m_mmio_dm:
+ default:
+ return;
+ case p2m_ram_rw:
+ case p2m_mmio_direct:
+ entry->r = entry->w = entry->x = 1;
+ return;
+ case p2m_ram_logdirty:
+ case p2m_ram_ro:
+ entry->r = entry->x = 1;
+ entry->w = 0;
+ return;
+ }
+}
static int ept_next_level(struct domain *d, bool_t read_only,
ept_entry_t **table, unsigned long *gfn_remainder,
@@ -100,6 +121,7 @@ ept_set_entry(struct domain *d, unsigned
ept_entry->avail2 = 0;
/* last step */
ept_entry->r = ept_entry->w = ept_entry->x = 1;
+ ept_p2m_type_to_flags(ept_entry, p2mt);
}
else
ept_entry->epte = 0;
@@ -140,13 +162,10 @@ static mfn_t ept_get_entry(struct domain
index = gfn_remainder;
ept_entry = table + index;
- if ( (ept_entry->epte & 0x7) == 0x7 )
+ if ( ept_entry->avail1 != p2m_invalid )
{
- if ( ept_entry->avail1 != p2m_invalid )
- {
- *t = ept_entry->avail1;
- mfn = _mfn(ept_entry->mfn);
- }
+ *t = ept_entry->avail1;
+ mfn = _mfn(ept_entry->mfn);
}
out:
@@ -159,11 +178,64 @@ static mfn_t ept_get_entry_fast(unsigned
return ept_get_entry(current->domain, gfn, t);
}
+/* Walk the whole p2m table, changing any entries of the old type
+ * to the new type. This is used in hardware-assisted paging to
+ * quickly enable or diable log-dirty tracking */
+
+static void ept_change_entry_type_global(struct domain *d, p2m_type_t ot, p2m_type_t nt)
+{
+ if ( pagetable_get_pfn(d->arch.phys_table) == 0 )
+ return;
+
+ if ( EPT_DEFAULT_GAW == 3 )
+ {
+ ept_entry_t *l4e, *l3e, *l2e, *l1e;
+ int i4, i3, i2, i1;
+
+ l4e = map_domain_page(mfn_x(pagetable_get_mfn(d->arch.phys_table)));
+ for (i4 = 0; i4 < EPT_PAGETABLE_ENTRIES; i4++ )
+ {
+ if ( !(l4e+i4)->epte || (l4e+i4)->sp_avail)
+ continue;
+ l3e = map_domain_page((l4e+i4)->mfn);
+ for ( i3 = 0; i3 < EPT_PAGETABLE_ENTRIES; i3++ )
+ {
+ if ( !(l3e+i3)->epte || (l3e+i3)->sp_avail )
+ continue;
+ l2e = map_domain_page((l3e+i3)->mfn);
+ for ( i2 = 0; i2 < EPT_PAGETABLE_ENTRIES; i2++ )
+ {
+ if ( !(l2e+i2)->epte || (l2e+i2)->sp_avail )
+ continue;
+ l1e = map_domain_page((l2e+i2)->mfn);
+ for ( i1 = 0; i1 < EPT_PAGETABLE_ENTRIES; i1++ )
+ {
+ if ( !(l1e+i1)->epte )
+ continue;
+ if ( (l1e+i1)->avail1 != ot )
+ continue;
+ (l1e+i1)->avail1 = nt;
+ ept_p2m_type_to_flags(l1e+i1, nt);
+ }
+ unmap_domain_page(l1e);
+ }
+ unmap_domain_page(l2e);
+ }
+ unmap_domain_page(l3e);
+ }
+ unmap_domain_page(l4e);
+
+ if ( d->vcpu[0] )
+ ept_sync_domain(d->vcpu[0]);
+ }
+}
+
void ept_p2m_init(struct domain *d)
{
d->arch.p2m.set_entry = ept_set_entry;
d->arch.p2m.get_entry = ept_get_entry;
d->arch.p2m.get_entry_fast = ept_get_entry_fast;
+ d->arch.p2m.change_entry_type_global = ept_change_entry_type_global;
}
/*

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +0,0 @@
Index: xen-3.2-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-3.2-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-3.2-testing/xen/arch/x86/mm/p2m.c
@@ -281,7 +281,8 @@ void p2m_init(struct domain *d)
d->arch.p2m.get_entry_fast = p2m_gfn_to_mfn_fast;
d->arch.p2m.change_entry_type_global = p2m_change_type_global;
- if ( is_hvm_domain(d) )
+ if ( is_hvm_domain(d) && hvm_funcs.hap_supported &&
+ (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) )
hvm_p2m_init(d);
}

View File

@ -0,0 +1,73 @@
Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/xen_blktap.c
+++ xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
@@ -349,6 +349,15 @@ static void qemu_send_responses(void* op
}
/**
+ * Callback function for AIO flush
+ */
+static void qemu_flush_response(void* opaque, int ret) {
+ if (ret != 0) {
+ DPRINTF("aio_flush: ret = %d (%s)\n", ret, strerror(-ret));
+ }
+}
+
+/**
* Callback function for the IO message pipe. Reads requests from the ring
* and processes them (call qemu read/write functions).
*
@@ -367,6 +376,7 @@ static void handle_blktap_iomsg(void* pr
blkif_t *blkif = s->blkif;
tapdev_info_t *info = s->ring_info;
int page_size = getpagesize();
+ int sync;
struct aiocb_info *aiocb_info;
@@ -399,7 +409,7 @@ static void handle_blktap_iomsg(void* pr
/* Don't allow writes on readonly devices */
if ((s->flags & TD_RDONLY) &&
- (req->operation == BLKIF_OP_WRITE)) {
+ (req->operation != BLKIF_OP_READ)) {
blkif->pending_list[idx].status = BLKIF_RSP_ERROR;
goto send_response;
}
@@ -420,7 +430,7 @@ static void handle_blktap_iomsg(void* pr
DPRINTF("Sector request failed:\n");
DPRINTF("%s request, idx [%d,%d] size [%llu], "
"sector [%llu,%llu]\n",
- (req->operation == BLKIF_OP_WRITE ?
+ (req->operation != BLKIF_OP_READ ?
"WRITE" : "READ"),
idx,i,
(long long unsigned)
@@ -433,8 +443,14 @@ static void handle_blktap_iomsg(void* pr
blkif->pending_list[idx].secs_pending += nsects;
- switch (req->operation)
+ sync = 0;
+ switch (req->operation)
{
+ case BLKIF_OP_WRITE_BARRIER:
+ sync = 1;
+ bdrv_aio_flush(s->bs, qemu_flush_response, NULL);
+ /* fall through */
+
case BLKIF_OP_WRITE:
aiocb_info = malloc(sizeof(*aiocb_info));
@@ -454,6 +470,10 @@ static void handle_blktap_iomsg(void* pr
DPRINTF("ERROR: bdrv_write() == NULL\n");
goto send_response;
}
+
+ if (sync)
+ bdrv_aio_flush(s->bs, qemu_flush_response, NULL);
+
break;
case BLKIF_OP_READ:

View File

@ -0,0 +1,120 @@
Index: xen-3.3.0-testing/tools/blktap/drivers/tapdisk.h
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/drivers/tapdisk.h
+++ xen-3.3.0-testing/tools/blktap/drivers/tapdisk.h
@@ -159,16 +159,6 @@ extern struct tap_disk tapdisk_ram;
extern struct tap_disk tapdisk_qcow;
extern struct tap_disk tapdisk_qcow2;
-#define MAX_DISK_TYPES 20
-
-#define DISK_TYPE_AIO 0
-#define DISK_TYPE_SYNC 1
-#define DISK_TYPE_VMDK 2
-#define DISK_TYPE_RAM 3
-#define DISK_TYPE_QCOW 4
-#define DISK_TYPE_QCOW2 5
-#define DISK_TYPE_IOEMU 6
-
/*Define Individual Disk Parameters here */
static disk_info_t aio_disk = {
Index: xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/lib/blktaplib.h
+++ xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
@@ -205,6 +205,17 @@ typedef struct msg_pid {
#define CTLMSG_PID 9
#define CTLMSG_PID_RSP 10
+/* disk driver types */
+#define MAX_DISK_TYPES 20
+
+#define DISK_TYPE_AIO 0
+#define DISK_TYPE_SYNC 1
+#define DISK_TYPE_VMDK 2
+#define DISK_TYPE_RAM 3
+#define DISK_TYPE_QCOW 4
+#define DISK_TYPE_QCOW2 5
+#define DISK_TYPE_IOEMU 6
+
/* xenstore/xenbus: */
#define DOMNAME "Domain-0"
int setup_probe_watch(struct xs_handle *h);
Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/xen_blktap.c
+++ xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
@@ -218,21 +218,34 @@ static int map_new_dev(struct td_state *
return -1;
}
-static int open_disk(struct td_state *s, char *path, int readonly)
+static int open_disk(struct td_state *s, char *path, int driver, int readonly)
{
struct disk_id id;
BlockDriverState* bs;
-
-#ifndef QEMU_TOOL
+ BlockDriver* drv;
int i;
-#endif
DPRINTF("Opening %s\n", path);
bs = bdrv_new("blktap");
memset(&id, 0, sizeof(struct disk_id));
- if (bdrv_open(bs, path, 0) != 0) {
+ /* Search for disk driver */
+ for (i = 0; blktap_drivers[i].idnum >= 0; i++) {
+ if (blktap_drivers[i].idnum == driver)
+ break;
+ }
+
+ if (blktap_drivers[i].idnum < 0) {
+ fprintf(stderr, "Could not find image format id %d\n", driver);
+ return -ENOMEM;
+ }
+
+ drv = blktap_drivers[i].drv;
+ DPRINTF("%s driver specified\n", drv ? drv->format_name : "No");
+
+ /* Open the image */
+ if (bdrv_open2(bs, path, 0, drv) != 0) {
fprintf(stderr, "Could not open image file %s\n", path);
return -ENOMEM;
}
@@ -524,7 +537,7 @@ static void handle_blktap_ctrlmsg(void*
s = state_init();
/*Open file*/
- if (s == NULL || open_disk(s, path, msg->readonly)) {
+ if (s == NULL || open_disk(s, path, msg->drivertype, msg->readonly)) {
msglen = sizeof(msg_hdr_t);
msg->type = CTLMSG_IMG_FAIL;
msg->len = msglen;
Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.h
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/xen_blktap.h
+++ xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.h
@@ -54,4 +54,19 @@ typedef struct fd_list_entry {
struct fd_list_entry **pprev, *next;
} fd_list_entry_t;
+typedef struct disk_info {
+ int idnum;
+ struct BlockDriver *drv;
+} disk_info_t;
+
+static disk_info_t blktap_drivers[] = {
+ { DISK_TYPE_AIO, &bdrv_raw },
+ { DISK_TYPE_SYNC, &bdrv_raw },
+ { DISK_TYPE_VMDK, &bdrv_vmdk },
+ { DISK_TYPE_QCOW, &bdrv_qcow },
+ { DISK_TYPE_QCOW2, &bdrv_qcow2 },
+ { DISK_TYPE_IOEMU, NULL },
+ { -1, NULL }
+};
+
#endif /*XEN_BLKTAP_H_*/

View File

@ -0,0 +1,108 @@
Index: xen-3.3.0-testing/tools/ioemu/block-qcow2.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/block-qcow2.c
+++ xen-3.3.0-testing/tools/ioemu/block-qcow2.c
@@ -808,6 +808,8 @@ static void qcow_aio_read_cb(void *opaqu
BlockDriverState *bs = acb->common.bs;
BDRVQcowState *s = bs->opaque;
int index_in_cluster, n1;
+ uint64_t next;
+ int n;
acb->hd_aiocb = NULL;
if (ret < 0) {
@@ -846,11 +848,22 @@ static void qcow_aio_read_cb(void *opaqu
acb->cluster_offset = get_cluster_offset(bs, acb->sector_num << 9,
0, 0, 0, 0);
index_in_cluster = acb->sector_num & (s->cluster_sectors - 1);
- acb->n = s->cluster_sectors - index_in_cluster;
- if (acb->n > acb->nb_sectors)
- acb->n = acb->nb_sectors;
if (!acb->cluster_offset) {
+ /* seek how many clusters we must read from the base image */
+ n = s->cluster_sectors;
+ while (n < acb->nb_sectors + index_in_cluster) {
+ next = get_cluster_offset(bs, (acb->sector_num + n) << 9,
+ 0, 0, 0, 0);
+ if (next)
+ break;
+ n += s->cluster_sectors;
+ }
+ n -= index_in_cluster;
+ if (n > acb->nb_sectors)
+ n = acb->nb_sectors;
+ acb->n = n;
+
if (bs->backing_hd) {
/* read from the base image */
n1 = backing_read1(bs->backing_hd, acb->sector_num,
@@ -869,6 +882,9 @@ static void qcow_aio_read_cb(void *opaqu
goto redo;
}
} else if (acb->cluster_offset & QCOW_OFLAG_COMPRESSED) {
+ acb->n = s->cluster_sectors - index_in_cluster;
+ if (acb->n > acb->nb_sectors)
+ acb->n = acb->nb_sectors;
/* add AIO support for compressed blocks ? */
if (decompress_cluster(s, acb->cluster_offset) < 0)
goto fail;
@@ -880,6 +896,22 @@ static void qcow_aio_read_cb(void *opaqu
ret = -EIO;
goto fail;
}
+
+ /* seek how many clusters we can read */
+
+ n = s->cluster_sectors;
+ while (n < acb->nb_sectors + index_in_cluster) {
+ next = get_cluster_offset(bs, (acb->sector_num + n) << 9,
+ 0, 0, 0, 0);
+ if (next != acb->cluster_offset + (n << 9))
+ break;
+ n += s->cluster_sectors;
+ }
+ n -= index_in_cluster;
+ if (n > acb->nb_sectors)
+ n = acb->nb_sectors;
+ acb->n = n;
+
acb->hd_aiocb = bdrv_aio_read(s->hd,
(acb->cluster_offset >> 9) + index_in_cluster,
acb->buf, acb->n, qcow_aio_read_cb, acb);
@@ -928,6 +960,9 @@ static void qcow_aio_write_cb(void *opaq
int index_in_cluster;
uint64_t cluster_offset;
const uint8_t *src_buf;
+ uint64_t next;
+ int n;
+ int alloc;
acb->hd_aiocb = NULL;
@@ -972,6 +1007,25 @@ static void qcow_aio_write_cb(void *opaq
acb->n, 1, &s->aes_encrypt_key);
src_buf = acb->cluster_data;
} else {
+
+ /* seek how many clusters we can write */
+
+ n = s->cluster_sectors;
+ while(n < acb->nb_sectors + index_in_cluster) {
+ alloc = s->cluster_sectors;
+ if (n + alloc > acb->nb_sectors + index_in_cluster)
+ alloc = acb->nb_sectors + index_in_cluster - n;
+ next = get_cluster_offset(bs, (acb->sector_num + n) << 9,
+ 1, 0, 0, alloc);
+ if (next != cluster_offset + (n << 9))
+ break;
+ n += alloc;
+ }
+ n -= index_in_cluster;
+ if (n > acb->nb_sectors)
+ n = acb->nb_sectors;
+ acb->n = n;
+
src_buf = acb->buf;
}
acb->hd_aiocb = bdrv_aio_write(s->hd,

View File

@ -1,13 +0,0 @@
Index: xen-3.2-testing/tools/ioemu/vnc.c
===================================================================
--- xen-3.2-testing.orig/tools/ioemu/vnc.c 2008-04-17 11:43:50.000000000 -0600
+++ xen-3.2-testing/tools/ioemu/vnc.c 2008-04-17 11:46:34.000000000 -0600
@@ -1133,6 +1133,8 @@
case 0x9d: /* Right CTRL */
case 0x38: /* Left ALT */
case 0xb8: /* Right ALT */
+ if (keycode & 0x80)
+ kbd_put_keycode(0xe0);
if (down) {
vs->modifiers_state[keycode] = 1;
kbd_put_keycode(keycode & 0x7f);

View File

@ -1,22 +0,0 @@
Index: xen-3.2-testing/tools/ioemu/vnc.c
===================================================================
--- xen-3.2-testing.orig/tools/ioemu/vnc.c 2008-01-16 13:19:03.000000000 -0700
+++ xen-3.2-testing/tools/ioemu/vnc.c 2008-04-04 13:12:52.000000000 -0600
@@ -1181,13 +1181,14 @@
if (is_graphic_console()) {
/* If the shift state needs to change then simulate an additional
- keypress before sending this one.
+ keypress before sending this one. Ignore for escape key, need to
+ enhance for other non shiftable keys.
*/
- if (shift && !shift_keys) {
+ if (shift && !shift_keys && keycode != 1) {
press_key_shift_down(vs, down, keycode);
return;
}
- else if (!shift && shift_keys) {
+ else if (!shift && shift_keys && keycode != 1) {
press_key_shift_up(vs, down, keycode);
return;
}

View File

@ -1,8 +1,8 @@
Index: xen-3.2.1-testing/tools/python/xen/xend/image.py Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/image.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.2.1-testing/tools/python/xen/xend/image.py +++ xen-3.3.0-testing/tools/python/xen/xend/image.py
@@ -194,12 +194,16 @@ class ImageHandler: @@ -261,6 +261,8 @@ class ImageHandler:
ret.append('-nographic') ret.append('-nographic')
return ret return ret
@ -11,6 +11,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/image.py
vnc_config = {} vnc_config = {}
has_vnc = int(vmConfig['platform'].get('vnc', 0)) != 0 has_vnc = int(vmConfig['platform'].get('vnc', 0)) != 0
has_sdl = int(vmConfig['platform'].get('sdl', 0)) != 0 has_sdl = int(vmConfig['platform'].get('sdl', 0)) != 0
@@ -268,6 +270,8 @@ class ImageHandler:
for dev_uuid in vmConfig['console_refs']: for dev_uuid in vmConfig['console_refs']:
dev_type, dev_info = vmConfig['devices'][dev_uuid] dev_type, dev_info = vmConfig['devices'][dev_uuid]
if dev_type == 'vfb': if dev_type == 'vfb':
@ -19,7 +20,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/image.py
vfb_type = dev_info.get('type', {}) vfb_type = dev_info.get('type', {})
if vfb_type == 'sdl': if vfb_type == 'sdl':
self.display = dev_info.get('display', {}) self.display = dev_info.get('display', {})
@@ -210,7 +214,6 @@ class ImageHandler: @@ -279,7 +283,6 @@ class ImageHandler:
has_vnc = True has_vnc = True
break break

View File

@ -1,78 +0,0 @@
Index: xen-3.2-testing/tools/ioemu/keymaps/nl-be
===================================================================
--- xen-3.2-testing.orig/tools/ioemu/keymaps/nl-be
+++ xen-3.2-testing/tools/ioemu/keymaps/nl-be
@@ -1,6 +1,72 @@
# Dutch (Belgium)
-map 0x813
include common
+map 0x813
+ampersand 0x02
+1 0x02 shift
+bar 0x02 altgr
+eacute 0x03
+2 0x03 shift
+at 0x03 altgr
+quotedbl 0x04
+3 0x04 shift
+numbersign 0x04 altgr
+apostrophe 0x05
+4 0x05 shift
+parenleft 0x06
+5 0x06 shift
+section 0x07
+6 0x07 shift
+circumflex 0x07 altgr
+egrave 0x08
+7 0x08 shift
+exclam 0x09
+8 0x09 shift
+bracketleft 0x09 altgr
+ccedilla 0x0a
+9 0x0a shift
+braceleft 0x0a altgr
+agrave 0x0b
+0 0x0b shift
+braceright 0x0b altgr
+parenright 0x0c
+degree 0x0c shift
+minus 0x0d
+underscore 0x0d shift
+a 0x10 addupper
+z 0x11 addupper
+EuroSign 0x12 altgr
+dead_circumflex 0x1a
+dead_diaeresis 0x1a shift
+bracketleft 0x1a altgr
+dollar 0x1b
+asterisk 0x1b shift
+bracketright 0x1b altgr
+q 0x1e addupper
+m 0x27 addupper
+ugrave 0x28
+percent 0x28 shift
+dead_acute 0x28 altgr
+twosuperior 0x29
+threesuperior 0x29 shift
+mu 0x2b
+sterling 0x2b shift
+dead_grave 0x2b altgr
+w 0x2c addupper
+comma 0x32
+question 0x32 shift
+semicolon 0x33
+period 0x33 shift
+colon 0x34
+slash 0x34 shift
+periodcentered 0x34 altgr
+equal 0x35
+plus 0x35 shift
+tilde 0x35 altgr
+dead_tilde 0x35 shift altgr
+less 0x56
+greater 0x56 shift
+backslash 0x56 altgr
+
ampersand 0x02
1 0x02 shift
bar 0x02 altgr

View File

@ -1,8 +1,8 @@
Index: xen-3.0.5-testing/tools/libxen/src/xen_common.c Index: xen-3.3.0-testing/tools/libxen/src/xen_common.c
=================================================================== ===================================================================
--- xen-3.0.5-testing.orig/tools/libxen/src/xen_common.c --- xen-3.3.0-testing.orig/tools/libxen/src/xen_common.c
+++ xen-3.0.5-testing/tools/libxen/src/xen_common.c +++ xen-3.3.0-testing/tools/libxen/src/xen_common.c
@@ -899,8 +899,15 @@ static void parse_into(xen_session *s, x @@ -902,8 +902,15 @@ static void parse_into(xen_session *s, x
0 != strcmp((char *)value_node->children->name, "struct") || 0 != strcmp((char *)value_node->children->name, "struct") ||
value_node->children->children == NULL) value_node->children->children == NULL)
{ {

View File

@ -1,209 +0,0 @@
Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmx.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/vmx/vmx.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmx.c
@@ -49,6 +49,7 @@
#include <asm/hvm/vpt.h>
#include <public/hvm/save.h>
#include <asm/hvm/trace.h>
+#include <asm/hap.h>
enum handler_return { HNDL_done, HNDL_unhandled, HNDL_exception_raised };
@@ -2854,9 +2855,44 @@ void vmx_wbinvd_intercept(void)
static void ept_handle_violation(unsigned long qualification, paddr_t gpa)
{
- if ( unlikely(((qualification >> 7) & 0x3) != 0x3) )
+ unsigned long gla_validity = qualification & EPT_GLA_VALIDITY_MASK;
+ struct domain *d = current->domain;
+ u64 gfn = gpa >> PAGE_SHIFT;
+ mfn_t mfn;
+ p2m_type_t t;
+
+ /* GPA exceeds GAW. */
+ if ( unlikely(qualification & EPT_GAW_VIOLATION) )
{
- domain_crash(current->domain);
+ printk("EPT violation: guest physical address %"PRIpaddr" exceeded "
+ "its width limit.\n", gpa);
+ domain_crash(d);
+ }
+
+ if ( gla_validity == EPT_GLA_VALIDITY_RSVD ||
+ gla_validity == EPT_GLA_VALIDITY_PDPTR_LOAD )
+ {
+ printk("ept violation: reserved bit or pdptr load violation.\n");
+ domain_crash(d);
+ }
+
+ mfn = gfn_to_mfn(d, gfn, &t);
+
+ if ( unlikely( gla_validity != EPT_GLA_VALIDITY_MATCH) )
+ {
+ if ( p2m_is_ram(t) && paging_mode_log_dirty(d) )
+ goto mark_dirty;
+ domain_crash(d);
+ return;
+ }
+
+mark_dirty:
+
+ if ( p2m_is_ram(t) && paging_mode_log_dirty(d) )
+ {
+ paging_mark_dirty(d, mfn_x(mfn));
+ p2m_change_type(d, gfn, p2m_ram_logdirty, p2m_ram_rw);
+ flush_tlb_mask(d->domain_dirty_cpumask);
return;
}
Index: xen-3.2.1-testing/xen/arch/x86/mm/hap/hap.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/hap/hap.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/hap/hap.c
@@ -61,7 +61,7 @@ int hap_enable_log_dirty(struct domain *
hap_unlock(d);
/* set l1e entries of P2M table to be read-only. */
- p2m_change_type_global(d, p2m_ram_rw, p2m_ram_logdirty);
+ p2m_change_entry_type_global(d, p2m_ram_rw, p2m_ram_logdirty);
flush_tlb_mask(d->domain_dirty_cpumask);
return 0;
}
@@ -73,14 +73,14 @@ int hap_disable_log_dirty(struct domain
hap_unlock(d);
/* set l1e entries of P2M table with normal mode */
- p2m_change_type_global(d, p2m_ram_logdirty, p2m_ram_rw);
+ p2m_change_entry_type_global(d, p2m_ram_logdirty, p2m_ram_rw);
return 0;
}
void hap_clean_dirty_bitmap(struct domain *d)
{
/* set l1e entries of P2M table to be read-only. */
- p2m_change_type_global(d, p2m_ram_rw, p2m_ram_logdirty);
+ p2m_change_entry_type_global(d, p2m_ram_rw, p2m_ram_logdirty);
flush_tlb_mask(d->domain_dirty_cpumask);
}
Index: xen-3.2.1-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/p2m.c
@@ -279,11 +279,19 @@ void p2m_init(struct domain *d)
d->arch.p2m.set_entry = p2m_set_entry;
d->arch.p2m.get_entry = p2m_gfn_to_mfn;
d->arch.p2m.get_entry_fast = p2m_gfn_to_mfn_fast;
+ d->arch.p2m.change_entry_type_global = p2m_change_type_global;
if ( is_hvm_domain(d) )
hvm_p2m_init(d);
}
+void p2m_change_entry_type_global(struct domain *d, p2m_type_t ot, p2m_type_t nt)
+{
+ p2m_lock(d);
+ d->arch.p2m.change_entry_type_global(d, ot, nt);
+ p2m_unlock(d);
+}
+
static inline
int set_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn, p2m_type_t p2mt)
{
@@ -806,8 +814,6 @@ void p2m_change_type_global(struct domai
if ( pagetable_get_pfn(d->arch.phys_table) == 0 )
return;
- p2m_lock(d);
-
#if CONFIG_PAGING_LEVELS == 4
l4e = map_domain_page(mfn_x(pagetable_get_mfn(d->arch.phys_table)));
#elif CONFIG_PAGING_LEVELS == 3
@@ -878,7 +884,6 @@ void p2m_change_type_global(struct domai
unmap_domain_page(l2e);
#endif
- p2m_unlock(d);
}
/* Modify the p2m type of a single gfn from ot to nt, returning the
Index: xen-3.2.1-testing/xen/include/asm-x86/domain.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/domain.h
+++ xen-3.2.1-testing/xen/include/asm-x86/domain.h
@@ -171,6 +171,8 @@ struct p2m_domain {
p2m_type_t *p2mt);
mfn_t (*get_entry_fast)(unsigned long gfn, p2m_type_t *p2mt);
+ void (*change_entry_type_global)(struct domain *d,
+ p2m_type_t ot, p2m_type_t nt);
/* Highest guest frame that's ever been mapped in the p2m */
unsigned long max_mapped_pfn;
};
Index: xen-3.2.1-testing/xen/include/asm-x86/hap.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hap.h
+++ xen-3.2.1-testing/xen/include/asm-x86/hap.h
@@ -97,6 +97,49 @@ extern struct paging_mode hap_paging_pro
extern struct paging_mode hap_paging_pae_mode;
extern struct paging_mode hap_paging_long_mode;
+/* EPT violation qualifications definitions */
+/* bit offset 0 in exit qualification */
+#define _EPT_READ_VIOLATION 0
+#define EPT_READ_VIOLATION (1UL<<_EPT_READ_VIOLATION)
+/* bit offset 1 in exit qualification */
+#define _EPT_WRITE_VIOLATION 1
+#define EPT_WRITE_VIOLATION (1UL<<_EPT_WRITE_VIOLATION)
+/* bit offset 2 in exit qualification */
+#define _EPT_EXEC_VIOLATION 2
+#define EPT_EXEC_VIOLATION (1UL<<_EPT_EXEC_VIOLATION)
+
+/* bit offset 3 in exit qualification */
+#define _EPT_EFFECTIVE_READ 3
+#define EPT_EFFECTIVE_READ (1UL<<_EPT_EFFECTIVE_READ)
+/* bit offset 4 in exit qualification */
+#define _EPT_EFFECTIVE_WRITE 4
+#define EPT_EFFECTIVE_WRITE (1UL<<_EPT_EFFECTIVE_WRITE)
+/* bit offset 5 in exit qualification */
+#define _EPT_EFFECTIVE_EXEC 5
+#define EPT_EFFECTIVE_EXEC (1UL<<_EPT_EFFECTIVE_EXEC)
+
+/* bit offset 6 in exit qualification */
+#define _EPT_GAW_VIOLATION 6
+#define EPT_GAW_VIOLATION (1UL<<_EPT_GAW_VIOLATION)
+
+/* bits offset 7 & 8 in exit qualification */
+#define _EPT_GLA_VALIDITY 7
+#define EPT_GLA_VALIDITY_MASK (3UL<<_EPT_GLA_VALIDITY)
+/* gla != gpa, when load PDPTR */
+#define EPT_GLA_VALIDITY_PDPTR_LOAD (0UL<<_EPT_GLA_VALIDITY)
+/* gla != gpa, during guest page table walking */
+#define EPT_GLA_VALIDITY_GPT_WALK (1UL<<_EPT_GLA_VALIDITY)
+/* reserved */
+#define EPT_GLA_VALIDITY_RSVD (2UL<<_EPT_GLA_VALIDITY)
+/* gla == gpa, normal case */
+#define EPT_GLA_VALIDITY_MATCH (3UL<<_EPT_GLA_VALIDITY)
+
+#define EPT_EFFECTIVE_MASK (EPT_EFFECTIVE_READ | \
+ EPT_EFFECTIVE_WRITE | \
+ EPT_EFFECTIVE_EXEC)
+
+#define EPT_PAGETABLE_ENTRIES 512
+
#endif /* XEN_HAP_H */
/*
Index: xen-3.2.1-testing/xen/include/asm-x86/p2m.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/p2m.h
+++ xen-3.2.1-testing/xen/include/asm-x86/p2m.h
@@ -209,6 +209,7 @@ void guest_physmap_remove_page(struct do
/* Change types across all p2m entries in a domain */
void p2m_change_type_global(struct domain *d, p2m_type_t ot, p2m_type_t nt);
+void p2m_change_entry_type_global(struct domain *d, p2m_type_t ot, p2m_type_t nt);
/* Compare-exchange the type of a single p2m entry */
p2m_type_t p2m_change_type(struct domain *d, unsigned long gfn,

View File

@ -1,331 +0,0 @@
Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmx.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/vmx/vmx.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmx.c
@@ -50,6 +50,7 @@
#include <public/hvm/save.h>
#include <asm/hvm/trace.h>
#include <asm/hvm/hvm_extensions.h>
+#include <asm/hap.h>
enum handler_return { HNDL_done, HNDL_unhandled, HNDL_exception_raised };
@@ -2865,9 +2866,44 @@ void vmx_wbinvd_intercept(void)
static void ept_handle_violation(unsigned long qualification, paddr_t gpa)
{
- if ( unlikely(((qualification >> 7) & 0x3) != 0x3) )
+ unsigned long gla_validity = qualification & EPT_GLA_VALIDITY_MASK;
+ struct domain *d = current->domain;
+ u64 gfn = gpa >> PAGE_SHIFT;
+ mfn_t mfn;
+ p2m_type_t t;
+
+ /* GPA exceeds GAW. */
+ if ( unlikely(qualification & EPT_GAW_VIOLATION) )
{
- domain_crash(current->domain);
+ printk("EPT violation: guest physical address %"PRIpaddr" exceeded "
+ "its width limit.\n", gpa);
+ domain_crash(d);
+ }
+
+ if ( gla_validity == EPT_GLA_VALIDITY_RSVD ||
+ gla_validity == EPT_GLA_VALIDITY_PDPTR_LOAD )
+ {
+ printk("ept violation: reserved bit or pdptr load violation.\n");
+ domain_crash(d);
+ }
+
+ mfn = gfn_to_mfn(d, gfn, &t);
+
+ if ( unlikely( gla_validity != EPT_GLA_VALIDITY_MATCH) )
+ {
+ if ( p2m_is_ram(t) && paging_mode_log_dirty(d) )
+ goto mark_dirty;
+ domain_crash(d);
+ return;
+ }
+
+mark_dirty:
+
+ if ( p2m_is_ram(t) && paging_mode_log_dirty(d) )
+ {
+ paging_mark_dirty(d, mfn_x(mfn));
+ p2m_change_type(d, gfn, p2m_ram_logdirty, p2m_ram_rw);
+ flush_tlb_mask(d->domain_dirty_cpumask);
return;
}
Index: xen-3.2.1-testing/xen/arch/x86/mm/hap/hap.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/hap/hap.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/hap/hap.c
@@ -61,7 +61,7 @@ int hap_enable_log_dirty(struct domain *
hap_unlock(d);
/* set l1e entries of P2M table to be read-only. */
- p2m_change_type_global(d, p2m_ram_rw, p2m_ram_logdirty);
+ p2m_change_entry_type_global(d, p2m_ram_rw, p2m_ram_logdirty);
flush_tlb_mask(d->domain_dirty_cpumask);
return 0;
}
@@ -73,14 +73,14 @@ int hap_disable_log_dirty(struct domain
hap_unlock(d);
/* set l1e entries of P2M table with normal mode */
- p2m_change_type_global(d, p2m_ram_logdirty, p2m_ram_rw);
+ p2m_change_entry_type_global(d, p2m_ram_logdirty, p2m_ram_rw);
return 0;
}
void hap_clean_dirty_bitmap(struct domain *d)
{
/* set l1e entries of P2M table to be read-only. */
- p2m_change_type_global(d, p2m_ram_rw, p2m_ram_logdirty);
+ p2m_change_entry_type_global(d, p2m_ram_rw, p2m_ram_logdirty);
flush_tlb_mask(d->domain_dirty_cpumask);
}
Index: xen-3.2.1-testing/xen/arch/x86/mm/p2m-ept.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/p2m-ept.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/p2m-ept.c
@@ -23,6 +23,27 @@
#include <asm/types.h>
#include <asm/domain.h>
#include <asm/hvm/vmx/vmx.h>
+#include <asm/hap.h>
+
+static void ept_p2m_type_to_flags(ept_entry_t *entry, p2m_type_t type)
+{
+ switch(type)
+ {
+ case p2m_invalid:
+ case p2m_mmio_dm:
+ default:
+ return;
+ case p2m_ram_rw:
+ case p2m_mmio_direct:
+ entry->r = entry->w = entry->x = 1;
+ return;
+ case p2m_ram_logdirty:
+ case p2m_ram_ro:
+ entry->r = entry->x = 1;
+ entry->w = 0;
+ return;
+ }
+}
static int ept_next_level(struct domain *d, bool_t read_only,
ept_entry_t **table, unsigned long *gfn_remainder,
@@ -100,6 +121,7 @@ ept_set_entry(struct domain *d, unsigned
ept_entry->avail2 = 0;
/* last step */
ept_entry->r = ept_entry->w = ept_entry->x = 1;
+ ept_p2m_type_to_flags(ept_entry, p2mt);
}
else
ept_entry->epte = 0;
@@ -140,13 +162,10 @@ static mfn_t ept_get_entry(struct domain
index = gfn_remainder;
ept_entry = table + index;
- if ( (ept_entry->epte & 0x7) == 0x7 )
+ if ( ept_entry->avail1 != p2m_invalid )
{
- if ( ept_entry->avail1 != p2m_invalid )
- {
- *t = ept_entry->avail1;
- mfn = _mfn(ept_entry->mfn);
- }
+ *t = ept_entry->avail1;
+ mfn = _mfn(ept_entry->mfn);
}
out:
@@ -159,11 +178,64 @@ static mfn_t ept_get_entry_fast(unsigned
return ept_get_entry(current->domain, gfn, t);
}
+/* Walk the whole p2m table, changing any entries of the old type
+ * to the new type. This is used in hardware-assisted paging to
+ * quickly enable or diable log-dirty tracking */
+
+static void ept_change_entry_type_global(struct domain *d, p2m_type_t ot, p2m_type_t nt)
+{
+ if ( pagetable_get_pfn(d->arch.phys_table) == 0 )
+ return;
+
+ if ( EPT_DEFAULT_GAW == 3 )
+ {
+ ept_entry_t *l4e, *l3e, *l2e, *l1e;
+ int i4, i3, i2, i1;
+
+ l4e = map_domain_page(mfn_x(pagetable_get_mfn(d->arch.phys_table)));
+ for (i4 = 0; i4 < EPT_PAGETABLE_ENTRIES; i4++ )
+ {
+ if ( !(l4e+i4)->epte || (l4e+i4)->sp_avail)
+ continue;
+ l3e = map_domain_page((l4e+i4)->mfn);
+ for ( i3 = 0; i3 < EPT_PAGETABLE_ENTRIES; i3++ )
+ {
+ if ( !(l3e+i3)->epte || (l3e+i3)->sp_avail )
+ continue;
+ l2e = map_domain_page((l3e+i3)->mfn);
+ for ( i2 = 0; i2 < EPT_PAGETABLE_ENTRIES; i2++ )
+ {
+ if ( !(l2e+i2)->epte || (l2e+i2)->sp_avail )
+ continue;
+ l1e = map_domain_page((l2e+i2)->mfn);
+ for ( i1 = 0; i1 < EPT_PAGETABLE_ENTRIES; i1++ )
+ {
+ if ( !(l1e+i1)->epte )
+ continue;
+ if ( (l1e+i1)->avail1 != ot )
+ continue;
+ (l1e+i1)->avail1 = nt;
+ ept_p2m_type_to_flags(l1e+i1, nt);
+ }
+ unmap_domain_page(l1e);
+ }
+ unmap_domain_page(l2e);
+ }
+ unmap_domain_page(l3e);
+ }
+ unmap_domain_page(l4e);
+
+ if ( d->vcpu[0] )
+ ept_sync_domain(d->vcpu[0]);
+ }
+}
+
void ept_p2m_init(struct domain *d)
{
d->arch.p2m.set_entry = ept_set_entry;
d->arch.p2m.get_entry = ept_get_entry;
d->arch.p2m.get_entry_fast = ept_get_entry_fast;
+ d->arch.p2m.change_entry_type_global = ept_change_entry_type_global;
}
/*
Index: xen-3.2.1-testing/xen/arch/x86/mm/p2m.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/p2m.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/p2m.c
@@ -279,11 +279,19 @@ void p2m_init(struct domain *d)
d->arch.p2m.set_entry = p2m_set_entry;
d->arch.p2m.get_entry = p2m_gfn_to_mfn;
d->arch.p2m.get_entry_fast = p2m_gfn_to_mfn_fast;
+ d->arch.p2m.change_entry_type_global = p2m_change_type_global;
if ( is_hvm_domain(d) )
hvm_p2m_init(d);
}
+void p2m_change_entry_type_global(struct domain *d, p2m_type_t ot, p2m_type_t nt)
+{
+ p2m_lock(d);
+ d->arch.p2m.change_entry_type_global(d, ot, nt);
+ p2m_unlock(d);
+}
+
static inline
int set_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn, p2m_type_t p2mt)
{
@@ -806,8 +814,6 @@ void p2m_change_type_global(struct domai
if ( pagetable_get_pfn(d->arch.phys_table) == 0 )
return;
- p2m_lock(d);
-
#if CONFIG_PAGING_LEVELS == 4
l4e = map_domain_page(mfn_x(pagetable_get_mfn(d->arch.phys_table)));
#elif CONFIG_PAGING_LEVELS == 3
@@ -878,7 +884,6 @@ void p2m_change_type_global(struct domai
unmap_domain_page(l2e);
#endif
- p2m_unlock(d);
}
/* Modify the p2m type of a single gfn from ot to nt, returning the
Index: xen-3.2.1-testing/xen/include/asm-x86/domain.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/domain.h
+++ xen-3.2.1-testing/xen/include/asm-x86/domain.h
@@ -171,6 +171,8 @@ struct p2m_domain {
p2m_type_t *p2mt);
mfn_t (*get_entry_fast)(unsigned long gfn, p2m_type_t *p2mt);
+ void (*change_entry_type_global)(struct domain *d,
+ p2m_type_t ot, p2m_type_t nt);
/* Highest guest frame that's ever been mapped in the p2m */
unsigned long max_mapped_pfn;
};
Index: xen-3.2.1-testing/xen/include/asm-x86/hap.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hap.h
+++ xen-3.2.1-testing/xen/include/asm-x86/hap.h
@@ -97,6 +97,49 @@ extern struct paging_mode hap_paging_pro
extern struct paging_mode hap_paging_pae_mode;
extern struct paging_mode hap_paging_long_mode;
+/* EPT violation qualifications definitions */
+/* bit offset 0 in exit qualification */
+#define _EPT_READ_VIOLATION 0
+#define EPT_READ_VIOLATION (1UL<<_EPT_READ_VIOLATION)
+/* bit offset 1 in exit qualification */
+#define _EPT_WRITE_VIOLATION 1
+#define EPT_WRITE_VIOLATION (1UL<<_EPT_WRITE_VIOLATION)
+/* bit offset 2 in exit qualification */
+#define _EPT_EXEC_VIOLATION 2
+#define EPT_EXEC_VIOLATION (1UL<<_EPT_EXEC_VIOLATION)
+
+/* bit offset 3 in exit qualification */
+#define _EPT_EFFECTIVE_READ 3
+#define EPT_EFFECTIVE_READ (1UL<<_EPT_EFFECTIVE_READ)
+/* bit offset 4 in exit qualification */
+#define _EPT_EFFECTIVE_WRITE 4
+#define EPT_EFFECTIVE_WRITE (1UL<<_EPT_EFFECTIVE_WRITE)
+/* bit offset 5 in exit qualification */
+#define _EPT_EFFECTIVE_EXEC 5
+#define EPT_EFFECTIVE_EXEC (1UL<<_EPT_EFFECTIVE_EXEC)
+
+/* bit offset 6 in exit qualification */
+#define _EPT_GAW_VIOLATION 6
+#define EPT_GAW_VIOLATION (1UL<<_EPT_GAW_VIOLATION)
+
+/* bits offset 7 & 8 in exit qualification */
+#define _EPT_GLA_VALIDITY 7
+#define EPT_GLA_VALIDITY_MASK (3UL<<_EPT_GLA_VALIDITY)
+/* gla != gpa, when load PDPTR */
+#define EPT_GLA_VALIDITY_PDPTR_LOAD (0UL<<_EPT_GLA_VALIDITY)
+/* gla != gpa, during guest page table walking */
+#define EPT_GLA_VALIDITY_GPT_WALK (1UL<<_EPT_GLA_VALIDITY)
+/* reserved */
+#define EPT_GLA_VALIDITY_RSVD (2UL<<_EPT_GLA_VALIDITY)
+/* gla == gpa, normal case */
+#define EPT_GLA_VALIDITY_MATCH (3UL<<_EPT_GLA_VALIDITY)
+
+#define EPT_EFFECTIVE_MASK (EPT_EFFECTIVE_READ | \
+ EPT_EFFECTIVE_WRITE | \
+ EPT_EFFECTIVE_EXEC)
+
+#define EPT_PAGETABLE_ENTRIES 512
+
#endif /* XEN_HAP_H */
/*
Index: xen-3.2.1-testing/xen/include/asm-x86/p2m.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/p2m.h
+++ xen-3.2.1-testing/xen/include/asm-x86/p2m.h
@@ -209,6 +209,7 @@ void guest_physmap_remove_page(struct do
/* Change types across all p2m entries in a domain */
void p2m_change_type_global(struct domain *d, p2m_type_t ot, p2m_type_t nt);
+void p2m_change_entry_type_global(struct domain *d, p2m_type_t ot, p2m_type_t nt);
/* Compare-exchange the type of a single p2m entry */
p2m_type_t p2m_change_type(struct domain *d, unsigned long gfn,

View File

@ -1,8 +1,8 @@
Index: xen-3.2.1-testing/tools/python/xen/lowlevel/xc/xc.c Index: xen-3.3.0-testing/tools/python/xen/lowlevel/xc/xc.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/lowlevel/xc/xc.c --- xen-3.3.0-testing.orig/tools/python/xen/lowlevel/xc/xc.c
+++ xen-3.2.1-testing/tools/python/xen/lowlevel/xc/xc.c +++ xen-3.3.0-testing/tools/python/xen/lowlevel/xc/xc.c
@@ -638,14 +638,14 @@ static PyObject *pyxc_hvm_build(XcObject @@ -855,14 +855,14 @@ static PyObject *pyxc_hvm_build(XcObject
int i; int i;
#endif #endif
char *image; char *image;
@ -10,9 +10,9 @@ Index: xen-3.2.1-testing/tools/python/xen/lowlevel/xc/xc.c
+ int memsize, vcpus = 1, acpi = 0, apic = 1, extid = 0; + int memsize, vcpus = 1, acpi = 0, apic = 1, extid = 0;
static char *kwd_list[] = { "domid", static char *kwd_list[] = { "domid",
- "memsize", "image", "vcpus", "acpi", - "memsize", "image", "vcpus", "acpi",
+ "memsize", "image", "vcpus", "extid", "acpi", + "memsize", "image", "vcpus", "extid", "acpi",
"apic", NULL }; "apic", NULL };
- if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iii", kwd_list, - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iii", kwd_list,
+ if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list, + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list,
&dom, &memsize, &dom, &memsize,
@ -21,7 +21,7 @@ Index: xen-3.2.1-testing/tools/python/xen/lowlevel/xc/xc.c
return NULL; return NULL;
if ( xc_hvm_build(self->xc_handle, dom, memsize, image) != 0 ) if ( xc_hvm_build(self->xc_handle, dom, memsize, image) != 0 )
@@ -670,6 +670,7 @@ static PyObject *pyxc_hvm_build(XcObject @@ -887,6 +887,7 @@ static PyObject *pyxc_hvm_build(XcObject
va_hvm->checksum = -sum; va_hvm->checksum = -sum;
munmap(va_map, XC_PAGE_SIZE); munmap(va_map, XC_PAGE_SIZE);
#endif #endif
@ -29,10 +29,10 @@ Index: xen-3.2.1-testing/tools/python/xen/lowlevel/xc/xc.c
return Py_BuildValue("{}"); return Py_BuildValue("{}");
} }
Index: xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py Index: xen-3.3.0-testing/tools/python/xen/xend/XendConfig.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendConfig.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py +++ xen-3.3.0-testing/tools/python/xen/xend/XendConfig.py
@@ -139,6 +139,7 @@ XENAPI_PLATFORM_CFG_TYPES = { @@ -139,6 +139,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
'monitor': int, 'monitor': int,
'nographic': int, 'nographic': int,
@ -41,19 +41,19 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendConfig.py
'rtc_timeoffset': int, 'rtc_timeoffset': int,
'serial': str, 'serial': str,
'sdl': int, 'sdl': int,
Index: xen-3.2.1-testing/tools/python/xen/xend/image.py Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/image.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.2.1-testing/tools/python/xen/xend/image.py +++ xen-3.3.0-testing/tools/python/xen/xend/image.py
@@ -441,6 +441,7 @@ class HVMImageHandler(ImageHandler): @@ -538,6 +538,7 @@ class HVMImageHandler(ImageHandler):
self.apic = int(vmConfig['platform'].get('apic', 0)) self.apic = int(vmConfig['platform'].get('apic', 0))
self.acpi = int(vmConfig['platform'].get('acpi', 0)) self.acpi = int(vmConfig['platform'].get('acpi', 0))
+ self.extid = int(vmConfig['platform'].get('extid', 0)) + self.extid = int(vmConfig['platform'].get('extid', 0))
self.guest_os_type = vmConfig['platform'].get('guest_os_type') self.guest_os_type = vmConfig['platform'].get('guest_os_type')
# Return a list of cmd line args to the device models based on the self.vmConfig = vmConfig
@@ -531,6 +532,7 @@ class HVMImageHandler(ImageHandler): @@ -671,6 +672,7 @@ class HVMImageHandler(ImageHandler):
log.debug("store_evtchn = %d", store_evtchn) log.debug("store_evtchn = %d", store_evtchn)
log.debug("memsize = %d", mem_mb) log.debug("memsize = %d", mem_mb)
log.debug("vcpus = %d", self.vm.getVCpuCount()) log.debug("vcpus = %d", self.vm.getVCpuCount())
@ -61,19 +61,19 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/image.py
log.debug("acpi = %d", self.acpi) log.debug("acpi = %d", self.acpi)
log.debug("apic = %d", self.apic) log.debug("apic = %d", self.apic)
@@ -538,6 +540,7 @@ class HVMImageHandler(ImageHandler): @@ -678,6 +680,7 @@ class HVMImageHandler(ImageHandler):
image = self.kernel, image = self.loader,
memsize = mem_mb, memsize = mem_mb,
vcpus = self.vm.getVCpuCount(), vcpus = self.vm.getVCpuCount(),
+ extid = self.extid, + extid = self.extid,
acpi = self.acpi, acpi = self.acpi,
apic = self.apic) apic = self.apic)
rc['notes'] = { 'SUSPEND_CANCEL': 1 } rc['notes'] = { 'SUSPEND_CANCEL': 1 }
Index: xen-3.2.1-testing/tools/python/xen/xm/create.py Index: xen-3.3.0-testing/tools/python/xen/xm/create.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xm/create.py --- xen-3.3.0-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.2.1-testing/tools/python/xen/xm/create.py +++ xen-3.3.0-testing/tools/python/xen/xm/create.py
@@ -203,6 +203,10 @@ gopts.var('timer_mode', val='TIMER_MODE' @@ -207,6 +207,10 @@ gopts.var('timer_mode', val='TIMER_MODE'
use="""Timer mode (0=delay virtual time when ticks are missed; use="""Timer mode (0=delay virtual time when ticks are missed;
1=virtual time is always wallclock time.""") 1=virtual time is always wallclock time.""")
@ -84,7 +84,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xm/create.py
gopts.var('acpi', val='ACPI', gopts.var('acpi', val='ACPI',
fn=set_int, default=1, fn=set_int, default=1,
use="Disable or enable ACPI of HVM domain.") use="Disable or enable ACPI of HVM domain.")
@@ -734,7 +738,7 @@ def configure_vifs(config_devs, vals): @@ -760,7 +764,7 @@ def configure_vifs(config_devs, vals):
def configure_hvm(config_image, vals): def configure_hvm(config_image, vals):
"""Create the config for HVM devices. """Create the config for HVM devices.
""" """

View File

@ -1,8 +1,8 @@
Index: xen-3.2-testing/tools/ioemu/hw/xenfb.c Index: xen-3.3.0-testing/tools/ioemu/hw/xenfb.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/ioemu/hw/xenfb.c 2008-02-26 07:38:20.000000000 -0700 --- xen-3.3.0-testing.orig/tools/ioemu/hw/xenfb.c
+++ xen-3.2-testing/tools/ioemu/hw/xenfb.c 2008-02-26 07:43:56.000000000 -0700 +++ xen-3.3.0-testing/tools/ioemu/hw/xenfb.c
@@ -1103,6 +1103,25 @@ @@ -1220,6 +1220,25 @@ static void xenfb_mouse_event(void *opaq
} \ } \
} }
@ -28,12 +28,12 @@ Index: xen-3.2-testing/tools/ioemu/hw/xenfb.c
/* This copies data from the guest framebuffer region, into QEMU's copy /* This copies data from the guest framebuffer region, into QEMU's copy
* NB. QEMU's copy is stored in the pixel format of a) the local X * NB. QEMU's copy is stored in the pixel format of a) the local X
@@ -1139,7 +1158,7 @@ @@ -1258,7 +1277,7 @@ static void xenfb_guest_copy(struct xenf
if (xenfb->ds->depth == 8) { if (xenfb->ds->depth == 8) {
BLT(uint32_t, uint8_t, 16, 8, 0, 5, 2, 0, 255, 255, 255); BLT(uint32_t, uint8_t, 8, 8, 8, 3, 3, 2);
} else if (xenfb->ds->depth == 16) { } else if (xenfb->ds->depth == 16) {
- BLT(uint32_t, uint16_t, 16, 8, 0, 11, 5, 0, 255, 255, 255); - BLT(uint32_t, uint16_t, 8, 8, 8, 5, 6, 5);
+ BLT_32_16(uint32_t, uint16_t, 16, 8, 0, 11, 5, 0, 255, 255, 255, 31, 63, 31); + BLT_32_16(uint32_t, uint16_t, 16, 8, 0, 11, 5, 0, 255, 255, 255, 31, 63, 31);
} } else if (xenfb->ds->depth == 32) {
} BLT(uint32_t, uint32_t, 8, 8, 8, 8, 8, 8);
} }

View File

@ -1,8 +1,8 @@
Index: xen-3.2.1-testing/tools/ioemu/block.c Index: xen-3.3.0-testing/tools/ioemu/block.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/block.c --- xen-3.3.0-testing.orig/tools/ioemu/block.c
+++ xen-3.2.1-testing/tools/ioemu/block.c +++ xen-3.3.0-testing/tools/ioemu/block.c
@@ -587,6 +587,9 @@ int bdrv_write(BlockDriverState *bs, int @@ -607,6 +607,9 @@ int bdrv_write(BlockDriverState *bs, int
else else
return 0; return 0;
} else { } else {
@ -12,10 +12,10 @@ Index: xen-3.2.1-testing/tools/ioemu/block.c
return drv->bdrv_write(bs, sector_num, buf, nb_sectors); return drv->bdrv_write(bs, sector_num, buf, nb_sectors);
} }
} }
Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga.c Index: xen-3.3.0-testing/tools/ioemu/hw/cirrus_vga.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/hw/cirrus_vga.c --- xen-3.3.0-testing.orig/tools/ioemu/hw/cirrus_vga.c
+++ xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga.c +++ xen-3.3.0-testing/tools/ioemu/hw/cirrus_vga.c
@@ -220,6 +220,20 @@ @@ -220,6 +220,20 @@
#define CIRRUS_HOOK_NOT_HANDLED 0 #define CIRRUS_HOOK_NOT_HANDLED 0
#define CIRRUS_HOOK_HANDLED 1 #define CIRRUS_HOOK_HANDLED 1
@ -37,7 +37,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga.c
struct CirrusVGAState; struct CirrusVGAState;
typedef void (*cirrus_bitblt_rop_t) (struct CirrusVGAState *s, typedef void (*cirrus_bitblt_rop_t) (struct CirrusVGAState *s,
uint8_t * dst, const uint8_t * src, uint8_t * dst, const uint8_t * src,
@@ -599,7 +613,7 @@ static void cirrus_invalidate_region(Cir @@ -595,7 +609,7 @@ static void cirrus_invalidate_region(Cir
for (y = 0; y < lines; y++) { for (y = 0; y < lines; y++) {
off_cur = off_begin; off_cur = off_begin;
@ -46,7 +46,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga.c
off_cur &= TARGET_PAGE_MASK; off_cur &= TARGET_PAGE_MASK;
while (off_cur < off_cur_end) { while (off_cur < off_cur_end) {
cpu_physical_memory_set_dirty(s->vram_offset + cpu_physical_memory_set_dirty(s->vram_offset +
@@ -615,7 +629,11 @@ static int cirrus_bitblt_common_patternc @@ -611,7 +625,11 @@ static int cirrus_bitblt_common_patternc
{ {
uint8_t *dst; uint8_t *dst;
@ -59,7 +59,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga.c
(*s->cirrus_rop) (s, dst, src, (*s->cirrus_rop) (s, dst, src,
s->cirrus_blt_dstpitch, 0, s->cirrus_blt_dstpitch, 0,
s->cirrus_blt_width, s->cirrus_blt_height); s->cirrus_blt_width, s->cirrus_blt_height);
@@ -631,8 +649,11 @@ static int cirrus_bitblt_solidfill(Cirru @@ -627,8 +645,11 @@ static int cirrus_bitblt_solidfill(Cirru
{ {
cirrus_fill_t rop_func; cirrus_fill_t rop_func;
@ -72,7 +72,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga.c
s->cirrus_blt_dstpitch, s->cirrus_blt_dstpitch,
s->cirrus_blt_width, s->cirrus_blt_height); s->cirrus_blt_width, s->cirrus_blt_height);
cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, cirrus_invalidate_region(s, s->cirrus_blt_dstaddr,
@@ -651,8 +672,8 @@ static int cirrus_bitblt_solidfill(Cirru @@ -647,8 +668,8 @@ static int cirrus_bitblt_solidfill(Cirru
static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s) static int cirrus_bitblt_videotovideo_patterncopy(CirrusVGAState * s)
{ {
return cirrus_bitblt_common_patterncopy(s, return cirrus_bitblt_common_patterncopy(s,
@ -83,7 +83,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga.c
} }
static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h) static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
@@ -702,8 +723,10 @@ static void cirrus_do_copy(CirrusVGAStat @@ -698,8 +719,10 @@ static void cirrus_do_copy(CirrusVGAStat
if (notify) if (notify)
vga_hw_update(); vga_hw_update();
@ -96,7 +96,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga.c
s->cirrus_blt_dstpitch, s->cirrus_blt_srcpitch, s->cirrus_blt_dstpitch, s->cirrus_blt_srcpitch,
s->cirrus_blt_width, s->cirrus_blt_height); s->cirrus_blt_width, s->cirrus_blt_height);
@@ -729,8 +752,14 @@ static int cirrus_bitblt_videotovideo_co @@ -725,8 +748,14 @@ static int cirrus_bitblt_videotovideo_co
s->cirrus_blt_srcaddr - s->start_addr, s->cirrus_blt_srcaddr - s->start_addr,
s->cirrus_blt_width, s->cirrus_blt_height); s->cirrus_blt_width, s->cirrus_blt_height);
} else { } else {
@ -113,7 +113,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga.c
s->cirrus_blt_dstpitch, s->cirrus_blt_srcpitch, s->cirrus_blt_dstpitch, s->cirrus_blt_srcpitch,
s->cirrus_blt_width, s->cirrus_blt_height); s->cirrus_blt_width, s->cirrus_blt_height);
@@ -762,8 +791,9 @@ static void cirrus_bitblt_cputovideo_nex @@ -758,8 +787,9 @@ static void cirrus_bitblt_cputovideo_nex
} else { } else {
/* at least one scan line */ /* at least one scan line */
do { do {
@ -125,7 +125,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga.c
cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, 0, cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, 0,
s->cirrus_blt_width, 1); s->cirrus_blt_width, 1);
s->cirrus_blt_dstaddr += s->cirrus_blt_dstpitch; s->cirrus_blt_dstaddr += s->cirrus_blt_dstpitch;
@@ -1879,7 +1909,7 @@ static void cirrus_mem_writeb_mode4and5_ @@ -1875,7 +1905,7 @@ static void cirrus_mem_writeb_mode4and5_
unsigned val = mem_value; unsigned val = mem_value;
uint8_t *dst; uint8_t *dst;
@ -134,7 +134,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga.c
for (x = 0; x < 8; x++) { for (x = 0; x < 8; x++) {
if (val & 0x80) { if (val & 0x80) {
*dst = s->cirrus_shadow_gr1; *dst = s->cirrus_shadow_gr1;
@@ -1902,7 +1932,7 @@ static void cirrus_mem_writeb_mode4and5_ @@ -1898,7 +1928,7 @@ static void cirrus_mem_writeb_mode4and5_
unsigned val = mem_value; unsigned val = mem_value;
uint8_t *dst; uint8_t *dst;
@ -143,10 +143,10 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga.c
for (x = 0; x < 8; x++) { for (x = 0; x < 8; x++) {
if (val & 0x80) { if (val & 0x80) {
*dst = s->cirrus_shadow_gr1; *dst = s->cirrus_shadow_gr1;
Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga_rop.h Index: xen-3.3.0-testing/tools/ioemu/hw/cirrus_vga_rop.h
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/hw/cirrus_vga_rop.h --- xen-3.3.0-testing.orig/tools/ioemu/hw/cirrus_vga_rop.h
+++ xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga_rop.h +++ xen-3.3.0-testing/tools/ioemu/hw/cirrus_vga_rop.h
@@ -49,6 +49,12 @@ glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(C @@ -49,6 +49,12 @@ glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(C
src = src_ - src_base; src = src_ - src_base;
dstpitch -= bltwidth; dstpitch -= bltwidth;
@ -160,10 +160,10 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/cirrus_vga_rop.h
for (y = 0; y < bltheight; y++) { for (y = 0; y < bltheight; y++) {
for (x = 0; x < bltwidth; x++) { for (x = 0; x < bltwidth; x++) {
ROP_OP(*(dst_base + m(dst)), *(src_base + m(src))); ROP_OP(*(dst_base + m(dst)), *(src_base + m(src)));
Index: xen-3.2.1-testing/tools/ioemu/hw/i8259.c Index: xen-3.3.0-testing/tools/ioemu/hw/i8259.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/hw/i8259.c --- xen-3.3.0-testing.orig/tools/ioemu/hw/i8259.c
+++ xen-3.2.1-testing/tools/ioemu/hw/i8259.c +++ xen-3.3.0-testing/tools/ioemu/hw/i8259.c
@@ -299,9 +299,11 @@ static void pic_ioport_write(void *opaqu @@ -299,9 +299,11 @@ static void pic_ioport_write(void *opaqu
s->init_state = 1; s->init_state = 1;
s->init4 = val & 1; s->init4 = val & 1;
@ -178,10 +178,10 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/i8259.c
} else if (val & 0x08) { } else if (val & 0x08) {
if (val & 0x04) if (val & 0x04)
s->poll = 1; s->poll = 1;
Index: xen-3.2.1-testing/tools/ioemu/hw/ne2000.c Index: xen-3.3.0-testing/tools/ioemu/hw/ne2000.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/hw/ne2000.c --- xen-3.3.0-testing.orig/tools/ioemu/hw/ne2000.c
+++ xen-3.2.1-testing/tools/ioemu/hw/ne2000.c +++ xen-3.3.0-testing/tools/ioemu/hw/ne2000.c
@@ -221,7 +221,7 @@ static int ne2000_can_receive(void *opaq @@ -221,7 +221,7 @@ static int ne2000_can_receive(void *opaq
NE2000State *s = opaque; NE2000State *s = opaque;
@ -191,11 +191,11 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/ne2000.c
return !ne2000_buffer_full(s); return !ne2000_buffer_full(s);
} }
Index: xen-3.2.1-testing/tools/ioemu/hw/pc.c Index: xen-3.3.0-testing/tools/ioemu/hw/pc.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/hw/pc.c --- xen-3.3.0-testing.orig/tools/ioemu/hw/pc.c
+++ xen-3.2.1-testing/tools/ioemu/hw/pc.c +++ xen-3.3.0-testing/tools/ioemu/hw/pc.c
@@ -315,7 +315,8 @@ void bochs_bios_write(void *opaque, uint @@ -313,7 +313,8 @@ void bochs_bios_write(void *opaque, uint
case 0x400: case 0x400:
case 0x401: case 0x401:
fprintf(stderr, "BIOS panic at rombios.c, line %d\n", val); fprintf(stderr, "BIOS panic at rombios.c, line %d\n", val);
@ -205,7 +205,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/pc.c
case 0x402: case 0x402:
case 0x403: case 0x403:
#ifdef DEBUG_BIOS #ifdef DEBUG_BIOS
@@ -338,8 +339,9 @@ void bochs_bios_write(void *opaque, uint @@ -336,8 +337,9 @@ void bochs_bios_write(void *opaque, uint
/* LGPL'ed VGA BIOS messages */ /* LGPL'ed VGA BIOS messages */
case 0x501: case 0x501:
case 0x502: case 0x502:
@ -216,10 +216,10 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/pc.c
case 0x500: case 0x500:
case 0x503: case 0x503:
#ifdef DEBUG_BIOS #ifdef DEBUG_BIOS
Index: xen-3.2.1-testing/tools/ioemu/target-i386/translate.c Index: xen-3.3.0-testing/tools/ioemu/target-i386/translate.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/target-i386/translate.c --- xen-3.3.0-testing.orig/tools/ioemu/target-i386/translate.c
+++ xen-3.2.1-testing/tools/ioemu/target-i386/translate.c +++ xen-3.3.0-testing/tools/ioemu/target-i386/translate.c
@@ -5326,7 +5326,12 @@ static target_ulong disas_insn(DisasCont @@ -5326,7 +5326,12 @@ static target_ulong disas_insn(DisasCont
if (CODE64(s)) if (CODE64(s))
goto illegal_op; goto illegal_op;
@ -250,11 +250,11 @@ Index: xen-3.2.1-testing/tools/ioemu/target-i386/translate.c
case 0xfa: /* cli */ case 0xfa: /* cli */
if (!s->vm86) { if (!s->vm86) {
if (s->cpl <= s->iopl) { if (s->cpl <= s->iopl) {
Index: xen-3.2.1-testing/tools/ioemu/vl.c Index: xen-3.3.0-testing/tools/ioemu/vl.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/vl.c --- xen-3.3.0-testing.orig/tools/ioemu/vl.c
+++ xen-3.2.1-testing/tools/ioemu/vl.c +++ xen-3.3.0-testing/tools/ioemu/vl.c
@@ -3602,8 +3602,8 @@ typedef struct NetSocketState { @@ -3636,8 +3636,8 @@ typedef struct NetSocketState {
VLANClientState *vc; VLANClientState *vc;
int fd; int fd;
int state; /* 0 = getting length, 1 = getting data */ int state; /* 0 = getting length, 1 = getting data */
@ -265,7 +265,7 @@ Index: xen-3.2.1-testing/tools/ioemu/vl.c
uint8_t buf[4096]; uint8_t buf[4096];
struct sockaddr_in dgram_dst; /* contains inet host and port destination iff connectionless (SOCK_DGRAM) */ struct sockaddr_in dgram_dst; /* contains inet host and port destination iff connectionless (SOCK_DGRAM) */
} NetSocketState; } NetSocketState;
@@ -3634,7 +3634,8 @@ static void net_socket_receive_dgram(voi @@ -3668,7 +3668,8 @@ static void net_socket_receive_dgram(voi
static void net_socket_send(void *opaque) static void net_socket_send(void *opaque)
{ {
NetSocketState *s = opaque; NetSocketState *s = opaque;
@ -275,7 +275,7 @@ Index: xen-3.2.1-testing/tools/ioemu/vl.c
uint8_t buf1[4096]; uint8_t buf1[4096];
const uint8_t *buf; const uint8_t *buf;
@@ -3673,7 +3674,15 @@ static void net_socket_send(void *opaque @@ -3707,7 +3708,15 @@ static void net_socket_send(void *opaque
l = s->packet_len - s->index; l = s->packet_len - s->index;
if (l > size) if (l > size)
l = size; l = size;

View File

@ -1,8 +1,8 @@
Index: xen-3.2-testing/tools/examples/Makefile Index: xen-3.3.0-testing/tools/examples/Makefile
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/examples/Makefile --- xen-3.3.0-testing.orig/tools/examples/Makefile
+++ xen-3.2-testing/tools/examples/Makefile +++ xen-3.3.0-testing/tools/examples/Makefile
@@ -56,7 +56,7 @@ install-initd: @@ -54,7 +54,7 @@ install-initd:
[ -d $(DESTDIR)/var/adm/fillup-templates ] || $(INSTALL_DIR) $(DESTDIR)/var/adm/fillup-templates/ [ -d $(DESTDIR)/var/adm/fillup-templates ] || $(INSTALL_DIR) $(DESTDIR)/var/adm/fillup-templates/
$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d
$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d

View File

@ -0,0 +1,136 @@
Index: xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/drivers/blktapctrl.c
+++ xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
@@ -334,6 +334,7 @@ static int write_msg(int fd, int msgtype
msg_dev = (msg_newdev_t *)(buf + sizeof(msg_hdr_t));
msg_dev->devnum = blkif->minor;
msg_dev->domid = blkif->domid;
+ msg_dev->be_id = blkif->be_id;
break;
Index: xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/lib/blktaplib.h
+++ xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
@@ -183,6 +183,7 @@ typedef struct msg_hdr {
typedef struct msg_newdev {
uint8_t devnum;
uint16_t domid;
+ uint32_t be_id;
} msg_newdev_t;
typedef struct msg_pid {
Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/xen_blktap.c
+++ xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
@@ -65,6 +65,8 @@ int write_fd;
static pid_t process;
fd_list_entry_t *fd_start = NULL;
+extern char* get_snapshot_name(int devid);
+
static void handle_blktap_iomsg(void* private);
struct aiocb_info {
@@ -497,6 +499,10 @@ static void handle_blktap_ctrlmsg(void*
char buf[MSG_SIZE];
+#ifndef QEMU_TOOL
+ char *snapshot;
+#endif
+
length = read(read_fd, buf, MSG_SIZE);
if (length > 0 && length >= sizeof(msg_hdr_t))
@@ -552,7 +558,18 @@ static void handle_blktap_ctrlmsg(void*
if (s != NULL) {
ret = ((map_new_dev(s, msg_dev->devnum)
== msg_dev->devnum ? 0: -1));
- }
+ }
+
+#ifndef QEMU_TOOL
+ fprintf(stderr, "Reading snapshot name for %d\n", msg_dev->be_id);
+ snapshot = get_snapshot_name(msg_dev->be_id);
+ if (snapshot) {
+ // TODO Error handling
+ fprintf(stderr, "Using snapshot %s\n", snapshot);
+ if (bdrv_snapshot_goto(s->bs, snapshot) < 0)
+ fprintf(stderr, "Could not load snapshot");
+ }
+#endif
memset(buf, 0x00, MSG_SIZE);
msglen = sizeof(msg_hdr_t);
Index: xen-3.3.0-testing/tools/ioemu/vl.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/vl.c
+++ xen-3.3.0-testing/tools/ioemu/vl.c
@@ -5233,7 +5233,6 @@ the_end:
return ret;
}
-
#else
void do_savevm(const char *name)
{
Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/xenstore.c
+++ xen-3.3.0-testing/tools/ioemu/xenstore.c
@@ -26,6 +26,8 @@ static QEMUTimer *insert_timer = NULL;
#define UWAIT_MAX (30*1000000) /* thirty seconds */
#define UWAIT (100000) /* 1/10th second */
+char* get_snapshot_name(int devid);
+
static int pasprintf(char **buf, const char *fmt, ...)
{
va_list ap;
@@ -311,8 +313,17 @@ void xenstore_parse_domain_config(int hv
}
}
}
- if (bdrv_open2(bs, params, 0 /* snapshot */, format) < 0)
+ if (bdrv_open2(bs, params, 0 /* snapshot */, format) < 0) {
fprintf(stderr, "qemu: could not open vbd '%s' or hard disk image '%s' (drv '%s' format '%s')\n", buf, params, drv ? drv : "?", format ? format->format_name : "0");
+ } else {
+ char* snapshot = get_snapshot_name(atoi(e[i]));
+ if (snapshot) {
+ // TODO Error handling
+ fprintf(stderr, "Using snapshot %s\n", snapshot);
+ if (bdrv_snapshot_goto(bs, snapshot) < 0)
+ fprintf(stderr, "Could not load snapshot");
+ }
+ }
}
}
@@ -406,6 +417,23 @@ void xenstore_parse_domain_config(int hv
return;
}
+
+char* get_snapshot_name(int devid)
+{
+ char* path = NULL;
+ char* name = NULL;
+ unsigned int len;
+
+ if (pasprintf(&path,
+ "/local/domain/0/backend/tap/%u/%u/snapshot", domid, devid) == -1)
+ return NULL;
+ name = xs_read(xsh, XBT_NULL, path, &len);
+
+ free(path);
+ return name;
+}
+
+
int xenstore_fd(void)
{
if (xsh)

238
snapshot-ioemu-save.patch Normal file
View File

@ -0,0 +1,238 @@
Index: xen-3.3.0-testing/tools/ioemu/vl.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/vl.c
+++ xen-3.3.0-testing/tools/ioemu/vl.c
@@ -108,6 +108,8 @@
#include "exec-all.h"
+#include "block_int.h"
+
#define DEFAULT_NETWORK_SCRIPT "/etc/xen/qemu-ifup"
#ifdef _BSD
#define DEFAULT_BRIDGE "bridge0"
@@ -5155,6 +5157,83 @@ void do_loadvm(const char *name)
if (saved_vm_running)
vm_start();
}
+
+int save_disk_snapshots(const char* name)
+{
+ BlockDriverState *bs;
+ QEMUSnapshotInfo sn, old_sn;
+ struct timeval tv;
+ int saved_vm_running;
+ int can_snapshot;
+ int i;
+ int ret = 0;
+
+ saved_vm_running = vm_running;
+ vm_stop(0);
+
+ qemu_aio_flush();
+
+ /* Ensure that all images support snapshots or are read-only */
+ for(i = 0; i < MAX_DISKS; i++) {
+ bs = bs_table[i];
+
+ if (!bs || !bs->drv)
+ continue;
+
+ can_snapshot = bs->drv->bdrv_snapshot_create && bdrv_can_snapshot(bs);
+ if (!bdrv_is_read_only(bs) && !can_snapshot) {
+ fprintf(stderr, "Error: bdrv %s (%s) doesn't support snapshots\n",
+ bdrv_get_device_name(bs), bs->drv->format_name);
+ ret = -ENOTSUP;
+ goto the_end;
+ }
+ }
+
+ /* fill auxiliary fields */
+ memset(&sn, 0, sizeof(sn));
+ gettimeofday(&tv, NULL);
+ sn.date_sec = tv.tv_sec;
+ sn.date_nsec = tv.tv_usec * 1000;
+ sn.vm_clock_nsec = qemu_get_clock(vm_clock);
+ pstrcpy(sn.name, sizeof(sn.name), name);
+
+ for(i = 0; i < MAX_DISKS; i++) {
+ bs = bs_table[i];
+
+ /* No snapshots on read-only images */
+ if (!bs || !bs->drv || bdrv_is_read_only(bs))
+ continue;
+
+ /* Delete old snapshot of the same name */
+ if (bdrv_snapshot_find(bs, &old_sn, name) >= 0) {
+ ret = bdrv_snapshot_delete(bs, old_sn.id_str);
+ if (ret < 0) {
+ fprintf(stderr, "Error while deleting snapshot on '%s'\n",
+ bdrv_get_device_name(bs));
+ }
+ }
+
+ /* Create the snapshot */
+ fprintf(stderr, "Creating snapshot on '%s' (%s)\n",
+ bdrv_get_device_name(bs), bs->drv->format_name);
+ ret = bdrv_snapshot_create(bs, &sn);
+ if (ret < 0) {
+ fprintf(stderr, "Error while creating snapshot on '%s': %d (%s)\n",
+ bdrv_get_device_name(bs), ret, strerror(-ret));
+ goto the_end;
+ }
+ }
+
+ fprintf(stderr, "Created all snapshots\n");
+
+the_end:
+ if (saved_vm_running)
+ vm_start();
+
+ return ret;
+}
+
+
#else
void do_savevm(const char *name)
{
Index: xen-3.3.0-testing/tools/ioemu/target-i386-dm/helper2.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/target-i386-dm/helper2.c
+++ xen-3.3.0-testing/tools/ioemu/target-i386-dm/helper2.c
@@ -92,6 +92,9 @@ int send_vcpu = 0;
#define NR_CPUS 32
evtchn_port_t ioreq_local_port[NR_CPUS];
+/** Name of the snapshot which should be saved */
+char* snapshot_name;
+
CPUX86State *cpu_x86_init(void)
{
CPUX86State *env;
@@ -556,9 +559,24 @@ int main_loop(void)
main_loop_wait(1); /* For the select() on events */
/* Save the device state */
- asprintf(&qemu_file, "/var/lib/xen/qemu-save.%d", domid);
- do_savevm(qemu_file);
- free(qemu_file);
+ switch (suspend_requested) {
+ case SUSPEND_SAVEVM:
+ asprintf(&qemu_file, "/var/lib/xen/qemu-save.%d", domid);
+ do_savevm(qemu_file);
+ free(qemu_file);
+ break;
+
+ case SUSPEND_SNAPSHOT:
+ // TODO Error reporting
+ if (snapshot_name != NULL) {
+ save_disk_snapshots(snapshot_name);
+ free(snapshot_name);
+ snapshot_name = NULL;
+ } else {
+ fprintf(logfile, "No snapshot name given\n");
+ }
+ break;
+ }
xenstore_record_dm_state("paused");
Index: xen-3.3.0-testing/tools/ioemu/vl.h
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/vl.h
+++ xen-3.3.0-testing/tools/ioemu/vl.h
@@ -59,7 +59,6 @@
extern int qemu_ftruncate64(int, int64_t);
#define ftruncate qemu_ftruncate64
-
static inline char *realpath(const char *path, char *resolved_path)
{
_fullpath(resolved_path, path, _MAX_PATH);
@@ -72,6 +71,11 @@ static inline char *realpath(const char
#define PRIo64 "I64o"
#endif
+enum {
+ SUSPEND_SAVEVM = 1,
+ SUSPEND_SNAPSHOT = 2
+};
+
#ifdef QEMU_TOOL
/* we use QEMU_TOOL in the command line tools which do not depend on
@@ -557,6 +561,8 @@ void do_loadvm(const char *name);
void do_delvm(const char *name);
void do_info_snapshots(void);
+int save_disk_snapshots(const char* name);
+
/* bottom halves */
typedef void QEMUBHFunc(void *opaque);
Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/xenstore.c
+++ xen-3.3.0-testing/tools/ioemu/xenstore.c
@@ -536,6 +536,7 @@ static void xenstore_process_dm_command_
char *path = NULL, *command = NULL, *par = NULL;
unsigned int len;
extern int suspend_requested;
+ extern char* snapshot_name;
if (pasprintf(&path,
"/local/domain/0/device-model/%u/command", domid) == -1) {
@@ -548,7 +549,18 @@ static void xenstore_process_dm_command_
if (!strncmp(command, "save", len)) {
fprintf(logfile, "dm-command: pause and save state\n");
- suspend_requested = 1;
+ suspend_requested = SUSPEND_SAVEVM;
+ } else if (!strncmp(command, "snapshot", len)) {
+ fprintf(logfile, "dm-command: pause and snapshot disks\n");
+ suspend_requested = SUSPEND_SNAPSHOT;
+
+ if (pasprintf(&path,
+ "/local/domain/0/device-model/%u/parameter", domid) == -1) {
+ fprintf(logfile, "out of memory reading dm command parameter\n");
+ goto out;
+ }
+
+ snapshot_name = xs_read(xsh, XBT_NULL, path, &len);
} else if (!strncmp(command, "continue", len)) {
fprintf(logfile, "dm-command: continue after state save\n");
suspend_requested = 0;
Index: xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/xen_blktap.c
+++ xen-3.3.0-testing/tools/ioemu/hw/xen_blktap.c
@@ -221,8 +221,12 @@ static int open_disk(struct td_state *s,
struct disk_id id;
BlockDriverState* bs;
+#ifndef QEMU_TOOL
+ int i;
+#endif
+
DPRINTF("Opening %s\n", path);
- bs = calloc(1, sizeof(*bs));
+ bs = bdrv_new("blktap");
memset(&id, 0, sizeof(struct disk_id));
@@ -238,6 +242,15 @@ static int open_disk(struct td_state *s,
s->info = ((s->flags & TD_RDONLY) ? VDISK_READONLY : 0);
+#ifndef QEMU_TOOL
+ for (i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++) {
+ if (bs_table[i] == NULL) {
+ bs_table[i] = bs;
+ break;
+ }
+ }
+#endif
+
return 0;
}

571
snapshot-xend.patch Normal file
View File

@ -0,0 +1,571 @@
Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.3.0-testing/tools/python/xen/xend/image.py
@@ -481,6 +481,10 @@ class ImageHandler:
# but this can easily lead to very rapid restart loops against
# which we currently have no protection
+ def snapshotDeviceModel(self, name):
+ # Signal the device model to perform snapshot operation
+ self.signalDeviceModel('snapshot', 'paused', name)
+
def recreate(self):
if self.device_model is None:
return
Index: xen-3.3.0-testing/tools/python/xen/xend/server/blkif.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/server/blkif.py
+++ xen-3.3.0-testing/tools/python/xen/xend/server/blkif.py
@@ -78,6 +78,9 @@ class BlkifController(DevController):
if uuid:
back['uuid'] = uuid
+ if 'snapshotname' in self.vm.info:
+ back['snapshot'] = self.vm.info['snapshotname']
+
if security.on() == xsconstants.XS_POLICY_ACM:
self.do_access_control(config, uname)
Index: xen-3.3.0-testing/tools/python/xen/xend/server/SrvDomain.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/server/SrvDomain.py
+++ xen-3.3.0-testing/tools/python/xen/xend/server/SrvDomain.py
@@ -95,6 +95,34 @@ class SrvDomain(SrvDir):
def do_save(self, _, req):
return self.xd.domain_save(self.dom.domid, req.args['file'][0])
+ def op_snapshot_create(self, op, req):
+ self.acceptCommand(req)
+ return req.threadRequest(self.do_snapshot_create, op, req)
+
+ def do_snapshot_create(self, _, req):
+ return self.xd.domain_snapshot_create(self.dom.domid, req.args)
+
+ def op_snapshot_list(self, op, req):
+ self.acceptCommand(req)
+ return req.threadRequest(self.do_snapshot_list, op, req)
+
+ def do_snapshot_list(self, _, req):
+ return self.xd.domain_snapshot_list(self.dom.domid)
+
+ def op_snapshot_apply(self, op, req):
+ self.acceptCommand(req)
+ return req.threadRequest(self.do_snapshot_apply, op, req)
+
+ def do_snapshot_apply(self, _, req):
+ return self.xd.domain_snapshot_apply(self.dom.domid, req.args)
+
+ def op_snapshot_delete(self, op, req):
+ self.acceptCommand(req)
+ return req.threadRequest(self.do_snapshot_delete, op, req)
+
+ def do_snapshot_delete(self, _, req):
+ return self.xd.domain_snapshot_delete(self.dom.domid, req.args)
+
def op_dump(self, op, req):
self.acceptCommand(req)
return req.threadRequest(self.do_dump, op, req)
Index: xen-3.3.0-testing/tools/python/xen/xend/XendCheckpoint.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendCheckpoint.py
@@ -65,10 +65,12 @@ def insert_after(list, pred, value):
return
-def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1):
+def save(fd, dominfo, network, live, dst, checkpoint=False, node=-1, name=None, diskonly=False):
write_exact(fd, SIGNATURE, "could not write guest state file: signature")
sxprep = dominfo.sxpr()
+ if name:
+ sxprep.append(['snapshotname', name])
if node > -1:
insert_after(sxprep,'vcpus',['node', str(node)])
@@ -91,52 +93,58 @@ def save(fd, dominfo, network, live, dst
image_cfg = dominfo.info.get('image', {})
hvm = dominfo.info.is_hvm()
- # xc_save takes three customization parameters: maxit, max_f, and
- # flags the last controls whether or not save is 'live', while the
- # first two further customize behaviour when 'live' save is
- # enabled. Passing "0" simply uses the defaults compiled into
- # libxenguest; see the comments and/or code in xc_linux_save() for
- # more information.
- cmd = [xen.util.auxbin.pathTo(XC_SAVE), str(fd),
- str(dominfo.getDomid()), "0", "0",
- str(int(live) | (int(hvm) << 2)) ]
- log.debug("[xc_save]: %s", string.join(cmd))
-
- def saveInputHandler(line, tochild):
- log.debug("In saveInputHandler %s", line)
- if line == "suspend":
- log.debug("Suspending %d ...", dominfo.getDomid())
- dominfo.shutdown('suspend')
- dominfo.waitForShutdown()
- if line in ('suspend', 'suspended'):
- dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP2,
- domain_name)
- log.info("Domain %d suspended.", dominfo.getDomid())
- dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP3,
- domain_name)
- if hvm:
- dominfo.image.saveDeviceModel()
-
- if line == "suspend":
- tochild.write("done\n")
- tochild.flush()
- log.debug('Written done')
-
- forkHelper(cmd, fd, saveInputHandler, False)
-
- # put qemu device model state
- if os.path.exists("/var/lib/xen/qemu-save.%d" % dominfo.getDomid()):
- write_exact(fd, QEMU_SIGNATURE, "could not write qemu signature")
- qemu_fd = os.open("/var/lib/xen/qemu-save.%d" % dominfo.getDomid(),
- os.O_RDONLY)
- while True:
- buf = os.read(qemu_fd, dm_batch)
- if len(buf):
- write_exact(fd, buf, "could not write device model state")
- else:
- break
- os.close(qemu_fd)
- os.remove("/var/lib/xen/qemu-save.%d" % dominfo.getDomid())
+ if not diskonly:
+ # xc_save takes three customization parameters: maxit, max_f, and
+ # flags the last controls whether or not save is 'live', while the
+ # first two further customize behaviour when 'live' save is
+ # enabled. Passing "0" simply uses the defaults compiled into
+ # libxenguest; see the comments and/or code in xc_linux_save() for
+ # more information.
+ cmd = [xen.util.auxbin.pathTo(XC_SAVE), str(fd),
+ str(dominfo.getDomid()), "0", "0",
+ str(int(live) | (int(hvm) << 2)) ]
+ log.debug("[xc_save]: %s", string.join(cmd))
+
+ def saveInputHandler(line, tochild):
+ log.debug("In saveInputHandler %s", line)
+ if line == "suspend":
+ log.debug("Suspending %d ...", dominfo.getDomid())
+ dominfo.shutdown('suspend')
+ dominfo.waitForShutdown()
+ if line in ('suspend', 'suspended'):
+ dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP2,
+ domain_name)
+ log.info("Domain %d suspended.", dominfo.getDomid())
+ dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP3,
+ domain_name)
+ if hvm:
+ dominfo.image.saveDeviceModel()
+
+ if line == "suspend":
+ tochild.write("done\n")
+ tochild.flush()
+ log.debug('Written done')
+
+ forkHelper(cmd, fd, saveInputHandler, False)
+
+ # put qemu device model state
+ if os.path.exists("/var/lib/xen/qemu-save.%d" % dominfo.getDomid()):
+ write_exact(fd, QEMU_SIGNATURE, "could not write qemu signature")
+ qemu_fd = os.open("/var/lib/xen/qemu-save.%d" % dominfo.getDomid(),
+ os.O_RDONLY)
+ while True:
+ buf = os.read(qemu_fd, dm_batch)
+ if len(buf):
+ write_exact(fd, buf, "could not write device model state")
+ else:
+ break
+ os.close(qemu_fd)
+ os.remove("/var/lib/xen/qemu-save.%d" % dominfo.getDomid())
+ else:
+ dominfo.shutdown('suspend')
+ dominfo.waitForShutdown()
+ dominfo.image.snapshotDeviceModel(name)
+
if checkpoint:
dominfo.resumeDomain()
@@ -193,6 +201,59 @@ def restore(xd, fd, dominfo = None, paus
if othervm is not None and othervm.domid is not None:
raise VmError("Domain '%s' already exists with ID '%d'" % (domconfig["name_label"], othervm.domid))
+ def contains_state(fd):
+ cur = os.lseek(fd, 0, 1)
+ end = os.lseek(fd, 0, 2)
+
+ ret = False
+ if cur < end:
+ ret = True
+
+ os.lseek(fd, cur, 0)
+ return ret
+
+ #
+ # We shouldn't hold the domains_lock over a waitForDevices
+ # As this function sometime gets called holding this lock,
+ # we must release it and re-acquire it appropriately
+ #
+ def wait_devs(dominfo):
+ from xen.xend import XendDomain
+
+ lock = True;
+ try:
+ XendDomain.instance().domains_lock.release()
+ except:
+ lock = False;
+
+ try:
+ dominfo.waitForDevices() # Wait for backends to set up
+ except Exception, exn:
+ log.exception(exn)
+
+ if lock:
+ XendDomain.instance().domains_lock.acquire()
+
+
+ if not contains_state(fd):
+ # Disk-only snapshot. Just start the vm from config (which should
+ # contain snapshotname.
+ if dominfo:
+ log.debug("### starting domain directly through XendDomainInfo")
+ dominfo.start()
+ else:
+ # Warning! Do we need to call into XendDomain to get domain
+ # lock? Similar to the xd.restore_() call below?
+ # We'll try XendDomain.domain_create()
+ log.debug("### starting domain through XendDomain.create()")
+ dominfo = xd.domain_create(vmconfig)
+
+ wait_devs(dominfo)
+ dominfo.unpause()
+
+ # Done if disk only snapshot
+ return dominfo
+
if dominfo:
dominfo.resume()
else:
@@ -308,27 +369,8 @@ def restore(xd, fd, dominfo = None, paus
dominfo.completeRestore(handler.store_mfn, handler.console_mfn)
- #
- # We shouldn't hold the domains_lock over a waitForDevices
- # As this function sometime gets called holding this lock,
- # we must release it and re-acquire it appropriately
- #
- from xen.xend import XendDomain
-
- lock = True;
- try:
- XendDomain.instance().domains_lock.release()
- except:
- lock = False;
-
- try:
- dominfo.waitForDevices() # Wait for backends to set up
- except Exception, exn:
- log.exception(exn)
-
- if lock:
- XendDomain.instance().domains_lock.acquire()
-
+ wait_devs(dominfo)
+
if not paused:
dominfo.unpause()
Index: xen-3.3.0-testing/tools/python/xen/xend/XendConfig.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendConfig.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendConfig.py
@@ -207,6 +207,7 @@ XENAPI_CFG_TYPES = {
'pci': str,
'cpuid' : dict,
'cpuid_check' : dict,
+ 'snapshotname': str,
}
# List of legacy configuration keys that have no equivalent in the
Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomain.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomain.py
+++ xen-3.3.0-testing/tools/python/xen/xend/XendDomain.py
@@ -1396,6 +1396,148 @@ class XendDomain:
raise XendError("can't write guest state file %s: %s" %
(dst, ex[1]))
+ def domain_snapshot_create(self, domid, name, diskonly=False):
+ """Snapshot a running domain.
+
+ @param domid: Domain ID or Name
+ @type domid: int or string.
+ @param name: Snapshot name
+ @type dst: string
+ @param diskonly: Snapshot disk only - exclude machine state
+ @type dst: bool
+ @rtype: None
+ @raise XendError: Failed to snapshot domain
+ @raise XendInvalidDomain: Domain is not valid
+ """
+ try:
+ dominfo = self.domain_lookup_nr(domid)
+ if not dominfo:
+ raise XendInvalidDomain(str(domid))
+
+ if dominfo.getDomid() == DOM0_ID:
+ raise XendError("Cannot snapshot privileged domain %s" % str(domid))
+ if dominfo._stateGet() != DOM_STATE_RUNNING:
+ raise VMBadState("Domain is not running",
+ POWER_STATE_NAMES[DOM_STATE_RUNNING],
+ POWER_STATE_NAMES[dominfo._stateGet()])
+
+ snap_path = os.path.join(xoptions.get_xend_domains_path(),
+ dominfo.get_uuid(), "snapshots")
+ mkdir.parents(snap_path, stat.S_IRWXU)
+ snap_file = os.path.join(snap_path, name)
+
+
+ oflags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
+ if hasattr(os, "O_LARGEFILE"):
+ oflags |= os.O_LARGEFILE
+ fd = os.open(snap_file, oflags)
+ try:
+ XendCheckpoint.save(fd, dominfo, False, False, snap_file,
+ True, name=name, diskonly=diskonly)
+ except Exception, e:
+ os.close(fd)
+ raise e
+ os.close(fd)
+ except OSError, ex:
+ raise XendError("can't write guest state file %s: %s" %
+ (snap_file, ex[1]))
+
+ def domain_snapshot_list(self, domid):
+ """List available snapshots for a domain.
+
+ @param domid: Domain ID or Name
+ @type domid: int or string.
+ @rtype: list of snapshot names
+ @raise XendInvalidDomain: Domain is not valid
+ """
+ try:
+ dominfo = self.domain_lookup_nr(domid)
+ if not dominfo:
+ raise XendInvalidDomain(str(domid))
+
+ snap_path = os.path.join(xoptions.get_xend_domains_path(),
+ dominfo.get_uuid(), "snapshots")
+
+ if not os.access(snap_path, os.R_OK):
+ return []
+
+ return os.listdir(snap_path)
+
+ except:
+ return []
+
+ def domain_snapshot_apply(self, domid, name):
+ """Start a domain from snapshot
+
+ @param domid: Domain ID or Name
+ @type domid: int or string.
+ @param name: Snapshot name
+ @type dst: string
+ @rtype: None
+ @raise XendError: Failed to apply snapshot
+ @raise XendInvalidDomain: Domain is not valid
+ """
+ try:
+ dominfo = self.domain_lookup_nr(domid)
+ if not dominfo:
+ log.debug("## no dominfo")
+ raise XendInvalidDomain(str(domid))
+
+ if dominfo.getDomid() == DOM0_ID:
+ raise XendError("Cannot apply snapshots to privileged domain %s" % str(domid))
+ if dominfo._stateGet() != DOM_STATE_HALTED:
+ raise VMBadState("Domain is not halted",
+ POWER_STATE_NAMES[DOM_STATE_HALTED],
+ POWER_STATE_NAMES[dominfo._stateGet()])
+
+ snap_file = os.path.join(xoptions.get_xend_domains_path(),
+ dominfo.get_uuid(), "snapshots", name)
+ if not os.access(snap_file, os.R_OK):
+ raise XendError("Unable to access snapshot %s for domain %s" %
+ (name, str(domid)))
+
+ oflags = os.O_RDONLY
+ if hasattr(os, "O_LARGEFILE"):
+ oflags |= os.O_LARGEFILE
+ fd = os.open(snap_file, oflags)
+ try:
+ self.domain_restore_fd(fd)
+ finally:
+ os.close(fd)
+ except OSError, ex:
+ raise XendError("Unable to read snapshot file file %s: %s" %
+ (snap_file, ex[1]))
+
+ def domain_snapshot_delete(self, domid, name):
+ """Delete domain snapshot
+
+ @param domid: Domain ID or Name
+ @type domid: int or string.
+ @param name: Snapshot name
+ @type domid: string
+ @rtype: None
+ @raise XendInvalidDomain: Domain is not valid
+ """
+ try:
+ dominfo = self.domain_lookup_nr(domid)
+ if not dominfo:
+ raise XendInvalidDomain(str(domid))
+
+ snap_file = os.path.join(xoptions.get_xend_domains_path(),
+ dominfo.get_uuid(), "snapshots", name)
+
+ if not os.access(snap_file, os.F_OK):
+ raise XendError("Snapshot %s does not exist for domain %s" %
+ (name, str(domid)))
+
+ # Warning!
+ # Need to "remove" snapshot from qcow2 image file. How
+ # should we do this?
+ os.unlink(snap_file)
+
+ except:
+ return
+
def domain_pincpu(self, domid, vcpu, cpumap):
"""Set which cpus vcpu can use
Index: xen-3.3.0-testing/tools/python/xen/xm/main.py
===================================================================
--- xen-3.3.0-testing.orig/tools/python/xen/xm/main.py
+++ xen-3.3.0-testing/tools/python/xen/xm/main.py
@@ -113,6 +113,14 @@ SUBCOMMAND_HELP = {
'Restore a domain from a saved state.'),
'save' : ('[-c] <Domain> <CheckpointFile>',
'Save a domain state to restore later.'),
+ 'snapshot-create' : ('[-d] <Domain> <SnapshotName>',
+ 'Snapshot a running domain.'),
+ 'snapshot-list' : ('<Domain>',
+ 'List available snapshots for a domain.'),
+ 'snapshot-apply' : ('<Domain> <SnapshotName>',
+ 'Apply previous snapshot to domain.'),
+ 'snapshot-delete' : ('<Domain> <SnapshotName>',
+ 'Delete snapshot of domain.'),
'shutdown' : ('<Domain> [-waRH]', 'Shutdown a domain.'),
'top' : ('', 'Monitor a host and the domains in real time.'),
'unpause' : ('<Domain>', 'Unpause a paused domain.'),
@@ -262,6 +270,9 @@ SUBCOMMAND_OPTIONS = {
'save': (
('-c', '--checkpoint', 'Leave domain running after creating snapshot'),
),
+ 'snapshot-create': (
+ ('-d', '--diskonly', 'Perform disk only snapshot of domain'),
+ ),
'restore': (
('-p', '--paused', 'Do not unpause domain after restoring it'),
),
@@ -287,6 +298,10 @@ common_commands = [
"restore",
"resume",
"save",
+ "snapshot-create",
+ "snapshot-list",
+ "snapshot-apply",
+ "snapshot-delete",
"shell",
"shutdown",
"start",
@@ -317,6 +332,10 @@ domain_commands = [
"restore",
"resume",
"save",
+ "snapshot-create",
+ "snapshot-list",
+ "snapshot-apply",
+ "snapshot-delete",
"shutdown",
"start",
"suspend",
@@ -707,6 +726,62 @@ def xm_event_monitor(args):
#
#########################################################################
+def xm_snapshot_create(args):
+
+ arg_check(args, "snapshot-create", 2, 3)
+
+ try:
+ (options, params) = getopt.gnu_getopt(args, 'd', ['diskonly'])
+ except getopt.GetoptError, opterr:
+ err(opterr)
+ sys.exit(1)
+
+ diskonly = False
+ for (k, v) in options:
+ if k in ['-d', '--diskonly']:
+ diskonly = True
+
+ if len(params) != 2:
+ err("Wrong number of parameters")
+ usage('snapshot-create')
+
+ if serverType == SERVER_XEN_API:
+ server.xenapi.VM.snapshot_create(get_single_vm(params[0]), params[1], diskonly)
+ else:
+ server.xend.domain.snapshot_create(params[0], params[1], diskonly)
+
+def xm_snapshot_list(args):
+ arg_check(args, "snapshot-list", 1, 2)
+
+ snapshots = None
+ if serverType == SERVER_XEN_API:
+ snapshots = server.xenapi.VM.snapshot_list(get_single_vm(args[0]))
+ else:
+ snapshots = server.xend.domain.snapshot_list(args[0])
+
+ if snapshots:
+ print "Available snapshots for domain %s" % args[0]
+ for snapshot in snapshots:
+ print " %s" % snapshot
+ else:
+ print "No snapshot available for domain %s" % args[0]
+
+def xm_snapshot_apply(args):
+ arg_check(args, "snapshot-apply", 2, 3)
+
+ if serverType == SERVER_XEN_API:
+ server.xenapi.VM.snapshot_apply(get_single_vm(args[0]), args[1])
+ else:
+ server.xend.domain.snapshot_apply(args[0], args[1])
+
+def xm_snapshot_delete(args):
+ arg_check(args, "snapshot-delete", 2, 3)
+
+ if serverType == SERVER_XEN_API:
+ server.xenapi.VM.snapshot_delete(get_single_vm(args[0]), args[1])
+ else:
+ server.xend.domain.snapshot_delete(args[0], args[1])
+
def xm_save(args):
arg_check(args, "save", 2, 3)
@@ -2600,6 +2675,10 @@ commands = {
"restore": xm_restore,
"resume": xm_resume,
"save": xm_save,
+ "snapshot-create": xm_snapshot_create,
+ "snapshot-list": xm_snapshot_list,
+ "snapshot-apply": xm_snapshot_apply,
+ "snapshot-delete": xm_snapshot_delete,
"shutdown": xm_shutdown,
"start": xm_start,
"sysrq": xm_sysrq,

View File

@ -0,0 +1,26 @@
Index: xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/drivers/blktapctrl.c
+++ xen-3.3.0-testing/tools/blktap/drivers/blktapctrl.c
@@ -127,7 +127,7 @@ static int get_new_dev(int *major, int *
char *devname;
tr.domid = blkif->domid;
- tr.busid = blkif->be_id;
+ tr.busid = (unsigned short) blkif->be_id;
ret = ioctl(ctlfd, BLKTAP_IOCTL_NEWINTF, tr );
if ( (ret <= 0)||(ret > MAX_TAP_DEV) ) {
Index: xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
===================================================================
--- xen-3.3.0-testing.orig/tools/blktap/lib/blktaplib.h
+++ xen-3.3.0-testing/tools/blktap/lib/blktaplib.h
@@ -161,7 +161,7 @@ typedef struct tapdev_info {
typedef struct domid_translate {
unsigned short domid;
- uint32_t busid;
+ unsigned short busid;
} domid_translate_t ;
typedef struct image {

View File

@ -23,22 +23,22 @@ Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
tools/xcutils/xc_kexec.c | 503 +++++++++++++++ tools/xcutils/xc_kexec.c | 503 +++++++++++++++
19 files changed, 4988 insertions(+), 2 deletions(-) 19 files changed, 4988 insertions(+), 2 deletions(-)
Index: xen-3.2-testing/tools/xcutils/Makefile Index: xen-3.3.0-testing/tools/xcutils/Makefile
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/xcutils/Makefile --- xen-3.3.0-testing.orig/tools/xcutils/Makefile
+++ xen-3.2-testing/tools/xcutils/Makefile +++ xen-3.3.0-testing/tools/xcutils/Makefile
@@ -22,7 +22,7 @@ CFLAGS += $(INCLUDES) @@ -18,7 +18,7 @@ CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_
CFLAGS += -Wp,-MD,.$(@F).d CFLAGS += -Wp,-MD,.$(@F).d
PROG_DEP = .*.d PROG_DEP = .*.d
-PROGRAMS = xc_restore xc_save readnotes -PROGRAMS = xc_restore xc_save readnotes lsevtchn
+PROGRAMS = xc_restore xc_save readnotes xc_kexec +PROGRAMS = xc_restore xc_save readnotes lsevtchn xc_kexec
LDLIBS = -L$(XEN_LIBXC) -L$(XEN_XENSTORE) -lxenguest -lxenctrl -lxenstore LDLIBS = $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenguest) $(LDFLAGS_libxenstore)
@@ -35,6 +35,11 @@ build: $(PROGRAMS) @@ -31,6 +31,11 @@ build: $(PROGRAMS)
$(PROGRAMS): %: %.o $(PROGRAMS): %: %.o
$(CC) $(CFLAGS) $^ $(LDLIBS) -o $@ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
+xc_kexec.o: xc_kexec.c helper/blob.h +xc_kexec.o: xc_kexec.c helper/blob.h
+ +
@ -47,18 +47,18 @@ Index: xen-3.2-testing/tools/xcutils/Makefile
+ +
.PHONY: install .PHONY: install
install: build install: build
[ -d $(DESTDIR)$(PROGRAMS_INSTALL_DIR) ] || \ $(INSTALL_DIR) $(DESTDIR)$(PRIVATE_BINDIR)
@@ -46,5 +51,6 @@ install: build @@ -41,5 +46,6 @@ install: build
clean: clean:
$(RM) *.o $(PROGRAMS) $(RM) *.o $(PROGRAMS)
$(RM) $(PROG_DEP) $(RM) $(PROG_DEP)
+ make -C helper clean + make -C helper clean
-include $(PROG_DEP) -include $(PROG_DEP)
Index: xen-3.2-testing/tools/xcutils/helper/Makefile Index: xen-3.3.0-testing/tools/xcutils/helper/Makefile
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/Makefile +++ xen-3.3.0-testing/tools/xcutils/helper/Makefile
@@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
+ +
+XEN_ROOT = ../../.. +XEN_ROOT = ../../..
@ -99,10 +99,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/Makefile
+# dependencies +# dependencies
+ +
+$(XEN_TARGET_ARCH)/entry.o: $(XEN_TARGET_ARCH)/entry.S $(XEN_TARGET_ARCH)/offsets.h +$(XEN_TARGET_ARCH)/entry.o: $(XEN_TARGET_ARCH)/entry.S $(XEN_TARGET_ARCH)/offsets.h
Index: xen-3.2-testing/tools/xcutils/helper/console.c Index: xen-3.3.0-testing/tools/xcutils/helper/console.c
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/console.c +++ xen-3.3.0-testing/tools/xcutils/helper/console.c
@@ -0,0 +1,69 @@ @@ -0,0 +1,69 @@
+#include <inttypes.h> +#include <inttypes.h>
+ +
@ -173,10 +173,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/console.c
+ +
+ return printed_len; + return printed_len;
+} +}
Index: xen-3.2-testing/tools/xcutils/helper/ctype.c Index: xen-3.3.0-testing/tools/xcutils/helper/ctype.c
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/ctype.c +++ xen-3.3.0-testing/tools/xcutils/helper/ctype.c
@@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
+/* +/*
+ * linux/lib/ctype.c + * linux/lib/ctype.c
@ -213,10 +213,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/ctype.c
+_L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */ +_L,_L,_L,_L,_L,_L,_L,_P,_L,_L,_L,_L,_L,_L,_L,_L}; /* 240-255 */
+ +
+EXPORT_SYMBOL(_ctype); +EXPORT_SYMBOL(_ctype);
Index: xen-3.2-testing/tools/xcutils/helper/ctype.h Index: xen-3.3.0-testing/tools/xcutils/helper/ctype.h
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/ctype.h +++ xen-3.3.0-testing/tools/xcutils/helper/ctype.h
@@ -0,0 +1,54 @@ @@ -0,0 +1,54 @@
+#ifndef _LINUX_CTYPE_H +#ifndef _LINUX_CTYPE_H
+#define _LINUX_CTYPE_H +#define _LINUX_CTYPE_H
@ -272,10 +272,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/ctype.h
+#define toupper(c) __toupper(c) +#define toupper(c) __toupper(c)
+ +
+#endif +#endif
Index: xen-3.2-testing/tools/xcutils/helper/helper.h Index: xen-3.3.0-testing/tools/xcutils/helper/helper.h
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/helper.h +++ xen-3.3.0-testing/tools/xcutils/helper/helper.h
@@ -0,0 +1,107 @@ @@ -0,0 +1,107 @@
+#include <stdarg.h> +#include <stdarg.h>
+#include <stddef.h> +#include <stddef.h>
@ -384,10 +384,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/helper.h
+int sprintf(char * buf, const char *fmt, ...); +int sprintf(char * buf, const char *fmt, ...);
+int vsscanf(const char * buf, const char * fmt, va_list args); +int vsscanf(const char * buf, const char * fmt, va_list args);
+int sscanf(const char * buf, const char * fmt, ...); +int sscanf(const char * buf, const char * fmt, ...);
Index: xen-3.2-testing/tools/xcutils/helper/main.c Index: xen-3.3.0-testing/tools/xcutils/helper/main.c
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/main.c +++ xen-3.3.0-testing/tools/xcutils/helper/main.c
@@ -0,0 +1,651 @@ @@ -0,0 +1,651 @@
+#include <xenctrl.h> +#include <xenctrl.h>
+#include "hypercall.h" +#include "hypercall.h"
@ -1040,10 +1040,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/main.c
+ printk("\r\n"); + printk("\r\n");
+ start_kernel(); + start_kernel();
+} +}
Index: xen-3.2-testing/tools/xcutils/helper/make-offsets.c Index: xen-3.3.0-testing/tools/xcutils/helper/make-offsets.c
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/make-offsets.c +++ xen-3.3.0-testing/tools/xcutils/helper/make-offsets.c
@@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
+#include <stdio.h> +#include <stdio.h>
+#include <xenctrl.h> +#include <xenctrl.h>
@ -1073,10 +1073,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/make-offsets.c
+ vcpu_off("cr3", ctrlreg[3]); + vcpu_off("cr3", ctrlreg[3]);
+ return 0; + return 0;
+} +}
Index: xen-3.2-testing/tools/xcutils/helper/printk.c Index: xen-3.3.0-testing/tools/xcutils/helper/printk.c
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/printk.c +++ xen-3.3.0-testing/tools/xcutils/helper/printk.c
@@ -0,0 +1,1051 @@ @@ -0,0 +1,1051 @@
+/* +/*
+ * linux/kernel/printk.c + * linux/kernel/printk.c
@ -2129,10 +2129,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/printk.c
+ printk_ratelimit_burst); + printk_ratelimit_burst);
+} +}
+EXPORT_SYMBOL(printk_ratelimit); +EXPORT_SYMBOL(printk_ratelimit);
Index: xen-3.2-testing/tools/xcutils/helper/string.c Index: xen-3.3.0-testing/tools/xcutils/helper/string.c
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/string.c +++ xen-3.3.0-testing/tools/xcutils/helper/string.c
@@ -0,0 +1,601 @@ @@ -0,0 +1,601 @@
+/* +/*
+ * linux/lib/string.c + * linux/lib/string.c
@ -2735,10 +2735,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/string.c
+} +}
+EXPORT_SYMBOL(memchr); +EXPORT_SYMBOL(memchr);
+#endif +#endif
Index: xen-3.2-testing/tools/xcutils/helper/vsprintf.c Index: xen-3.3.0-testing/tools/xcutils/helper/vsprintf.c
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/vsprintf.c +++ xen-3.3.0-testing/tools/xcutils/helper/vsprintf.c
@@ -0,0 +1,842 @@ @@ -0,0 +1,842 @@
+/* +/*
+ * linux/lib/vsprintf.c + * linux/lib/vsprintf.c
@ -3582,10 +3582,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/vsprintf.c
+} +}
+ +
+EXPORT_SYMBOL(sscanf); +EXPORT_SYMBOL(sscanf);
Index: xen-3.2-testing/tools/xcutils/helper/x86_32/div64.h Index: xen-3.3.0-testing/tools/xcutils/helper/x86_32/div64.h
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/x86_32/div64.h +++ xen-3.3.0-testing/tools/xcutils/helper/x86_32/div64.h
@@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
+#ifndef __I386_DIV64 +#ifndef __I386_DIV64
+#define __I386_DIV64 +#define __I386_DIV64
@ -3635,10 +3635,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/x86_32/div64.h
+ +
+} +}
+#endif +#endif
Index: xen-3.2-testing/tools/xcutils/helper/x86_32/entry.S Index: xen-3.3.0-testing/tools/xcutils/helper/x86_32/entry.S
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/x86_32/entry.S +++ xen-3.3.0-testing/tools/xcutils/helper/x86_32/entry.S
@@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
+#include "offsets.h" +#include "offsets.h"
+ +
@ -3689,10 +3689,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/x86_32/entry.S
+ nop + nop
+ .align 4096 + .align 4096
+hypercall_end: +hypercall_end:
Index: xen-3.2-testing/tools/xcutils/helper/x86_32/hypercall.h Index: xen-3.3.0-testing/tools/xcutils/helper/x86_32/hypercall.h
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/x86_32/hypercall.h +++ xen-3.3.0-testing/tools/xcutils/helper/x86_32/hypercall.h
@@ -0,0 +1,359 @@ @@ -0,0 +1,359 @@
+/****************************************************************************** +/******************************************************************************
+ * hypercall.h + * hypercall.h
@ -4053,10 +4053,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/x86_32/hypercall.h
+ +
+ +
+#endif /* __HYPERCALL_H__ */ +#endif /* __HYPERCALL_H__ */
Index: xen-3.2-testing/tools/xcutils/helper/x86_64/div64.h Index: xen-3.3.0-testing/tools/xcutils/helper/x86_64/div64.h
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/x86_64/div64.h +++ xen-3.3.0-testing/tools/xcutils/helper/x86_64/div64.h
@@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
+#ifndef _ASM_GENERIC_DIV64_H +#ifndef _ASM_GENERIC_DIV64_H
+#define _ASM_GENERIC_DIV64_H +#define _ASM_GENERIC_DIV64_H
@ -4115,10 +4115,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/x86_64/div64.h
+#endif /* BITS_PER_LONG */ +#endif /* BITS_PER_LONG */
+ +
+#endif /* _ASM_GENERIC_DIV64_H */ +#endif /* _ASM_GENERIC_DIV64_H */
Index: xen-3.2-testing/tools/xcutils/helper/x86_64/entry.S Index: xen-3.3.0-testing/tools/xcutils/helper/x86_64/entry.S
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/x86_64/entry.S +++ xen-3.3.0-testing/tools/xcutils/helper/x86_64/entry.S
@@ -0,0 +1,50 @@ @@ -0,0 +1,50 @@
+#include "offsets.h" +#include "offsets.h"
+ +
@ -4170,10 +4170,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/x86_64/entry.S
+ nop + nop
+ .align 4096 + .align 4096
+hypercall_end: +hypercall_end:
Index: xen-3.2-testing/tools/xcutils/helper/x86_64/hypercall.h Index: xen-3.3.0-testing/tools/xcutils/helper/x86_64/hypercall.h
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/helper/x86_64/hypercall.h +++ xen-3.3.0-testing/tools/xcutils/helper/x86_64/hypercall.h
@@ -0,0 +1,354 @@ @@ -0,0 +1,354 @@
+/****************************************************************************** +/******************************************************************************
+ * hypercall.h + * hypercall.h
@ -4529,10 +4529,10 @@ Index: xen-3.2-testing/tools/xcutils/helper/x86_64/hypercall.h
+} +}
+ +
+#endif /* __HYPERCALL_H__ */ +#endif /* __HYPERCALL_H__ */
Index: xen-3.2-testing/tools/xcutils/kexec-syscall.h Index: xen-3.3.0-testing/tools/xcutils/kexec-syscall.h
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/kexec-syscall.h +++ xen-3.3.0-testing/tools/xcutils/kexec-syscall.h
@@ -0,0 +1,80 @@ @@ -0,0 +1,80 @@
+#ifndef KEXEC_SYSCALL_H +#ifndef KEXEC_SYSCALL_H
+#define KEXEC_SYSCALL_H +#define KEXEC_SYSCALL_H
@ -4614,10 +4614,10 @@ Index: xen-3.2-testing/tools/xcutils/kexec-syscall.h
+#define KEXEC_MAX_SEGMENTS 16 +#define KEXEC_MAX_SEGMENTS 16
+ +
+#endif /* KEXEC_SYSCALL_H */ +#endif /* KEXEC_SYSCALL_H */
Index: xen-3.2-testing/tools/xcutils/xc_kexec.c Index: xen-3.3.0-testing/tools/xcutils/xc_kexec.c
=================================================================== ===================================================================
--- /dev/null --- /dev/null
+++ xen-3.2-testing/tools/xcutils/xc_kexec.c +++ xen-3.3.0-testing/tools/xcutils/xc_kexec.c
@@ -0,0 +1,503 @@ @@ -0,0 +1,503 @@
+#include <stdio.h> +#include <stdio.h>
+#include <stdlib.h> +#include <stdlib.h>

View File

@ -1,7 +1,7 @@
Index: xen-3.2.1-testing/tools/ioemu/sdl_keysym.h Index: xen-3.3.0-testing/tools/ioemu/sdl_keysym.h
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/sdl_keysym.h --- xen-3.3.0-testing.orig/tools/ioemu/sdl_keysym.h
+++ xen-3.2.1-testing/tools/ioemu/sdl_keysym.h +++ xen-3.3.0-testing/tools/ioemu/sdl_keysym.h
@@ -274,5 +274,27 @@ static name2keysym_t name2keysym[]={ @@ -274,5 +274,27 @@ static name2keysym_t name2keysym[]={
{"Pause", SDLK_PAUSE}, {"Pause", SDLK_PAUSE},
{"Escape", SDLK_ESCAPE}, {"Escape", SDLK_ESCAPE},
@ -30,12 +30,12 @@ Index: xen-3.2.1-testing/tools/ioemu/sdl_keysym.h
{0,0}, {0,0},
}; };
+ +
Index: xen-3.2.1-testing/tools/python/xen/xend/XendOptions.py Index: xen-3.3.0-testing/tools/python/xen/xend/XendOptions.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendOptions.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/XendOptions.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendOptions.py +++ xen-3.3.0-testing/tools/python/xen/xend/XendOptions.py
@@ -315,6 +315,9 @@ class XendOptions: @@ -359,6 +359,9 @@ class XendOptions:
return self.get_config_string('vnc-x509-verify', self.xend_vnc_x509_verify) self.qemu_dm_logrotate_count)
+ def get_keymap(self): + def get_keymap(self):
@ -44,12 +44,12 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendOptions.py
class XendOptionsFile(XendOptions): class XendOptionsFile(XendOptions):
"""Default path to the config file.""" """Default path to the config file."""
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py +++ xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -1561,6 +1561,9 @@ class XendDomainInfo: @@ -1912,6 +1912,9 @@ class XendDomainInfo:
if devclass in XendDevices.valid_devices(): if devclass in XendDevices.valid_devices() and devclass != 'vscsi':
log.info("createDevice: %s : %s" % (devclass, scrub_password(config))) log.info("createDevice: %s : %s" % (devclass, scrub_password(config)))
dev_uuid = config.get('uuid') dev_uuid = config.get('uuid')
+ if 'keymap' not in config: + if 'keymap' not in config:

View File

@ -1,341 +0,0 @@
Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/vmx/vmcs.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
@@ -38,6 +38,9 @@
#include <asm/shadow.h>
#include <asm/tboot.h>
+static int opt_vpid_enabled = 1;
+boolean_param("vpid", opt_vpid_enabled);
+
/* Dynamic (run-time adjusted) execution control flags. */
u32 vmx_pin_based_exec_control __read_mostly;
u32 vmx_cpu_based_exec_control __read_mostly;
@@ -112,6 +115,8 @@ static void vmx_init_vmcs_config(void)
opt2 = SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
SECONDARY_EXEC_WBINVD_EXITING |
SECONDARY_EXEC_ENABLE_EPT;
+ if ( opt_vpid_enabled )
+ opt2 |= SECONDARY_EXEC_ENABLE_VPID;
_vmx_secondary_exec_control = adjust_vmx_controls(
min2, opt2, MSR_IA32_VMX_PROCBASED_CTLS2);
@@ -317,6 +322,8 @@ int vmx_cpu_up(void)
ept_sync_all();
+ vpid_sync_all();
+
return 1;
}
@@ -630,6 +637,13 @@ static int construct_vmcs(struct vcpu *v
#endif
}
+ if ( cpu_has_vmx_vpid )
+ {
+ v->arch.hvm_vmx.vpid = v->vcpu_id +
+ v->domain->arch.hvm_domain.vmx_vpid_base;
+ __vmwrite(VIRTUAL_PROCESSOR_ID, v->arch.hvm_vmx.vpid);
+ }
+
vmx_vmcs_exit(v);
paging_update_paging_modes(v); /* will update HOST & GUEST_CR3 as reqd */
@@ -823,6 +837,7 @@ void vmx_do_resume(struct vcpu *v)
vmx_load_vmcs(v);
hvm_migrate_timers(v);
vmx_set_host_env(v);
+ vpid_sync_vcpu_all(v);
}
debug_state = v->domain->debugger_attached;
@@ -977,6 +992,8 @@ void vmcs_dump_vcpu(struct vcpu *v)
(uint32_t)vmr(TPR_THRESHOLD));
printk("EPT pointer = 0x%08x%08x\n",
(uint32_t)vmr(EPT_POINTER_HIGH), (uint32_t)vmr(EPT_POINTER));
+ printk("virtual processor ID = 0x%04x\n",
+ (uint32_t)vmr(VIRTUAL_PROCESSOR_ID));
vmx_vmcs_exit(v);
}
Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmx.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/vmx/vmx.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmx.c
@@ -57,18 +57,23 @@ static void vmx_ctxt_switch_to(struct vc
static int vmx_alloc_vlapic_mapping(struct domain *d);
static void vmx_free_vlapic_mapping(struct domain *d);
+static int vmx_alloc_vpid(struct domain *d);
+static void vmx_free_vpid(struct domain *d);
static void vmx_install_vlapic_mapping(struct vcpu *v);
static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr);
static void vmx_update_guest_efer(struct vcpu *v);
static int vmx_domain_initialise(struct domain *d)
{
- return vmx_alloc_vlapic_mapping(d);
+ if ( vmx_alloc_vpid(d) == 0 )
+ return vmx_alloc_vlapic_mapping(d);
+ return -EBUSY;
}
static void vmx_domain_destroy(struct domain *d)
{
vmx_free_vlapic_mapping(d);
+ vmx_free_vpid(d);
}
static int vmx_vcpu_initialise(struct vcpu *v)
@@ -1132,6 +1137,7 @@ static void vmx_update_guest_cr(struct v
vmx_load_pdptrs(v);
}
__vmwrite(GUEST_CR3, v->arch.hvm_vcpu.hw_cr[3]);
+ vpid_sync_vcpu_all(v);
break;
case 4:
v->arch.hvm_vcpu.hw_cr[4] = HVM_CR4_HOST_MASK;
@@ -1180,9 +1186,14 @@ static void vmx_update_guest_efer(struct
static void vmx_flush_guest_tlbs(void)
{
- /* No tagged TLB support on VMX yet. The fact that we're in Xen
- * at all means any guest will have a clean TLB when it's next run,
- * because VMRESUME will flush it for us. */
+ /* If VPID (i.e. tagged TLB support) is not enabled, the fact that
+ * we're in Xen at all means any guest will have a clean TLB when
+ * it's next run, because VMRESUME will flush it for us.
+ *
+ * If enabled, we invalidate all translations associated with all
+ * VPID values */
+ if (0)
+ vpid_sync_all();
}
static void vmx_inject_exception(
@@ -1236,6 +1247,11 @@ static struct hvm_function_table vmx_fun
.cpu_down = vmx_cpu_down,
};
+static int vpid_bitmap_size;
+static int vpid_bitmap_bytes;
+static void *vpid_bitmap;
+static spinlock_t vpid_lock;
+
void start_vmx(void)
{
static int bootstrapped;
@@ -1275,6 +1291,26 @@ void start_vmx(void)
vmx_function_table.hap_supported = 1;
}
+ if ( cpu_has_vmx_vpid )
+ {
+ printk("VMX: VPID is available.\n");
+
+ vpid_bitmap_size = (1 << VMCS_VPID_WIDTH) / MAX_VIRT_CPUS;
+ vpid_bitmap_bytes = vpid_bitmap_size / (BITS_PER_LONG / BYTES_PER_LONG);
+ vpid_bitmap = xmalloc_bytes(vpid_bitmap_bytes);
+ memset(vpid_bitmap, 0, vpid_bitmap_bytes);
+ if ( vpid_bitmap == NULL )
+ {
+ printk("VMX: failed to allocate VPID bitmap.\n");
+ return;
+ }
+
+ /* vpid 0 is used by hypervisor itself */
+ set_bit(0, vpid_bitmap);
+
+ spin_lock_init(&vpid_lock);
+ }
+
setup_vmcs_dump();
hvm_enable(&vmx_function_table);
@@ -2534,6 +2570,45 @@ static void vmx_free_vlapic_mapping(stru
free_xenheap_page(mfn_to_virt(mfn));
}
+static int vmx_alloc_vpid(struct domain *d)
+{
+ int vpid;
+
+ if ( !cpu_has_vmx_vpid )
+ return 0;
+
+ spin_lock(&vpid_lock);
+
+ vpid = find_first_zero_bit(vpid_bitmap, vpid_bitmap_size);
+ if ( vpid >= vpid_bitmap_size )
+ {
+ spin_unlock(&vpid_lock);
+ printk("VPID is used up.\n");
+ return -EBUSY;
+ }
+ if ( test_and_set_bit(vpid, vpid_bitmap) )
+ {
+ spin_unlock(&vpid_lock);
+ printk("VPID allocation bug, fix your code!\n");
+ return -EBUSY;
+ }
+
+ spin_unlock(&vpid_lock);
+
+ d->arch.hvm_domain.vmx_vpid_base = vpid * MAX_VIRT_CPUS;
+ return 0;
+}
+
+static void vmx_free_vpid(struct domain *d)
+{
+ if ( !cpu_has_vmx_vpid )
+ return;
+
+ spin_lock(&vpid_lock);
+ clear_bit(d->arch.hvm_domain.vmx_vpid_base / MAX_VIRT_CPUS, vpid_bitmap);
+ spin_unlock(&vpid_lock);
+}
+
static void vmx_install_vlapic_mapping(struct vcpu *v)
{
paddr_t virt_page_ma, apic_page_ma;
Index: xen-3.2.1-testing/xen/arch/x86/mm/shadow/multi.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/shadow/multi.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/shadow/multi.c
@@ -35,6 +35,7 @@
#include <asm/hvm/hvm.h>
#include <asm/hvm/cacheattr.h>
#include <asm/mtrr.h>
+#include <asm/hvm/vmx/vmx.h>
#include "private.h"
#include "types.h"
@@ -3102,6 +3103,7 @@ sh_invlpg(struct vcpu *v, unsigned long
== SH_type_fl1_shadow )
{
flush_tlb_local();
+ vpid_sync_vcpu_all(v);
return 0;
}
Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/domain.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hvm/domain.h
+++ xen-3.2.1-testing/xen/include/asm-x86/hvm/domain.h
@@ -61,6 +61,7 @@ struct hvm_domain {
uint64_t params[HVM_NR_PARAMS];
unsigned long vmx_apic_access_mfn;
+ unsigned long vmx_vpid_base;
/* Memory ranges with pinned cache attributes. */
struct list_head pinned_cacheattr_ranges;
Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmcs.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -89,6 +89,8 @@ struct arch_vmx_struct {
u32 exec_control;
u32 secondary_exec_control;
+ u16 vpid;
+
#ifdef __x86_64__
struct vmx_msr_state msr_state;
unsigned long shadow_gs;
@@ -165,6 +167,7 @@ extern u32 vmx_vmentry_control;
#define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
#define SECONDARY_EXEC_ENABLE_EPT 0x00000002
+#define SECONDARY_EXEC_ENABLE_VPID 0x00000020
#define SECONDARY_EXEC_WBINVD_EXITING 0x00000040
extern u32 vmx_secondary_exec_control;
@@ -184,6 +187,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr
(vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)
#define cpu_has_vmx_ept \
(vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_EPT)
+#define cpu_has_vmx_vpid \
+ (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VPID)
/* GUEST_INTERRUPTIBILITY_INFO flags. */
#define VMX_INTR_SHADOW_STI 0x00000001
@@ -193,6 +198,7 @@ extern bool_t cpu_has_vmx_ins_outs_instr
/* VMCS field encodings. */
enum vmcs_field {
+ VIRTUAL_PROCESSOR_ID = 0x00000000,
GUEST_ES_SELECTOR = 0x00000800,
GUEST_CS_SELECTOR = 0x00000802,
GUEST_SS_SELECTOR = 0x00000804,
@@ -332,6 +338,8 @@ enum vmcs_field {
HOST_RIP = 0x00006c16,
};
+#define VMCS_VPID_WIDTH (16)
+
void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr);
int vmx_read_guest_msr(struct vcpu *v, u32 msr, u64 *val);
int vmx_write_guest_msr(struct vcpu *v, u32 msr, u64 val);
Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmx.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hvm/vmx/vmx.h
+++ xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -175,6 +175,7 @@ int vmx_realmode_io_complete(void);
#define VMRESUME_OPCODE ".byte 0x0f,0x01,0xc3\n"
#define VMWRITE_OPCODE ".byte 0x0f,0x79\n"
#define INVEPT_OPCODE ".byte 0x66,0x0f,0x38,0x80\n" /* m128,r64/32 */
+#define INVVPID_OPCODE ".byte 0x66,0x0f,0x38,0x81\n" /* m128,r64/32 */
#define VMXOFF_OPCODE ".byte 0x0f,0x01,0xc4\n"
#define VMXON_OPCODE ".byte 0xf3,0x0f,0xc7\n"
@@ -280,6 +281,23 @@ static inline void __invept(int ext, u64
: "memory");
}
+static inline void __invvpid(int ext, u16 vpid, u64 gva)
+{
+ struct {
+ u64 vpid:16;
+ u64 rsvd:48;
+ u64 gva;
+ } __attribute__ ((packed)) operand = {vpid, 0, gva};
+
+ __asm__ __volatile__ ( INVVPID_OPCODE
+ MODRM_EAX_08
+ /* CF==1 or ZF==1 --> rc = -1 */
+ "ja 1f ; ud2 ; 1:\n"
+ :
+ : "a" (&operand), "c" (ext)
+ : "memory");
+}
+
static inline void __vmxoff(void)
{
asm volatile (
@@ -332,6 +350,22 @@ static inline void ept_sync_all(void)
__invept(2, 0, 0);
}
+static inline void vpid_sync_vcpu_all(struct vcpu *v)
+{
+ if ( !cpu_has_vmx_vpid )
+ return;
+
+ __invvpid(1, v->arch.hvm_vmx.vpid, 0);
+}
+
+static inline void vpid_sync_all(void)
+{
+ if ( !cpu_has_vmx_vpid )
+ return;
+
+ __invvpid(2, 0, 0);
+}
+
static inline void __vmx_inject_exception(
struct vcpu *v, int trap, int type, int error_code)
{

View File

@ -1,342 +0,0 @@
Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/vmx/vmcs.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
@@ -38,6 +38,9 @@
#include <asm/shadow.h>
#include <asm/tboot.h>
+static int opt_vpid_enabled = 1;
+boolean_param("vpid", opt_vpid_enabled);
+
/* Dynamic (run-time adjusted) execution control flags. */
u32 vmx_pin_based_exec_control __read_mostly;
u32 vmx_cpu_based_exec_control __read_mostly;
@@ -112,6 +115,8 @@ static void vmx_init_vmcs_config(void)
opt2 = SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
SECONDARY_EXEC_WBINVD_EXITING |
SECONDARY_EXEC_ENABLE_EPT;
+ if ( opt_vpid_enabled )
+ opt2 |= SECONDARY_EXEC_ENABLE_VPID;
_vmx_secondary_exec_control = adjust_vmx_controls(
min2, opt2, MSR_IA32_VMX_PROCBASED_CTLS2);
@@ -317,6 +322,8 @@ int vmx_cpu_up(void)
ept_sync_all();
+ vpid_sync_all();
+
return 1;
}
@@ -630,6 +637,13 @@ static int construct_vmcs(struct vcpu *v
#endif
}
+ if ( cpu_has_vmx_vpid )
+ {
+ v->arch.hvm_vmx.vpid = v->vcpu_id +
+ v->domain->arch.hvm_domain.vmx_vpid_base;
+ __vmwrite(VIRTUAL_PROCESSOR_ID, v->arch.hvm_vmx.vpid);
+ }
+
vmx_vmcs_exit(v);
paging_update_paging_modes(v); /* will update HOST & GUEST_CR3 as reqd */
@@ -823,6 +837,7 @@ void vmx_do_resume(struct vcpu *v)
vmx_load_vmcs(v);
hvm_migrate_timers(v);
vmx_set_host_env(v);
+ vpid_sync_vcpu_all(v);
}
debug_state = v->domain->debugger_attached;
@@ -977,6 +992,8 @@ void vmcs_dump_vcpu(struct vcpu *v)
(uint32_t)vmr(TPR_THRESHOLD));
printk("EPT pointer = 0x%08x%08x\n",
(uint32_t)vmr(EPT_POINTER_HIGH), (uint32_t)vmr(EPT_POINTER));
+ printk("virtual processor ID = 0x%04x\n",
+ (uint32_t)vmr(VIRTUAL_PROCESSOR_ID));
vmx_vmcs_exit(v);
}
Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmx.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/vmx/vmx.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmx.c
@@ -58,6 +58,8 @@ static void vmx_ctxt_switch_to(struct vc
static int vmx_alloc_vlapic_mapping(struct domain *d);
static void vmx_free_vlapic_mapping(struct domain *d);
+static int vmx_alloc_vpid(struct domain *d);
+static void vmx_free_vpid(struct domain *d);
static void vmx_install_vlapic_mapping(struct vcpu *v);
static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr);
static void vmx_update_guest_efer(struct vcpu *v);
@@ -65,12 +67,15 @@ static void vmx_update_guest_efer(struct
static int vmx_domain_initialise(struct domain *d)
{
- return vmx_alloc_vlapic_mapping(d);
+ if ( vmx_alloc_vpid(d) == 0 )
+ return vmx_alloc_vlapic_mapping(d);
+ return -EBUSY;
}
static void vmx_domain_destroy(struct domain *d)
{
vmx_free_vlapic_mapping(d);
+ vmx_free_vpid(d);
}
static int vmx_vcpu_initialise(struct vcpu *v)
@@ -1134,6 +1139,7 @@ static void vmx_update_guest_cr(struct v
vmx_load_pdptrs(v);
}
__vmwrite(GUEST_CR3, v->arch.hvm_vcpu.hw_cr[3]);
+ vpid_sync_vcpu_all(v);
break;
case 4:
v->arch.hvm_vcpu.hw_cr[4] = HVM_CR4_HOST_MASK;
@@ -1182,9 +1188,14 @@ static void vmx_update_guest_efer(struct
static void vmx_flush_guest_tlbs(void)
{
- /* No tagged TLB support on VMX yet. The fact that we're in Xen
- * at all means any guest will have a clean TLB when it's next run,
- * because VMRESUME will flush it for us. */
+ /* If VPID (i.e. tagged TLB support) is not enabled, the fact that
+ * we're in Xen at all means any guest will have a clean TLB when
+ * it's next run, because VMRESUME will flush it for us.
+ *
+ * If enabled, we invalidate all translations associated with all
+ * VPID values */
+ if (0)
+ vpid_sync_all();
}
static void vmx_inject_exception(
@@ -1238,6 +1249,11 @@ static struct hvm_function_table vmx_fun
.cpu_down = vmx_cpu_down,
};
+static int vpid_bitmap_size;
+static int vpid_bitmap_bytes;
+static void *vpid_bitmap;
+static spinlock_t vpid_lock;
+
void start_vmx(void)
{
static int bootstrapped;
@@ -1277,6 +1293,26 @@ void start_vmx(void)
vmx_function_table.hap_supported = 1;
}
+ if ( cpu_has_vmx_vpid )
+ {
+ printk("VMX: VPID is available.\n");
+
+ vpid_bitmap_size = (1 << VMCS_VPID_WIDTH) / MAX_VIRT_CPUS;
+ vpid_bitmap_bytes = vpid_bitmap_size / (BITS_PER_LONG / BYTES_PER_LONG);
+ vpid_bitmap = xmalloc_bytes(vpid_bitmap_bytes);
+ memset(vpid_bitmap, 0, vpid_bitmap_bytes);
+ if ( vpid_bitmap == NULL )
+ {
+ printk("VMX: failed to allocate VPID bitmap.\n");
+ return;
+ }
+
+ /* vpid 0 is used by hypervisor itself */
+ set_bit(0, vpid_bitmap);
+
+ spin_lock_init(&vpid_lock);
+ }
+
setup_vmcs_dump();
hvm_enable(&vmx_function_table);
@@ -2542,6 +2578,45 @@ static void vmx_free_vlapic_mapping(stru
free_xenheap_page(mfn_to_virt(mfn));
}
+static int vmx_alloc_vpid(struct domain *d)
+{
+ int vpid;
+
+ if ( !cpu_has_vmx_vpid )
+ return 0;
+
+ spin_lock(&vpid_lock);
+
+ vpid = find_first_zero_bit(vpid_bitmap, vpid_bitmap_size);
+ if ( vpid >= vpid_bitmap_size )
+ {
+ spin_unlock(&vpid_lock);
+ printk("VPID is used up.\n");
+ return -EBUSY;
+ }
+ if ( test_and_set_bit(vpid, vpid_bitmap) )
+ {
+ spin_unlock(&vpid_lock);
+ printk("VPID allocation bug, fix your code!\n");
+ return -EBUSY;
+ }
+
+ spin_unlock(&vpid_lock);
+
+ d->arch.hvm_domain.vmx_vpid_base = vpid * MAX_VIRT_CPUS;
+ return 0;
+}
+
+static void vmx_free_vpid(struct domain *d)
+{
+ if ( !cpu_has_vmx_vpid )
+ return;
+
+ spin_lock(&vpid_lock);
+ clear_bit(d->arch.hvm_domain.vmx_vpid_base / MAX_VIRT_CPUS, vpid_bitmap);
+ spin_unlock(&vpid_lock);
+}
+
static void vmx_install_vlapic_mapping(struct vcpu *v)
{
paddr_t virt_page_ma, apic_page_ma;
Index: xen-3.2.1-testing/xen/arch/x86/mm/shadow/multi.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/shadow/multi.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/shadow/multi.c
@@ -35,6 +35,7 @@
#include <asm/hvm/hvm.h>
#include <asm/hvm/cacheattr.h>
#include <asm/mtrr.h>
+#include <asm/hvm/vmx/vmx.h>
#include "private.h"
#include "types.h"
@@ -3102,6 +3103,7 @@ sh_invlpg(struct vcpu *v, unsigned long
== SH_type_fl1_shadow )
{
flush_tlb_local();
+ vpid_sync_vcpu_all(v);
return 0;
}
Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/domain.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hvm/domain.h
+++ xen-3.2.1-testing/xen/include/asm-x86/hvm/domain.h
@@ -61,6 +61,7 @@ struct hvm_domain {
uint64_t params[HVM_NR_PARAMS];
unsigned long vmx_apic_access_mfn;
+ unsigned long vmx_vpid_base;
/* Memory ranges with pinned cache attributes. */
struct list_head pinned_cacheattr_ranges;
Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmcs.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -89,6 +89,8 @@ struct arch_vmx_struct {
u32 exec_control;
u32 secondary_exec_control;
+ u16 vpid;
+
#ifdef __x86_64__
struct vmx_msr_state msr_state;
unsigned long shadow_gs;
@@ -165,6 +167,7 @@ extern u32 vmx_vmentry_control;
#define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
#define SECONDARY_EXEC_ENABLE_EPT 0x00000002
+#define SECONDARY_EXEC_ENABLE_VPID 0x00000020
#define SECONDARY_EXEC_WBINVD_EXITING 0x00000040
extern u32 vmx_secondary_exec_control;
@@ -184,6 +187,8 @@ extern bool_t cpu_has_vmx_ins_outs_instr
(vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)
#define cpu_has_vmx_ept \
(vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_EPT)
+#define cpu_has_vmx_vpid \
+ (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VPID)
/* GUEST_INTERRUPTIBILITY_INFO flags. */
#define VMX_INTR_SHADOW_STI 0x00000001
@@ -193,6 +198,7 @@ extern bool_t cpu_has_vmx_ins_outs_instr
/* VMCS field encodings. */
enum vmcs_field {
+ VIRTUAL_PROCESSOR_ID = 0x00000000,
GUEST_ES_SELECTOR = 0x00000800,
GUEST_CS_SELECTOR = 0x00000802,
GUEST_SS_SELECTOR = 0x00000804,
@@ -332,6 +338,8 @@ enum vmcs_field {
HOST_RIP = 0x00006c16,
};
+#define VMCS_VPID_WIDTH (16)
+
void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr);
int vmx_read_guest_msr(struct vcpu *v, u32 msr, u64 *val);
int vmx_write_guest_msr(struct vcpu *v, u32 msr, u64 val);
Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmx.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/asm-x86/hvm/vmx/vmx.h
+++ xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -175,6 +175,7 @@ int vmx_realmode_io_complete(void);
#define VMRESUME_OPCODE ".byte 0x0f,0x01,0xc3\n"
#define VMWRITE_OPCODE ".byte 0x0f,0x79\n"
#define INVEPT_OPCODE ".byte 0x66,0x0f,0x38,0x80\n" /* m128,r64/32 */
+#define INVVPID_OPCODE ".byte 0x66,0x0f,0x38,0x81\n" /* m128,r64/32 */
#define VMXOFF_OPCODE ".byte 0x0f,0x01,0xc4\n"
#define VMXON_OPCODE ".byte 0xf3,0x0f,0xc7\n"
@@ -280,6 +281,23 @@ static inline void __invept(int ext, u64
: "memory");
}
+static inline void __invvpid(int ext, u16 vpid, u64 gva)
+{
+ struct {
+ u64 vpid:16;
+ u64 rsvd:48;
+ u64 gva;
+ } __attribute__ ((packed)) operand = {vpid, 0, gva};
+
+ __asm__ __volatile__ ( INVVPID_OPCODE
+ MODRM_EAX_08
+ /* CF==1 or ZF==1 --> rc = -1 */
+ "ja 1f ; ud2 ; 1:\n"
+ :
+ : "a" (&operand), "c" (ext)
+ : "memory");
+}
+
static inline void __vmxoff(void)
{
asm volatile (
@@ -332,6 +350,22 @@ static inline void ept_sync_all(void)
__invept(2, 0, 0);
}
+static inline void vpid_sync_vcpu_all(struct vcpu *v)
+{
+ if ( !cpu_has_vmx_vpid )
+ return;
+
+ __invvpid(1, v->arch.hvm_vmx.vpid, 0);
+}
+
+static inline void vpid_sync_all(void)
+{
+ if ( !cpu_has_vmx_vpid )
+ return;
+
+ __invvpid(2, 0, 0);
+}
+
static inline void __vmx_inject_exception(
struct vcpu *v, int trap, int type, int error_code)
{

View File

@ -1,80 +0,0 @@
Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
+++ xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c
@@ -28,6 +28,7 @@
#include <asm/delay.h>
#include <asm/string.h>
#include <asm/mm.h>
+#include <asm/paging.h>
#include <asm/iommu.h>
#include <asm/hvm/vmx/intel-iommu.h>
#include "dmar.h"
@@ -1900,6 +1901,45 @@ void iommu_set_pgd(struct domain *d)
}
p2m_table = mfn_x(pagetable_get_mfn(d->arch.phys_table));
+ if ( paging_mode_hap(d) )
+ {
+ if ( !hd->pgd )
+ {
+ int level = agaw_to_level(hd->agaw);
+ struct dma_pte *dpte = NULL;
+ mfn_t pgd_mfn;
+
+ switch ( level )
+ {
+ case VTD_PAGE_TABLE_LEVEL_3:
+ dpte = map_domain_page(p2m_table);
+ if ( !dma_pte_present(*dpte) )
+ {
+ gdprintk(XENLOG_ERR VTDPREFIX,
+ "iommu_set_pgd: second level wasn't there\n");
+ unmap_domain_page(dpte);
+ return;
+ }
+ pgd_mfn = _mfn(dma_pte_addr(*dpte) >> PAGE_SHIFT_4K);
+ unmap_domain_page(dpte);
+ hd->pgd = maddr_to_virt(pagetable_get_paddr(
+ pagetable_from_mfn(pgd_mfn)));
+ break;
+
+ case VTD_PAGE_TABLE_LEVEL_4:
+ pgd_mfn = _mfn(p2m_table);
+ hd->pgd = maddr_to_virt(pagetable_get_paddr(
+ pagetable_from_mfn(pgd_mfn)));
+ break;
+ default:
+ gdprintk(XENLOG_ERR VTDPREFIX,
+ "iommu_set_pgd:Unsupported p2m table sharing level!\n");
+ break;
+ }
+ }
+ }
+ else
+ {
#if CONFIG_PAGING_LEVELS == 3
if ( !hd->pgd )
{
@@ -2005,6 +2045,7 @@ void iommu_set_pgd(struct domain *d)
}
}
#endif
+ }
gdprintk(XENLOG_INFO VTDPREFIX,
"iommu_set_pgd: hd->pgd = %p\n", hd->pgd);
}
Index: xen-3.2.1-testing/xen/arch/x86/mm/p2m-ept.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/mm/p2m-ept.c
+++ xen-3.2.1-testing/xen/arch/x86/mm/p2m-ept.c
@@ -157,6 +157,9 @@ ept_set_entry(struct domain *d, unsigned
else
ept_entry->epte = 0;
+ if ( vtd_enabled && (p2mt == p2m_mmio_direct) && is_hvm_domain(d) )
+ iommu_flush(d, gfn, (u64 *)ept_entry);
+
/* Success */
rv = 1;

View File

@ -1,8 +1,8 @@
Index: 2007-11-13/xen/arch/x86/x86_32/entry.S Index: xen-3.3.0-testing/xen/arch/x86/x86_32/entry.S
=================================================================== ===================================================================
--- 2007-11-13.orig/xen/arch/x86/x86_32/entry.S 2007-11-02 17:25:57.000000000 +0100 --- xen-3.3.0-testing.orig/xen/arch/x86/x86_32/entry.S
+++ 2007-11-13/xen/arch/x86/x86_32/entry.S 2007-11-13 15:28:49.000000000 +0100 +++ xen-3.3.0-testing/xen/arch/x86/x86_32/entry.S
@@ -380,21 +380,33 @@ ring1: /* obtain ss/esp from oldss/olde @@ -401,21 +401,33 @@ ring1: /* obtain ss/esp from oldss/olde
movl %eax,UREGS_eip+4(%esp) movl %eax,UREGS_eip+4(%esp)
ret ret
.section __ex_table,"a" .section __ex_table,"a"
@ -46,11 +46,11 @@ Index: 2007-11-13/xen/arch/x86/x86_32/entry.S
domain_crash_synchronous: domain_crash_synchronous:
pushl $domain_crash_synchronous_string pushl $domain_crash_synchronous_string
call printk call printk
Index: 2007-11-13/xen/arch/x86/x86_64/entry.S Index: xen-3.3.0-testing/xen/arch/x86/x86_64/entry.S
=================================================================== ===================================================================
--- 2007-11-13.orig/xen/arch/x86/x86_64/entry.S 2007-11-02 17:25:58.000000000 +0100 --- xen-3.3.0-testing.orig/xen/arch/x86/x86_64/entry.S
+++ 2007-11-13/xen/arch/x86/x86_64/entry.S 2007-11-13 15:28:49.000000000 +0100 +++ xen-3.3.0-testing/xen/arch/x86/x86_64/entry.S
@@ -399,17 +399,30 @@ create_bounce_frame: @@ -419,17 +419,30 @@ create_bounce_frame:
movq %rax,UREGS_rip+8(%rsp) movq %rax,UREGS_rip+8(%rsp)
ret ret
.section __ex_table,"a" .section __ex_table,"a"

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:10702fe7235c227f76cda76c32504a48baebcd000b46e880ecf6343dd5a0f42a
size 5468969

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b3dcdef0709301c1e6ad4f590b10f1734e33d6979942364cbf186a2074689b4b
size 7051282

View File

@ -1,13 +1,13 @@
Index: xen-3.2.1-testing/xen/Makefile Index: xen-3.3.0-testing/xen/Makefile
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/xen/Makefile --- xen-3.3.0-testing.orig/xen/Makefile
+++ xen-3.2.1-testing/xen/Makefile +++ xen-3.3.0-testing/xen/Makefile
@@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@
+export XEN_CHANGESET = unavailable +export XEN_CHANGESET = unavailable
# This is the correct place to edit the build version. # This is the correct place to edit the build version.
# All other places this is stored (eg. compile.h) should be autogenerated. # All other places this is stored (eg. compile.h) should be autogenerated.
export XEN_VERSION = 3 export XEN_VERSION = 3
@@ -96,7 +97,7 @@ delete-unfresh-files: @@ -81,7 +82,7 @@ delete-unfresh-files:
@rm -f $@1 $@2 @rm -f $@1 $@2
# compile.h contains dynamic build info. Rebuilt on every 'make' invocation. # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
@ -15,8 +15,8 @@ Index: xen-3.2.1-testing/xen/Makefile
+include/xen/compile.h: include/xen/compile.h.in +include/xen/compile.h: include/xen/compile.h.in
@sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \ @sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
-e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \ -e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
-e 's/@@whoami@@/$(USER)/g' \ -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
@@ -106,10 +107,9 @@ include/xen/compile.h: include/xen/compi @@ -91,10 +92,9 @@ include/xen/compile.h: include/xen/compi
-e 's/@@version@@/$(XEN_VERSION)/g' \ -e 's/@@version@@/$(XEN_VERSION)/g' \
-e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \ -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
-e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \ -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \

View File

@ -1,13 +1,13 @@
Index: xen-3.2-testing/Config.mk Index: xen-3.3.0-testing/Config.mk
=================================================================== ===================================================================
--- xen-3.2-testing.orig/Config.mk --- xen-3.3.0-testing.orig/Config.mk
+++ xen-3.2-testing/Config.mk +++ xen-3.3.0-testing/Config.mk
@@ -88,7 +88,7 @@ ACM_SECURITY ?= n @@ -89,7 +89,7 @@ CONFIG_QEMU ?= ioemu
# Optional components # Optional components
XENSTAT_XENTOP ?= y XENSTAT_XENTOP ?= y
VTPM_TOOLS ?= n VTPM_TOOLS ?= n
-LIBXENAPI_BINDINGS ?= n -LIBXENAPI_BINDINGS ?= n
+LIBXENAPI_BINDINGS ?= y +LIBXENAPI_BINDINGS ?= y
PYTHON_TOOLS ?= y PYTHON_TOOLS ?= y
CONFIG_MINITERM ?= n
-include $(XEN_ROOT)/.config CONFIG_LOMOUNT ?= n

View File

@ -1,7 +1,7 @@
Index: xen-3.2-testing/docs/Makefile Index: xen-3.3.0-testing/docs/Makefile
=================================================================== ===================================================================
--- xen-3.2-testing.orig/docs/Makefile --- xen-3.3.0-testing.orig/docs/Makefile
+++ xen-3.2-testing/docs/Makefile +++ xen-3.3.0-testing/docs/Makefile
@@ -90,7 +90,8 @@ install: all @@ -90,7 +90,8 @@ install: all
$(INSTALL_DIR) $(DESTDIR)$(mandir) $(INSTALL_DIR) $(DESTDIR)$(mandir)
cp -dR man1 $(DESTDIR)$(mandir) cp -dR man1 $(DESTDIR)$(mandir)
@ -22,36 +22,11 @@ Index: xen-3.2-testing/docs/Makefile
+ ln -sf $*.html html.done/$*/index.html + ln -sf $*.html html.done/$*/index.html
+ rm -rf html/ + rm -rf html/
+ +
Index: xen-3.2-testing/tools/xentrace/Makefile Index: xen-3.3.0-testing/tools/examples/Makefile
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/xentrace/Makefile --- xen-3.3.0-testing.orig/tools/examples/Makefile
+++ xen-3.2-testing/tools/xentrace/Makefile +++ xen-3.3.0-testing/tools/examples/Makefile
@@ -38,14 +38,14 @@ install: build @@ -39,18 +39,6 @@ XEN_HOTPLUG_SCRIPTS = xen-backend.agent
[ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin
[ -z "$(LIBBIN)" ] || [ -d $(DESTDIR)/usr/$(LIBDIR)/xen/bin ] || \
$(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)/xen/bin
- [ -d $(DESTDIR)/usr/share/man/man1 ] || \
- $(INSTALL_DIR) $(DESTDIR)/usr/share/man/man1
- [ -d $(DESTDIR)/usr/share/man/man8 ] || \
- $(INSTALL_DIR) $(DESTDIR)/usr/share/man/man8
+ [ -d $(DESTDIR)$(MANDIR)/man1 ] || \
+ $(INSTALL_DIR) $(DESTDIR)$(MANDIR)/man1
+ [ -d $(DESTDIR)$(MANDIR)/man8 ] || \
+ $(INSTALL_DIR) $(DESTDIR)$(MANDIR)/man8
$(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)/usr/bin
[ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)/usr/$(LIBDIR)/xen/bin
- $(INSTALL_DATA) $(MAN1) $(DESTDIR)/usr/share/man/man1
- $(INSTALL_DATA) $(MAN8) $(DESTDIR)/usr/share/man/man8
+ $(INSTALL_DATA) $(MAN1) $(DESTDIR)$(MANDIR)/man1
+ $(INSTALL_DATA) $(MAN8) $(DESTDIR)$(MANDIR)/man8
.PHONY: clean
clean:
Index: xen-3.2-testing/tools/examples/Makefile
===================================================================
--- xen-3.2-testing.orig/tools/examples/Makefile
+++ xen-3.2-testing/tools/examples/Makefile
@@ -41,18 +41,6 @@ XEN_HOTPLUG_SCRIPTS = xen-backend.agent
UDEV_RULES_DIR = /etc/udev UDEV_RULES_DIR = /etc/udev
UDEV_RULES = xen-backend.rules UDEV_RULES = xen-backend.rules
@ -70,7 +45,7 @@ Index: xen-3.2-testing/tools/examples/Makefile
.PHONY: all .PHONY: all
all: all:
@@ -60,15 +48,15 @@ all: @@ -58,15 +46,15 @@ all:
build: build:
.PHONY: install .PHONY: install
@ -89,7 +64,7 @@ Index: xen-3.2-testing/tools/examples/Makefile
.PHONY: install-configs .PHONY: install-configs
install-configs: $(XEN_CONFIGS) install-configs: $(XEN_CONFIGS)
@@ -109,8 +97,7 @@ install-udev: @@ -107,8 +95,7 @@ install-udev:
$(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
set -e; for i in $(UDEV_RULES); \ set -e; for i in $(UDEV_RULES); \
do \ do \
@ -99,10 +74,10 @@ Index: xen-3.2-testing/tools/examples/Makefile
done done
.PHONY: clean .PHONY: clean
Index: xen-3.2-testing/tools/security/Makefile Index: xen-3.3.0-testing/tools/security/Makefile
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/security/Makefile --- xen-3.3.0-testing.orig/tools/security/Makefile
+++ xen-3.2-testing/tools/security/Makefile +++ xen-3.3.0-testing/tools/security/Makefile
@@ -64,9 +64,9 @@ install: all $(ACM_CONFIG_FILE) @@ -64,9 +64,9 @@ install: all $(ACM_CONFIG_FILE)
$(INSTALL_DIR) $(DESTDIR)$(ACM_SECGEN_CGIDIR) $(INSTALL_DIR) $(DESTDIR)$(ACM_SECGEN_CGIDIR)
$(INSTALL_PROG) $(ACM_INST_CGI) $(DESTDIR)$(ACM_SECGEN_CGIDIR) $(INSTALL_PROG) $(ACM_INST_CGI) $(DESTDIR)$(ACM_SECGEN_CGIDIR)
@ -115,10 +90,10 @@ Index: xen-3.2-testing/tools/security/Makefile
endif endif
else else
.PHONY: all .PHONY: all
Index: xen-3.2-testing/tools/pygrub/Makefile Index: xen-3.3.0-testing/tools/pygrub/Makefile
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/pygrub/Makefile --- xen-3.3.0-testing.orig/tools/pygrub/Makefile
+++ xen-3.2-testing/tools/pygrub/Makefile +++ xen-3.3.0-testing/tools/pygrub/Makefile
@@ -16,7 +16,7 @@ install: all @@ -16,7 +16,7 @@ install: all
$(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot
else else
@ -128,10 +103,10 @@ Index: xen-3.2-testing/tools/pygrub/Makefile
$(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot
endif endif
Index: xen-3.2-testing/tools/python/Makefile Index: xen-3.3.0-testing/tools/python/Makefile
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/python/Makefile --- xen-3.3.0-testing.orig/tools/python/Makefile
+++ xen-3.2-testing/tools/python/Makefile +++ xen-3.3.0-testing/tools/python/Makefile
@@ -80,7 +80,7 @@ install: install-messages install-dtd @@ -80,7 +80,7 @@ install: install-messages install-dtd
CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py install --home="$(DESTDIR)/usr" --prefix="" --force --install-lib="$(DESTDIR)$(LIBPATH)/python" CC="$(CC)" CFLAGS="$(CFLAGS)" python setup.py install --home="$(DESTDIR)/usr" --prefix="" --force --install-lib="$(DESTDIR)$(LIBPATH)/python"
else else
@ -141,22 +116,10 @@ Index: xen-3.2-testing/tools/python/Makefile
endif endif
install-dtd: all install-dtd: all
Index: xen-3.2-testing/tools/Makefile Index: xen-3.3.0-testing/docs/Docs.mk
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/Makefile --- xen-3.3.0-testing.orig/docs/Docs.mk
+++ xen-3.2-testing/tools/Makefile +++ xen-3.3.0-testing/docs/Docs.mk
@@ -25,7 +25,6 @@ SUBDIRS-$(LIBXENAPI_BINDINGS) += libxen
# These don't cross-compile
ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
SUBDIRS-$(PYTHON_TOOLS) += python
-SUBDIRS-$(PYTHON_TOOLS) += pygrub
endif
.PHONY: all
Index: xen-3.2-testing/docs/Docs.mk
===================================================================
--- xen-3.2-testing.orig/docs/Docs.mk
+++ xen-3.2-testing/docs/Docs.mk
@@ -8,6 +8,6 @@ POD2MAN := pod2man @@ -8,6 +8,6 @@ POD2MAN := pod2man
DOT := dot DOT := dot
NEATO := neato NEATO := neato
@ -166,72 +129,74 @@ Index: xen-3.2-testing/docs/Docs.mk
+pkgdocdir := $(DOCDIR) +pkgdocdir := $(DOCDIR)
+mandir := $(MANDIR) +mandir := $(MANDIR)
Index: xen-3.2-testing/tools/xenstore/Makefile Index: xen-3.3.0-testing/tools/xenstore/Makefile
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/xenstore/Makefile --- xen-3.3.0-testing.orig/tools/xenstore/Makefile
+++ xen-3.2-testing/tools/xenstore/Makefile +++ xen-3.3.0-testing/tools/xenstore/Makefile
@@ -20,6 +20,7 @@ LDFLAGS += $(PROFILE) -L$(XEN_LIBXC) @@ -14,6 +14,7 @@ DEP = .*.d
CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
CLIENTS += xenstore-write CLIENTS += xenstore-write xenstore-ls
CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS))
+CLIENTS_DOMU := $(patsubst xenstore-%,domu-xenstore-%,$(CLIENTS)) +CLIENTS_DOMU := $(patsubst xenstore-%,domu-xenstore-%,$(CLIENTS))
XENSTORED_OBJS = xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o tdb.o hashtable.o XENSTORED_OBJS = xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o tdb.o hashtable.o
@@ -30,7 +31,7 @@ XENSTORED_OBJS_$(CONFIG_NetBSD) = xensto @@ -34,7 +35,7 @@ endif
XENSTORED_OBJS += $(XENSTORED_OBJS_y) all: libxenstore.so libxenstore.a xenstored clients xs_tdb_dump
.PHONY: all .PHONY: clients
-all: libxenstore.so libxenstore.a xenstored $(CLIENTS) xs_tdb_dump xenstore-control xenstore-ls -clients: xenstore $(CLIENTS) xenstore-control
+all: libxenstore.so libxenstore.a xenstored $(CLIENTS) $(CLIENTS_DOMU) xs_tdb_dump xenstore-control xenstore-ls +clients: xenstore $(CLIENTS) $(CLIENTS_DOMU) xenstore-control
xenstored: $(XENSTORED_OBJS) ifeq ($(CONFIG_SunOS),y)
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl $(SOCKET_LIBS) -o $@ xenstored_probes.h: xenstored_probes.d
@@ -38,6 +39,9 @@ xenstored: $(XENSTORED_OBJS) @@ -54,6 +55,9 @@ xenstored: $(XENSTORED_OBJS)
$(CLIENTS): xenstore-%: xenstore_%.o libxenstore.so $(CLIENTS): xenstore
$(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore $(SOCKET_LIBS) -o $@ ln -f xenstore $@
+$(CLIENTS_DOMU): domu-xenstore-%: xenstore_%.o libxenstore.a +$(CLIENTS_DOMU): xenstore
+ $(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -L. -lpthread libxenstore.a $(SOCKET_LIBS) -o $@ + ln -f xenstore $@
+ +
$(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c xenstore: xenstore_client.o $(LIBXENSTORE)
$(COMPILE.c) -DCLIENT_$(*F) -o $@ $< $(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@
@@ -66,7 +70,7 @@ clean: @@ -81,7 +85,7 @@ clean:
rm -f *.a *.o *.opic *.so* rm -f *.a *.o *.opic *.so* xenstored_probes.h
rm -f xenstored xs_random xs_stress xs_crashme rm -f xenstored xs_random xs_stress xs_crashme
rm -f xs_tdb_dump xenstore-control xenstore-ls rm -f xs_tdb_dump xenstore-control
- rm -f $(CLIENTS) - rm -f xenstore $(CLIENTS)
+ rm -f $(CLIENTS) $(CLIENTS_DOMU) + rm -f $(CLIENTS) $(CLIENTS_DOMU)
$(RM) $(PROG_DEP) $(RM) $(DEP)
.PHONY: TAGS .PHONY: TAGS
@@ -81,11 +85,15 @@ tarball: clean @@ -96,6 +100,7 @@ tarball: clean
install: all install: all
$(INSTALL_DIR) $(DESTDIR)/var/run/xenstored $(INSTALL_DIR) $(DESTDIR)/var/run/xenstored
$(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored $(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
+ $(INSTALL_DIR) $(DESTDIR)/bin + $(INSTALL_DIR) $(DESTDIR)/bin
$(INSTALL_DIR) $(DESTDIR)/usr/bin $(INSTALL_DIR) $(DESTDIR)$(BINDIR)
$(INSTALL_DIR) $(DESTDIR)/usr/sbin $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
$(INSTALL_DIR) $(DESTDIR)/usr/include $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
$(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin @@ -105,6 +110,9 @@ install: all
$(INSTALL_PROG) $(CLIENTS) $(DESTDIR)/usr/bin set -e ; for c in $(CLIENTS) ; do \
ln -f $(DESTDIR)/usr/bin/xenstore $(DESTDIR)/usr/bin/$${c} ; \
done
+ for client in $(CLIENTS_DOMU); do \ + for client in $(CLIENTS_DOMU); do \
+ $(INSTALL_PROG) $$client $(DESTDIR)/bin/$${client/domu-}; \ + $(INSTALL_PROG) $$client $(DESTDIR)/bin/$${client/domu-}; \
+ done + done
$(INSTALL_PROG) xenstore-control $(DESTDIR)/usr/bin $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
$(INSTALL_PROG) xenstore-ls $(DESTDIR)/usr/bin $(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
$(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR) ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
Index: xen-3.2-testing/tools/misc/Makefile Index: xen-3.3.0-testing/tools/misc/Makefile
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/misc/Makefile --- xen-3.3.0-testing.orig/tools/misc/Makefile
+++ xen-3.2-testing/tools/misc/Makefile +++ xen-3.3.0-testing/tools/misc/Makefile
@@ -14,7 +14,7 @@ TARGETS-$(CONFIG_X86) += xen-detect @@ -19,7 +19,7 @@ SUBDIRS-$(CONFIG_MINITERM) += miniterm
TARGETS := $(TARGETS-y) SUBDIRS := $(SUBDIRS-y)
INSTALL_BIN = $(TARGETS) xencons INSTALL_BIN = $(TARGETS) xencons
-INSTALL_SBIN = netfix xm xen-bugtool xen-python-path xend xenperf xsview -INSTALL_SBIN = netfix xm xen-bugtool xen-python-path xend xenperf xsview
+INSTALL_SBIN = netfix xm xen-bugtool xen-python-path xend xsview +INSTALL_SBIN = netfix xm xen-bugtool xen-python-path xend xsview
.PHONY: all DEFAULT_PYTHON_PATH := $(shell $(XEN_ROOT)/tools/python/get-path)
all: build PYTHON_PATH ?= $(DEFAULT_PYTHON_PATH)

View File

@ -5,10 +5,10 @@ the "sendkey" command, among other useful things), remove all console
commands that can read/write dom0's state. commands that can read/write dom0's state.
Index: xen-3.2-testing/tools/ioemu/monitor.c Index: xen-3.3.0-testing/tools/ioemu/monitor.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/ioemu/monitor.c --- xen-3.3.0-testing.orig/tools/ioemu/monitor.c
+++ xen-3.2-testing/tools/ioemu/monitor.c +++ xen-3.3.0-testing/tools/ioemu/monitor.c
@@ -1231,6 +1231,7 @@ static term_cmd_t term_cmds[] = { @@ -1231,6 +1231,7 @@ static term_cmd_t term_cmds[] = {
"device|all", "commit changes to the disk images (if -snapshot is used) or backing files" }, "device|all", "commit changes to the disk images (if -snapshot is used) or backing files" },
{ "info", "s?", do_info, { "info", "s?", do_info,
@ -37,10 +37,10 @@ Index: xen-3.2-testing/tools/ioemu/monitor.c
{ "usb_del", "s", do_usb_del, { "usb_del", "s", do_usb_del,
"device", "remove USB device 'bus.addr'" }, "device", "remove USB device 'bus.addr'" },
+#endif +#endif
#ifndef CONFIG_DM #ifdef CONFIG_PHP_DEBUG
{ "cpu", "i", do_cpu_set, { "pci_add", "s", do_pci_add,
"index", "set the default CPU" }, "device", "insert PCI pass-through device by BDF,e.g. (dom, bus, dev, func) by hex '0x0, 0x3, 0x0, 0x0'" },
@@ -1290,6 +1294,7 @@ static term_cmd_t term_cmds[] = { @@ -1296,6 +1300,7 @@ static term_cmd_t term_cmds[] = {
"state", "change mouse button state (1=L, 2=M, 4=R)" }, "state", "change mouse button state (1=L, 2=M, 4=R)" },
{ "mouse_set", "i", do_mouse_set, { "mouse_set", "i", do_mouse_set,
"index", "set which mouse device receives events" }, "index", "set which mouse device receives events" },
@ -48,7 +48,7 @@ Index: xen-3.2-testing/tools/ioemu/monitor.c
#ifdef HAS_AUDIO #ifdef HAS_AUDIO
{ "wavcapture", "si?i?i?", do_wav_capture, { "wavcapture", "si?i?i?", do_wav_capture,
"path [frequency bits channels]", "path [frequency bits channels]",
@@ -1297,6 +1302,7 @@ static term_cmd_t term_cmds[] = { @@ -1303,6 +1308,7 @@ static term_cmd_t term_cmds[] = {
#endif #endif
{ "stopcapture", "i", do_stop_capture, { "stopcapture", "i", do_stop_capture,
"capture index", "stop capture" }, "capture index", "stop capture" },
@ -56,7 +56,7 @@ Index: xen-3.2-testing/tools/ioemu/monitor.c
#ifndef CONFIG_DM #ifndef CONFIG_DM
{ "memsave", "lis", do_memory_save, { "memsave", "lis", do_memory_save,
"addr size file", "save to disk virtual memory dump starting at 'addr' of size 'size'", }, "addr size file", "save to disk virtual memory dump starting at 'addr' of size 'size'", },
@@ -1339,6 +1345,7 @@ static term_cmd_t info_cmds[] = { @@ -1345,6 +1351,7 @@ static term_cmd_t info_cmds[] = {
#endif /* !CONFIG_DM */ #endif /* !CONFIG_DM */
{ "usb", "", usb_info, { "usb", "", usb_info,
"", "show guest USB devices", }, "", "show guest USB devices", },
@ -64,7 +64,7 @@ Index: xen-3.2-testing/tools/ioemu/monitor.c
{ "usbhost", "", usb_host_info, { "usbhost", "", usb_host_info,
"", "show host USB devices", }, "", "show host USB devices", },
{ "profile", "", do_info_profile, { "profile", "", do_info_profile,
@@ -1355,6 +1362,7 @@ static term_cmd_t info_cmds[] = { @@ -1361,6 +1368,7 @@ static term_cmd_t info_cmds[] = {
{ "hvmiopage", "", sp_info, { "hvmiopage", "", sp_info,
"", "show HVM device model shared page info" }, "", "show HVM device model shared page info" },
#endif /* CONFIG_DM */ #endif /* CONFIG_DM */

View File

@ -1,8 +1,8 @@
Index: xen-3.2.1-testing/tools/python/xen/util/blkif.py Index: xen-3.3.0-testing/tools/python/xen/util/blkif.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/util/blkif.py --- xen-3.3.0-testing.orig/tools/python/xen/util/blkif.py
+++ xen-3.2.1-testing/tools/python/xen/util/blkif.py +++ xen-3.3.0-testing/tools/python/xen/util/blkif.py
@@ -66,23 +66,24 @@ def blkdev_segment(name): @@ -71,23 +71,24 @@ def blkdev_segment(name):
'type' : 'Disk' } 'type' : 'Disk' }
return val return val
@ -32,12 +32,12 @@ Index: xen-3.2.1-testing/tools/python/xen/util/blkif.py
def mount_mode(name): def mount_mode(name):
mode = None mode = None
Index: xen-3.2.1-testing/tools/python/xen/xend/server/DevController.py Index: xen-3.3.0-testing/tools/python/xen/xend/server/DevController.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/server/DevController.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/server/DevController.py
+++ xen-3.2.1-testing/tools/python/xen/xend/server/DevController.py +++ xen-3.3.0-testing/tools/python/xen/xend/server/DevController.py
@@ -562,6 +562,31 @@ class DevController: @@ -604,6 +604,31 @@ class DevController:
return result['status'] return (Missing, None)
+ def waitForFrontend(self, devid): + def waitForFrontend(self, devid):
@ -68,16 +68,16 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/server/DevController.py
def backendPath(self, backdom, devid): def backendPath(self, backdom, devid):
"""Construct backend path given the backend domain and device id. """Construct backend path given the backend domain and device id.
Index: xen-3.2.1-testing/tools/python/xen/xend/XendBootloader.py Index: xen-3.3.0-testing/tools/python/xen/xend/XendBootloader.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendBootloader.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/XendBootloader.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendBootloader.py +++ xen-3.3.0-testing/tools/python/xen/xend/XendBootloader.py
@@ -12,8 +12,9 @@ @@ -12,8 +12,9 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
-import os, select, errno, stat, signal -import os, select, errno, stat, signal, tty
+import os, select, errno, stat, signal, time +import os, select, errno, stat, signal, tty, time
import random import random
+import re +import re
import shlex import shlex
@ -111,7 +111,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendBootloader.py
log.error(msg) log.error(msg)
raise VmError(msg) raise VmError(msg)
@@ -185,3 +203,14 @@ def bootloader_tidy(dom): @@ -184,3 +202,14 @@ def bootloader_tidy(dom):
os.kill(pid, signal.SIGKILL) os.kill(pid, signal.SIGKILL)
@ -126,19 +126,20 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendBootloader.py
+ if m: + if m:
+ return vdisk == m.group(1) or vdisk == m.group(2) + return vdisk == m.group(1) or vdisk == m.group(2)
+ return True + return True
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py +++ xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -35,14 +35,14 @@ from types import StringTypes @@ -35,7 +35,7 @@ from types import StringTypes
import xen.lowlevel.xc import xen.lowlevel.xc
from xen.util import asserts from xen.util import asserts
-from xen.util.blkif import blkdev_uname_to_file, blkdev_uname_to_taptype -from xen.util.blkif import blkdev_uname_to_file, blkdev_uname_to_taptype
+from xen.util.blkif import parse_uname +from xen.util.blkif import parse_uname
import xen.util.xsm.xsm as security import xen.util.xsm.xsm as security
from xen.util import xsconstants
from xen.xend import balloon, sxp, uuid, image, arch, osdep @@ -43,7 +43,7 @@ from xen.xend import balloon, sxp, uuid,
from xen.xend import XendOptions, XendNode, XendConfig from xen.xend import XendOptions, XendNode, XendConfig
from xen.xend.XendConfig import scrub_password from xen.xend.XendConfig import scrub_password
@ -147,7 +148,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
from xen.xend.XendError import XendError, VmError from xen.xend.XendError import XendError, VmError
from xen.xend.XendDevices import XendDevices from xen.xend.XendDevices import XendDevices
from xen.xend.XendTask import XendTask from xen.xend.XendTask import XendTask
@@ -1517,6 +1517,10 @@ class XendDomainInfo: @@ -1863,6 +1863,10 @@ class XendDomainInfo:
deviceClass, config = self.info['devices'].get(dev_uuid) deviceClass, config = self.info['devices'].get(dev_uuid)
self._waitForDevice(deviceClass, config['devid']) self._waitForDevice(deviceClass, config['devid'])
@ -158,7 +159,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
def _waitForDevice_destroy(self, deviceClass, devid, backpath): def _waitForDevice_destroy(self, deviceClass, devid, backpath):
return self.getDeviceController(deviceClass).waitForDevice_destroy( return self.getDeviceController(deviceClass).waitForDevice_destroy(
devid, backpath) devid, backpath)
@@ -2098,8 +2102,11 @@ class XendDomainInfo: @@ -2534,8 +2538,11 @@ class XendDomainInfo:
blexec = osdep.pygrub_path blexec = osdep.pygrub_path
blcfg = None blcfg = None
@ -172,7 +173,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
if not disks: if not disks:
msg = "Had a bootloader specified, but no disks are bootable" msg = "Had a bootloader specified, but no disks are bootable"
@@ -2110,13 +2117,10 @@ class XendDomainInfo: @@ -2546,13 +2553,10 @@ class XendDomainInfo:
devtype = devinfo[0] devtype = devinfo[0]
disk = devinfo[1]['uname'] disk = devinfo[1]['uname']
@ -189,7 +190,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
log.info("Mounting %s on %s." % log.info("Mounting %s on %s." %
(fn, BOOTLOADER_LOOPBACK_DEVICE)) (fn, BOOTLOADER_LOOPBACK_DEVICE))
@@ -2128,7 +2132,9 @@ class XendDomainInfo: @@ -2564,7 +2568,9 @@ class XendDomainInfo:
from xen.xend import XendDomain from xen.xend import XendDomain
dom0 = XendDomain.instance().privilegedDomain() dom0 = XendDomain.instance().privilegedDomain()
@ -200,7 +201,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
fn = BOOTLOADER_LOOPBACK_DEVICE fn = BOOTLOADER_LOOPBACK_DEVICE
try: try:
@@ -2139,7 +2145,7 @@ class XendDomainInfo: @@ -2575,7 +2581,7 @@ class XendDomainInfo:
log.info("Unmounting %s from %s." % log.info("Unmounting %s from %s." %
(fn, BOOTLOADER_LOOPBACK_DEVICE)) (fn, BOOTLOADER_LOOPBACK_DEVICE))

View File

@ -1,155 +0,0 @@
Index: xen-3.2-testing/tools/ioemu/hw/xenfb.c
===================================================================
--- xen-3.2-testing.orig/tools/ioemu/hw/xenfb.c
+++ xen-3.2-testing/tools/ioemu/hw/xenfb.c
@@ -510,6 +510,12 @@ static void xenfb_on_fb_event(struct xen
}
xenfb_guest_copy(xenfb, x, y, w, h);
break;
+ case XENFB_TYPE_RESIZE:
+ xenfb->width = event->resize.width;
+ xenfb->height = event->resize.height;
+ xenfb->row_stride = event->resize.stride;
+ dpy_resize(xenfb->ds, xenfb->width, xenfb->height);
+ break;
}
}
mb(); /* ensure we're done with ring contents */
@@ -672,6 +678,7 @@ static void xenfb_dispatch_store(void *o
static int xenfb_read_frontend_fb_config(struct xenfb *xenfb) {
struct xenfb_page *fb_page;
int val;
+ int videoram;
if (xenfb_xs_scanf1(xenfb->xsh, xenfb->fb.otherend, "feature-update",
"%d", &val) < 0)
@@ -686,19 +693,34 @@ static int xenfb_read_frontend_fb_config
xenfb->protocol[0] = '\0';
xenfb_xs_printf(xenfb->xsh, xenfb->fb.nodename, "request-update", "1");
- /* TODO check for permitted ranges */
+ if (xenfb_xs_scanf1(xenfb->xsh, xenfb->fb.nodename, "videoram", "%d", &videoram) < 0)
+ videoram = 0;
+ videoram = videoram * 1024 * 1024;
+
fb_page = xenfb->fb.page;
xenfb->depth = fb_page->depth;
xenfb->width = fb_page->width;
xenfb->height = fb_page->height;
- /* TODO check for consistency with the above */
xenfb->fb_len = fb_page->mem_length;
xenfb->row_stride = fb_page->line_length;
+ /* Protect against hostile frontend, limit fb_len to configured */
+ if (videoram && xenfb->fb_len > videoram) {
+ xenfb->fb_len = videoram;
+ if (xenfb->row_stride * xenfb->height > xenfb->fb_len)
+ xenfb->height = xenfb->fb_len / xenfb->row_stride;
+ }
fprintf(stderr, "Framebuffer depth %d width %d height %d line %d\n",
fb_page->depth, fb_page->width, fb_page->height, fb_page->line_length);
if (xenfb_map_fb(xenfb, xenfb->fb.otherend_id) < 0)
return -1;
+ /* Indicate we have the frame buffer resize feature */
+ xenfb_xs_printf(xenfb->xsh, xenfb->fb.nodename, "feature-resize", "1");
+
+ /* Tell kbd the screen res */
+ xenfb_xs_printf(xenfb->xsh, xenfb->kbd.nodename, "width", "%d", xenfb->width);
+ xenfb_xs_printf(xenfb->xsh, xenfb->kbd.nodename, "height", "%d", xenfb->height);
+
if (xenfb_switch_state(&xenfb->fb, XenbusStateConnected))
return -1;
if (xenfb_switch_state(&xenfb->kbd, XenbusStateConnected))
Index: xen-3.2-testing/xen/include/public/io/fbif.h
===================================================================
--- xen-3.2-testing.orig/xen/include/public/io/fbif.h
+++ xen-3.2-testing/xen/include/public/io/fbif.h
@@ -50,12 +50,28 @@ struct xenfb_update
int32_t height; /* rect height */
};
+/*
+ * Framebuffer resize notification event
+ * Capable backend sets feature-resize in xenstore.
+ */
+#define XENFB_TYPE_RESIZE 3
+
+struct xenfb_resize
+{
+ uint8_t type; /* XENFB_TYPE_RESIZE */
+ int32_t width; /* width in pixels */
+ int32_t height; /* height in pixels */
+ int32_t stride; /* stride in bytes */
+ int32_t depth; /* depth in bits */
+};
+
#define XENFB_OUT_EVENT_SIZE 40
union xenfb_out_event
{
uint8_t type;
struct xenfb_update update;
+ struct xenfb_resize resize;
char pad[XENFB_OUT_EVENT_SIZE];
};
@@ -109,15 +125,17 @@ struct xenfb_page
* Each directory page holds PAGE_SIZE / sizeof(*pd)
* framebuffer pages, and can thus map up to PAGE_SIZE *
* PAGE_SIZE / sizeof(*pd) bytes. With PAGE_SIZE == 4096 and
- * sizeof(unsigned long) == 4, that's 4 Megs. Two directory
- * pages should be enough for a while.
+ * sizeof(unsigned long) == 4/8, that's 4 Megs 32 bit and 2 Megs
+ * 64 bit. 256 directories give enough room for a 512 Meg
+ * framebuffer with a max resolution of 12,800x10,240. Should
+ * be enough for a while with room leftover for expansion.
*/
- unsigned long pd[2];
+ unsigned long pd[256];
};
/*
- * Wart: xenkbd needs to know resolution. Put it here until a better
- * solution is found, but don't leak it to the backend.
+ * Wart: xenkbd needs to know default resolution. Put it here until a
+ * better solution is found, but don't leak it to the backend.
*/
#ifdef __KERNEL__
#define XENFB_WIDTH 800
Index: xen-3.2-testing/tools/python/xen/xend/server/vfbif.py
===================================================================
--- xen-3.2-testing.orig/tools/python/xen/xend/server/vfbif.py
+++ xen-3.2-testing/tools/python/xen/xend/server/vfbif.py
@@ -6,7 +6,7 @@ import xen.xend
import os
CONFIG_ENTRIES = ['type', 'vncdisplay', 'vnclisten', 'vncpasswd', 'vncunused',
- 'display', 'xauthority', 'keymap',
+ 'videoram', 'display', 'xauthority', 'keymap',
'uuid', 'location', 'protocol']
class VfbifController(DevController):
Index: xen-3.2-testing/tools/python/xen/xm/create.py
===================================================================
--- xen-3.2-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.2-testing/tools/python/xen/xm/create.py
@@ -496,6 +496,10 @@ gopts.var('vncunused', val='',
use="""Try to find an unused port for the VNC server.
Only valid when vnc=1.""")
+gopts.var('videoram', val='',
+ fn=set_value, default=None,
+ use="""Amount of videoram PV guest can allocate for frame buffer.""")
+
gopts.var('sdl', val='',
fn=set_value, default=None,
use="""Should the device model use SDL?""")
@@ -631,7 +635,7 @@ def configure_vfbs(config_devs, vals):
d['type'] = 'sdl'
for (k,v) in d.iteritems():
if not k in [ 'vnclisten', 'vncunused', 'vncdisplay', 'display',
- 'xauthority', 'type', 'vncpasswd' ]:
+ 'videoram', 'xauthority', 'type', 'vncpasswd' ]:
err("configuration option %s unknown to vfbs" % k)
config.append([k,v])
if not d.has_key("keymap"):

View File

@ -1,7 +1,7 @@
Index: xen-3.2-testing/docs/man/xmdomain.cfg.pod.5 Index: xen-3.3.0-testing/docs/man/xmdomain.cfg.pod.5
=================================================================== ===================================================================
--- xen-3.2-testing.orig/docs/man/xmdomain.cfg.pod.5 --- xen-3.3.0-testing.orig/docs/man/xmdomain.cfg.pod.5
+++ xen-3.2-testing/docs/man/xmdomain.cfg.pod.5 +++ xen-3.3.0-testing/docs/man/xmdomain.cfg.pod.5
@@ -335,16 +335,10 @@ at hda1, which is the root filesystem. @@ -335,16 +335,10 @@ at hda1, which is the root filesystem.
=item I<NFS Root> =item I<NFS Root>
@ -19,10 +19,10 @@ Index: xen-3.2-testing/docs/man/xmdomain.cfg.pod.5
=back =back
=head1 SEE ALSO =head1 SEE ALSO
Index: xen-3.2-testing/docs/man/xm.pod.1 Index: xen-3.3.0-testing/docs/man/xm.pod.1
=================================================================== ===================================================================
--- xen-3.2-testing.orig/docs/man/xm.pod.1 --- xen-3.3.0-testing.orig/docs/man/xm.pod.1
+++ xen-3.2-testing/docs/man/xm.pod.1 +++ xen-3.3.0-testing/docs/man/xm.pod.1
@@ -188,7 +188,8 @@ scheduling by the Xen hypervisor. @@ -188,7 +188,8 @@ scheduling by the Xen hypervisor.
=item B<s - shutdown> =item B<s - shutdown>
@ -42,7 +42,7 @@ Index: xen-3.2-testing/docs/man/xm.pod.1
=back =back
B<LONG OUTPUT> B<LONG OUTPUT>
@@ -516,8 +515,6 @@ Xen ships with a number of domain schedu @@ -523,8 +522,6 @@ Xen ships with a number of domain schedu
time with the B<sched=> parameter on the Xen command line. By time with the B<sched=> parameter on the Xen command line. By
default B<credit> is used for scheduling. default B<credit> is used for scheduling.
@ -51,7 +51,7 @@ Index: xen-3.2-testing/docs/man/xm.pod.1
=over 4 =over 4
=item B<sched-credit> [ B<-d> I<domain-id> [ B<-w>[B<=>I<WEIGHT>] | B<-c>[B<=>I<CAP>] ] ] =item B<sched-credit> [ B<-d> I<domain-id> [ B<-w>[B<=>I<WEIGHT>] | B<-c>[B<=>I<CAP>] ] ]
@@ -567,8 +564,6 @@ The normal EDF scheduling usage in nanos @@ -574,8 +571,6 @@ The normal EDF scheduling usage in nanos
The normal EDF scheduling usage in nanoseconds The normal EDF scheduling usage in nanoseconds
@ -60,7 +60,7 @@ Index: xen-3.2-testing/docs/man/xm.pod.1
=item I<latency-hint> =item I<latency-hint>
Scaled period if domain is doing heavy I/O. Scaled period if domain is doing heavy I/O.
@@ -712,9 +707,6 @@ the default setting in xend-config.sxp f @@ -719,9 +714,6 @@ the default setting in xend-config.sxp f
Passes the specified IP Address to the adapter on creation. Passes the specified IP Address to the adapter on creation.
@ -70,7 +70,7 @@ Index: xen-3.2-testing/docs/man/xm.pod.1
=item B<mac=>I<macaddr> =item B<mac=>I<macaddr>
The MAC address that the domain will see on its Ethernet device. If The MAC address that the domain will see on its Ethernet device. If
@@ -738,9 +730,6 @@ Removes the network device from the doma @@ -745,9 +737,6 @@ Removes the network device from the doma
I<devid> is the virtual interface device number within the domain I<devid> is the virtual interface device number within the domain
(i.e. the 3 in vif22.3). (i.e. the 3 in vif22.3).
@ -80,7 +80,7 @@ Index: xen-3.2-testing/docs/man/xm.pod.1
=item B<network-list> [B<-l>|B<--long>]> I<domain-id> =item B<network-list> [B<-l>|B<--long>]> I<domain-id>
List virtual network interfaces for a domain. The returned output is List virtual network interfaces for a domain. The returned output is
@@ -759,9 +748,6 @@ formatted as a list or as an S-Expressio @@ -766,9 +755,6 @@ formatted as a list or as an S-Expressio
The Virtual Network interfaces for Xen. The Virtual Network interfaces for Xen.

View File

@ -1,8 +1,8 @@
Index: xen-3.2.1-testing/tools/examples/xend-config.sxp Index: xen-3.3.0-testing/tools/examples/xend-config.sxp
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/examples/xend-config.sxp --- xen-3.3.0-testing.orig/tools/examples/xend-config.sxp
+++ xen-3.2.1-testing/tools/examples/xend-config.sxp +++ xen-3.3.0-testing/tools/examples/xend-config.sxp
@@ -130,7 +130,8 @@ @@ -142,7 +142,8 @@
# #
# (network-script 'network-bridge netdev=eth1') # (network-script 'network-bridge netdev=eth1')
# #
@ -12,11 +12,11 @@ Index: xen-3.2.1-testing/tools/examples/xend-config.sxp
# #
# (network-script 'network-bridge bridge=<name>') # (network-script 'network-bridge bridge=<name>')
# #
Index: xen-3.2.1-testing/tools/ioemu/vl.c Index: xen-3.3.0-testing/tools/ioemu/vl.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/vl.c --- xen-3.3.0-testing.orig/tools/ioemu/vl.c
+++ xen-3.2.1-testing/tools/ioemu/vl.c +++ xen-3.3.0-testing/tools/ioemu/vl.c
@@ -102,8 +102,6 @@ @@ -111,8 +111,6 @@
#define DEFAULT_NETWORK_SCRIPT "/etc/xen/qemu-ifup" #define DEFAULT_NETWORK_SCRIPT "/etc/xen/qemu-ifup"
#ifdef _BSD #ifdef _BSD
#define DEFAULT_BRIDGE "bridge0" #define DEFAULT_BRIDGE "bridge0"
@ -25,7 +25,7 @@ Index: xen-3.2.1-testing/tools/ioemu/vl.c
#endif #endif
#ifdef __sun__ #ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd" #define SMBD_COMMAND "/usr/sfw/sbin/smbd"
@@ -4149,10 +4147,10 @@ static int net_client_init(const char *s @@ -4183,10 +4181,10 @@ static int net_client_init(const char *s
if (get_param_value(setup_script, sizeof(setup_script), "script", p) == 0) { if (get_param_value(setup_script, sizeof(setup_script), "script", p) == 0) {
pstrcpy(setup_script, sizeof(setup_script), DEFAULT_NETWORK_SCRIPT); pstrcpy(setup_script, sizeof(setup_script), DEFAULT_NETWORK_SCRIPT);
} }
@ -40,11 +40,11 @@ Index: xen-3.2.1-testing/tools/ioemu/vl.c
} }
} else } else
#endif #endif
Index: xen-3.2.1-testing/tools/python/xen/xend/image.py Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/image.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.2.1-testing/tools/python/xen/xend/image.py +++ xen-3.3.0-testing/tools/python/xen/xend/image.py
@@ -497,13 +497,16 @@ class HVMImageHandler(ImageHandler): @@ -766,15 +766,17 @@ class HVMImageHandler(ImageHandler):
mac = devinfo.get('mac') mac = devinfo.get('mac')
if mac is None: if mac is None:
raise VmError("MAC address not specified or generated.") raise VmError("MAC address not specified or generated.")
@ -55,18 +55,21 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/image.py
ret.append("nic,vlan=%d,macaddr=%s,model=%s" % ret.append("nic,vlan=%d,macaddr=%s,model=%s" %
(nics, mac, model)) (nics, mac, model))
ret.append("-net") ret.append("-net")
- ret.append("tap,vlan=%d,bridge=%s" % (nics, bridge)) - ret.append("tap,vlan=%d,ifname=tap%d.%d,bridge=%s" %
+ net = "tap,vlan=%d" % (nics,) - (nics, self.vm.getDomid(), nics-1, bridge))
-
+ net = "tap,vlan=%d,ifname=tap%d.%d" % (nics, self.vm.getDomid(), nics-1)
+ if bridge: + if bridge:
+ net += ",bridge=%s" % (bridge,) + net += ",bridge=%s" % bridge
+ ret.append(net) + ret.append(net)
+
return ret return ret
Index: xen-3.2.1-testing/tools/ioemu/target-i386-dm/qemu-ifup def getDeviceModelArgs(self, restore = False):
Index: xen-3.3.0-testing/tools/ioemu/target-i386-dm/qemu-ifup
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/target-i386-dm/qemu-ifup --- xen-3.3.0-testing.orig/tools/ioemu/target-i386-dm/qemu-ifup
+++ xen-3.2.1-testing/tools/ioemu/target-i386-dm/qemu-ifup +++ xen-3.3.0-testing/tools/ioemu/target-i386-dm/qemu-ifup
@@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh

View File

@ -1,10 +1,10 @@
PAE must be on for 64-on-64 to work at all. PAE must be on for 64-on-64 to work at all.
Index: xen-3.2.1-testing/tools/python/xen/xend/image.py Index: xen-3.3.0-testing/tools/python/xen/xend/image.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/image.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.2.1-testing/tools/python/xen/xend/image.py +++ xen-3.3.0-testing/tools/python/xen/xend/image.py
@@ -592,7 +592,7 @@ class X86_HVM_ImageHandler(HVMImageHandl @@ -869,7 +869,7 @@ class X86_HVM_ImageHandler(HVMImageHandl
def configure(self, vmConfig): def configure(self, vmConfig):
HVMImageHandler.configure(self, vmConfig) HVMImageHandler.configure(self, vmConfig)

View File

@ -1,11 +1,11 @@
Change default IO-APIC ack mode for single IO-APIC systems to old-style. Jan Change default IO-APIC ack mode for single IO-APIC systems to old-style. Jan
Index: xen-3.2-testing/xen/arch/x86/io_apic.c Index: xen-3.3.0-testing/xen/arch/x86/io_apic.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/xen/arch/x86/io_apic.c --- xen-3.3.0-testing.orig/xen/arch/x86/io_apic.c
+++ xen-3.2-testing/xen/arch/x86/io_apic.c +++ xen-3.3.0-testing/xen/arch/x86/io_apic.c
@@ -1336,7 +1336,7 @@ static unsigned int startup_level_ioapic @@ -1365,7 +1365,7 @@ static unsigned int startup_level_ioapic
return 0; /* don't check for pending */ return 0; /* don't check for pending */
} }
@ -14,7 +14,7 @@ Index: xen-3.2-testing/xen/arch/x86/io_apic.c
static void setup_ioapic_ack(char *s) static void setup_ioapic_ack(char *s)
{ {
if ( !strcmp(s, "old") ) if ( !strcmp(s, "old") )
@@ -1774,6 +1774,8 @@ void __init setup_IO_APIC(void) @@ -1856,6 +1856,8 @@ void __init setup_IO_APIC(void)
else else
io_apic_irqs = ~PIC_IRQS; io_apic_irqs = ~PIC_IRQS;

View File

@ -1,8 +1,8 @@
Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c Index: xen-3.3.0-testing/tools/ioemu/hw/ide.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/hw/ide.c --- xen-3.3.0-testing.orig/tools/ioemu/hw/ide.c
+++ xen-3.2.1-testing/tools/ioemu/hw/ide.c +++ xen-3.3.0-testing/tools/ioemu/hw/ide.c
@@ -395,6 +395,9 @@ typedef struct PCIIDEState { @@ -406,6 +406,9 @@ typedef struct PCIIDEState {
int type; /* see IDE_TYPE_xxx */ int type; /* see IDE_TYPE_xxx */
} PCIIDEState; } PCIIDEState;
@ -12,7 +12,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c
#if defined(__ia64__) #if defined(__ia64__)
#include <xen/hvm/ioreq.h> #include <xen/hvm/ioreq.h>
@@ -2288,6 +2291,27 @@ static void ide_reset(IDEState *s) @@ -2305,6 +2308,27 @@ static void ide_reset(IDEState *s)
ide_dummy_transfer_stop(s); ide_dummy_transfer_stop(s);
} }
@ -40,7 +40,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c
struct partition { struct partition {
uint8_t boot_ind; /* 0x80 - active */ uint8_t boot_ind; /* 0x80 - active */
uint8_t head; /* starting head */ uint8_t head; /* starting head */
@@ -2689,6 +2713,9 @@ void pci_cmd646_ide_init(PCIBus *bus, Bl @@ -2707,6 +2731,9 @@ void pci_cmd646_ide_init(PCIBus *bus, Bl
sizeof(PCIIDEState), sizeof(PCIIDEState),
-1, -1,
NULL, NULL); NULL, NULL);
@ -50,7 +50,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c
d->type = IDE_TYPE_CMD646; d->type = IDE_TYPE_CMD646;
pci_conf = d->dev.config; pci_conf = d->dev.config;
pci_conf[0x00] = 0x95; // CMD646 pci_conf[0x00] = 0x95; // CMD646
@@ -2863,6 +2890,9 @@ void pci_piix_ide_init(PCIBus *bus, Bloc @@ -2884,6 +2911,9 @@ void pci_piix_ide_init(PCIBus *bus, Bloc
NULL, NULL); NULL, NULL);
d->type = IDE_TYPE_PIIX3; d->type = IDE_TYPE_PIIX3;
@ -60,7 +60,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c
pci_conf = d->dev.config; pci_conf = d->dev.config;
pci_conf[0x00] = 0x86; // Intel pci_conf[0x00] = 0x86; // Intel
pci_conf[0x01] = 0x80; pci_conf[0x01] = 0x80;
@@ -2909,6 +2939,9 @@ void pci_piix3_ide_init(PCIBus *bus, Blo @@ -2930,6 +2960,9 @@ void pci_piix3_ide_init(PCIBus *bus, Blo
NULL, NULL); NULL, NULL);
d->type = IDE_TYPE_PIIX3; d->type = IDE_TYPE_PIIX3;
@ -70,11 +70,11 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c
pci_conf = d->dev.config; pci_conf = d->dev.config;
pci_conf[0x00] = 0x86; // Intel pci_conf[0x00] = 0x86; // Intel
pci_conf[0x01] = 0x80; pci_conf[0x01] = 0x80;
Index: xen-3.2.1-testing/tools/ioemu/hw/pci.c Index: xen-3.3.0-testing/tools/ioemu/hw/pci.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/hw/pci.c --- xen-3.3.0-testing.orig/tools/ioemu/hw/pci.c
+++ xen-3.2.1-testing/tools/ioemu/hw/pci.c +++ xen-3.3.0-testing/tools/ioemu/hw/pci.c
@@ -573,6 +573,28 @@ void pci_nic_init(PCIBus *bus, NICInfo * @@ -594,6 +594,28 @@ void pci_nic_init(PCIBus *bus, NICInfo *
} }
} }
@ -103,10 +103,10 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/pci.c
typedef struct { typedef struct {
PCIDevice dev; PCIDevice dev;
PCIBus *bus; PCIBus *bus;
Index: xen-3.2.1-testing/tools/ioemu/hw/xen_platform.c Index: xen-3.3.0-testing/tools/ioemu/hw/xen_platform.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/hw/xen_platform.c --- xen-3.3.0-testing.orig/tools/ioemu/hw/xen_platform.c
+++ xen-3.2.1-testing/tools/ioemu/hw/xen_platform.c +++ xen-3.3.0-testing/tools/ioemu/hw/xen_platform.c
@@ -23,15 +23,53 @@ @@ -23,15 +23,53 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
@ -162,13 +162,13 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/xen_platform.c
} }
static uint32_t platform_mmio_read(void *opaque, target_phys_addr_t addr) static uint32_t platform_mmio_read(void *opaque, target_phys_addr_t addr)
Index: xen-3.2.1-testing/tools/ioemu/vl.c Index: xen-3.3.0-testing/tools/ioemu/vl.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/vl.c --- xen-3.3.0-testing.orig/tools/ioemu/vl.c
+++ xen-3.2.1-testing/tools/ioemu/vl.c +++ xen-3.3.0-testing/tools/ioemu/vl.c
@@ -197,6 +197,20 @@ int xc_handle; @@ -217,6 +217,20 @@ extern int domid;
char domain_name[64] = "Xen-no-name";
extern int domid; PCI_EMULATION_INFO *PciEmulationInfoHead = NULL;
+typedef struct IOHandlerRecord { +typedef struct IOHandlerRecord {
+ int fd; + int fd;
@ -187,7 +187,7 @@ Index: xen-3.2.1-testing/tools/ioemu/vl.c
/***********************************************************/ /***********************************************************/
/* x86 ISA bus support */ /* x86 ISA bus support */
@@ -3424,6 +3438,7 @@ void net_slirp_smb(const char *exported_ @@ -3449,6 +3463,7 @@ void net_slirp_smb(const char *exported_
typedef struct TAPState { typedef struct TAPState {
VLANClientState *vc; VLANClientState *vc;
int fd; int fd;
@ -195,7 +195,7 @@ Index: xen-3.2.1-testing/tools/ioemu/vl.c
} TAPState; } TAPState;
static void tap_receive(void *opaque, const uint8_t *buf, int size) static void tap_receive(void *opaque, const uint8_t *buf, int size)
@@ -3451,6 +3466,36 @@ static void tap_send(void *opaque) @@ -3476,6 +3491,36 @@ static void tap_send(void *opaque)
} }
} }
@ -232,7 +232,7 @@ Index: xen-3.2.1-testing/tools/ioemu/vl.c
/* fd support */ /* fd support */
static TAPState *net_tap_fd_init(VLANState *vlan, int fd) static TAPState *net_tap_fd_init(VLANState *vlan, int fd)
@@ -3462,6 +3507,8 @@ static TAPState *net_tap_fd_init(VLANSta @@ -3487,6 +3532,8 @@ static TAPState *net_tap_fd_init(VLANSta
return NULL; return NULL;
s->fd = fd; s->fd = fd;
s->vc = qemu_new_vlan_client(vlan, tap_receive, NULL, s); s->vc = qemu_new_vlan_client(vlan, tap_receive, NULL, s);
@ -241,7 +241,7 @@ Index: xen-3.2.1-testing/tools/ioemu/vl.c
qemu_set_fd_handler(s->fd, tap_send, NULL, s); qemu_set_fd_handler(s->fd, tap_send, NULL, s);
snprintf(s->vc->info_str, sizeof(s->vc->info_str), "tap: fd=%d", fd); snprintf(s->vc->info_str, sizeof(s->vc->info_str), "tap: fd=%d", fd);
return s; return s;
@@ -4432,20 +4479,6 @@ void dumb_display_init(DisplayState *ds) @@ -4500,20 +4547,6 @@ void dumb_display_init(DisplayState *ds)
#define MAX_IO_HANDLERS 64 #define MAX_IO_HANDLERS 64
@ -262,11 +262,11 @@ Index: xen-3.2.1-testing/tools/ioemu/vl.c
/* XXX: fd_read_poll should be suppressed, but an API change is /* XXX: fd_read_poll should be suppressed, but an API change is
necessary in the character devices to suppress fd_can_read(). */ necessary in the character devices to suppress fd_can_read(). */
int qemu_set_fd_handler2(int fd, int qemu_set_fd_handler2(int fd,
Index: xen-3.2.1-testing/tools/ioemu/vl.h Index: xen-3.3.0-testing/tools/ioemu/vl.h
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/vl.h --- xen-3.3.0-testing.orig/tools/ioemu/vl.h
+++ xen-3.2.1-testing/tools/ioemu/vl.h +++ xen-3.3.0-testing/tools/ioemu/vl.h
@@ -1501,6 +1501,8 @@ void kqemu_record_dump(void); @@ -1578,6 +1578,8 @@ void kqemu_record_dump(void);
extern char domain_name[]; extern char domain_name[];
void destroy_hvm_domain(void); void destroy_hvm_domain(void);

View File

@ -1,8 +1,8 @@
Index: xen-3.2-testing/xen/arch/x86/x86_32/mm.c Index: xen-3.3.0-testing/xen/arch/x86/x86_32/mm.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/xen/arch/x86/x86_32/mm.c --- xen-3.3.0-testing.orig/xen/arch/x86/x86_32/mm.c
+++ xen-3.2-testing/xen/arch/x86/x86_32/mm.c +++ xen-3.3.0-testing/xen/arch/x86/x86_32/mm.c
@@ -66,6 +66,8 @@ l2_pgentry_t *virt_to_xen_l2e(unsigned l @@ -63,6 +63,8 @@ l2_pgentry_t *virt_to_xen_l2e(unsigned l
return &idle_pg_table_l2[l2_linear_offset(v)]; return &idle_pg_table_l2[l2_linear_offset(v)];
} }
@ -11,7 +11,7 @@ Index: xen-3.2-testing/xen/arch/x86/x86_32/mm.c
void __init paging_init(void) void __init paging_init(void)
{ {
unsigned long v; unsigned long v;
@@ -137,6 +139,20 @@ void __init setup_idle_pagetable(void) @@ -130,6 +132,20 @@ void __init setup_idle_pagetable(void)
l2e_from_page(virt_to_page(idle_vcpu[0]->domain-> l2e_from_page(virt_to_page(idle_vcpu[0]->domain->
arch.mm_perdomain_pt) + i, arch.mm_perdomain_pt) + i,
__PAGE_HYPERVISOR)); __PAGE_HYPERVISOR));
@ -32,11 +32,11 @@ Index: xen-3.2-testing/xen/arch/x86/x86_32/mm.c
} }
void __init zap_low_mappings(l2_pgentry_t *dom0_l2) void __init zap_low_mappings(l2_pgentry_t *dom0_l2)
Index: xen-3.2-testing/xen/common/page_alloc.c Index: xen-3.3.0-testing/xen/common/page_alloc.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/xen/common/page_alloc.c --- xen-3.3.0-testing.orig/xen/common/page_alloc.c
+++ xen-3.2-testing/xen/common/page_alloc.c +++ xen-3.3.0-testing/xen/common/page_alloc.c
@@ -52,6 +52,20 @@ static int opt_bootscrub __initdata = 1; @@ -53,6 +53,20 @@ static int opt_bootscrub __initdata = 1;
boolean_param("bootscrub", opt_bootscrub); boolean_param("bootscrub", opt_bootscrub);
/* /*

View File

@ -1,8 +1,8 @@
Index: xen-3.2-testing/tools/python/xen/xend/XendNode.py Index: xen-3.3.0-testing/tools/python/xen/xend/XendNode.py
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/python/xen/xend/XendNode.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/XendNode.py
+++ xen-3.2-testing/tools/python/xen/xend/XendNode.py +++ xen-3.3.0-testing/tools/python/xen/xend/XendNode.py
@@ -593,11 +593,35 @@ class XendNode: @@ -649,11 +649,35 @@ class XendNode:
info['cpu_mhz'] = info['cpu_khz'] / 1000 info['cpu_mhz'] = info['cpu_khz'] / 1000
@ -43,8 +43,8 @@ Index: xen-3.2-testing/tools/python/xen/xend/XendNode.py
ITEM_ORDER = ['nr_cpus', ITEM_ORDER = ['nr_cpus',
'nr_nodes', 'nr_nodes',
@@ -607,6 +631,9 @@ class XendNode: @@ -664,6 +688,9 @@ class XendNode:
'hw_caps', 'virt_caps',
'total_memory', 'total_memory',
'free_memory', 'free_memory',
+ 'max_free_memory', + 'max_free_memory',
@ -53,10 +53,10 @@ Index: xen-3.2-testing/tools/python/xen/xend/XendNode.py
'node_to_cpu', 'node_to_cpu',
'node_to_memory' 'node_to_memory'
] ]
Index: xen-3.2-testing/tools/python/xen/xend/balloon.py Index: xen-3.3.0-testing/tools/python/xen/xend/balloon.py
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/python/xen/xend/balloon.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/balloon.py
+++ xen-3.2-testing/tools/python/xen/xend/balloon.py +++ xen-3.3.0-testing/tools/python/xen/xend/balloon.py
@@ -41,6 +41,8 @@ SLEEP_TIME_GROWTH = 0.1 @@ -41,6 +41,8 @@ SLEEP_TIME_GROWTH = 0.1
# label actually shown in the PROC_XEN_BALLOON file. # label actually shown in the PROC_XEN_BALLOON file.
labels = { 'current' : 'Current allocation', labels = { 'current' : 'Current allocation',
@ -90,13 +90,13 @@ Index: xen-3.2-testing/tools/python/xen/xend/balloon.py
def free(need_mem): def free(need_mem):
"""Balloon out memory from the privileged domain so that there is the """Balloon out memory from the privileged domain so that there is the
specified required amount (in KiB) free. specified required amount (in KiB) free.
Index: xen-3.2-testing/tools/python/xen/xend/XendDomainInfo.py Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/python/xen/xend/XendDomainInfo.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2-testing/tools/python/xen/xend/XendDomainInfo.py +++ xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -685,6 +685,27 @@ class XendDomainInfo: @@ -1010,6 +1010,27 @@ class XendDomainInfo:
return dev_info
return None
+ def capAndSetMemoryTarget(self, target): + def capAndSetMemoryTarget(self, target):
+ """Potentially lowers the requested target to the largest possible + """Potentially lowers the requested target to the largest possible
@ -122,11 +122,11 @@ Index: xen-3.2-testing/tools/python/xen/xend/XendDomainInfo.py
def setMemoryTarget(self, target): def setMemoryTarget(self, target):
"""Set the memory target of this domain. """Set the memory target of this domain.
@param target: In MiB. @param target: In MiB.
Index: xen-3.2-testing/tools/python/xen/xend/server/SrvDomain.py Index: xen-3.3.0-testing/tools/python/xen/xend/server/SrvDomain.py
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/python/xen/xend/server/SrvDomain.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/server/SrvDomain.py
+++ xen-3.2-testing/tools/python/xen/xend/server/SrvDomain.py +++ xen-3.3.0-testing/tools/python/xen/xend/server/SrvDomain.py
@@ -170,7 +170,7 @@ class SrvDomain(SrvDir): @@ -171,7 +171,7 @@ class SrvDomain(SrvDir):
def op_mem_target_set(self, _, req): def op_mem_target_set(self, _, req):

View File

@ -1,12 +1,12 @@
Index: xen-3.2-testing/tools/python/xen/xm/create.py Index: xen-3.3.0-testing/tools/python/xen/xm/create.py
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/python/xen/xm/create.py --- xen-3.3.0-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.2-testing/tools/python/xen/xm/create.py +++ xen-3.3.0-testing/tools/python/xen/xm/create.py
@@ -897,9 +897,8 @@ def preprocess_access_control(vals): @@ -1044,9 +1044,8 @@ def preprocess_access_control(vals):
def preprocess_ip(vals): def preprocess_ip(vals):
if vals.ip or vals.dhcp != 'off': if vals.ip or vals.dhcp != 'off':
- dummy_nfs_server = '1.2.3.4' - dummy_nfs_server = '127.0.255.255'
ip = (vals.ip ip = (vals.ip
- + ':' + (vals.nfs_server or dummy_nfs_server) - + ':' + (vals.nfs_server or dummy_nfs_server)
+ + ':' + (vals.nfs_server or '') + + ':' + (vals.nfs_server or '')

View File

@ -1,8 +1,8 @@
Index: xen-3.1-testing/tools/python/xen/xm/create.py Index: xen-3.3.0-testing/tools/python/xen/xm/create.py
=================================================================== ===================================================================
--- xen-3.1-testing.orig/tools/python/xen/xm/create.py --- xen-3.3.0-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.1-testing/tools/python/xen/xm/create.py +++ xen-3.3.0-testing/tools/python/xen/xm/create.py
@@ -67,7 +67,7 @@ gopts.opt('quiet', short='q', @@ -68,7 +68,7 @@ gopts.opt('quiet', short='q',
use="Quiet.") use="Quiet.")
gopts.opt('path', val='PATH', gopts.opt('path', val='PATH',
@ -11,10 +11,10 @@ Index: xen-3.1-testing/tools/python/xen/xm/create.py
use="Search path for configuration scripts. " use="Search path for configuration scripts. "
"The value of PATH is a colon-separated directory list.") "The value of PATH is a colon-separated directory list.")
Index: xen-3.1-testing/docs/man/xm.pod.1 Index: xen-3.3.0-testing/docs/man/xm.pod.1
=================================================================== ===================================================================
--- xen-3.1-testing.orig/docs/man/xm.pod.1 --- xen-3.3.0-testing.orig/docs/man/xm.pod.1
+++ xen-3.1-testing/docs/man/xm.pod.1 +++ xen-3.3.0-testing/docs/man/xm.pod.1
@@ -76,7 +76,7 @@ format, and possible options used in eit @@ -76,7 +76,7 @@ format, and possible options used in eit
I<name>=I<value> combinations. I<name>=I<value> combinations.
@ -33,10 +33,10 @@ Index: xen-3.1-testing/docs/man/xm.pod.1
soon as it is run. soon as it is run.
=item I<without config file> =item I<without config file>
Index: xen-3.1-testing/docs/man/xmdomain.cfg.pod.5 Index: xen-3.3.0-testing/docs/man/xmdomain.cfg.pod.5
=================================================================== ===================================================================
--- xen-3.1-testing.orig/docs/man/xmdomain.cfg.pod.5 --- xen-3.3.0-testing.orig/docs/man/xmdomain.cfg.pod.5
+++ xen-3.1-testing/docs/man/xmdomain.cfg.pod.5 +++ xen-3.3.0-testing/docs/man/xmdomain.cfg.pod.5
@@ -4,9 +4,9 @@ xmdomain.cfg - xm domain config file for @@ -4,9 +4,9 @@ xmdomain.cfg - xm domain config file for
=head1 SYNOPSIS =head1 SYNOPSIS

View File

@ -1,146 +0,0 @@
Index: xen-3.2-testing/tools/ioemu/hw/xenfb.c
===================================================================
--- xen-3.2-testing.orig/tools/ioemu/hw/xenfb.c 2008-04-29 08:52:06.000000000 -0600
+++ xen-3.2-testing/tools/ioemu/hw/xenfb.c 2008-04-29 10:12:41.000000000 -0600
@@ -23,8 +23,6 @@
#define BTN_LEFT 0x110 /* from <linux/input.h> */
#endif
-// FIXME defend against malicious frontend?
-
struct xenfb;
struct xenfb_device {
@@ -50,6 +48,7 @@
int depth; /* colour depth of guest framebuffer */
int width; /* pixel width of guest framebuffer */
int height; /* pixel height of guest framebuffer */
+ int offset; /* offset of the framebuffer */
int abs_pointer_wanted; /* Whether guest supports absolute pointer */
int button_state; /* Last seen pointer button state */
char protocol[64]; /* frontend protocol */
@@ -476,6 +475,75 @@
free(xenfb);
}
+static int xenfb_configure_fb(struct xenfb *xenfb, size_t fb_len_lim,
+ int width, int height, int depth,
+ size_t fb_len, int offset, int row_stride)
+{
+ size_t mfn_sz = sizeof(*((struct xenfb_page *)0)->pd);
+ size_t pd_len = sizeof(((struct xenfb_page *)0)->pd) / mfn_sz;
+ size_t fb_pages = pd_len * XC_PAGE_SIZE / mfn_sz;
+ size_t fb_len_max = fb_pages * XC_PAGE_SIZE;
+ int max_width, max_height;
+
+ if (fb_len_lim == 0) {
+ fprintf(stderr,
+ "FB: No fb size limit, limit set to %zu\n",
+ fb_len_max);
+ fb_len_lim = fb_len_max;
+ }
+ if (fb_len_lim > fb_len_max) {
+ fprintf(stderr,
+ "FB: fb size limit %zu exceeds %zu, corrected\n",
+ fb_len_lim, fb_len_max);
+ fb_len_lim = fb_len_max;
+ }
+ if (fb_len > fb_len_lim) {
+ fprintf(stderr,
+ "FB: frontend fb size %zu limited to %zu\n",
+ fb_len, fb_len_lim);
+ fb_len = fb_len_lim;
+ }
+ if (depth != 8 && depth != 16 && depth != 24 && depth != 32) {
+ fprintf(stderr,
+ "FB: can't handle frontend fb depth %d\n",
+ depth);
+ return -1;
+ }
+ if (row_stride < 0 || row_stride > fb_len) {
+ fprintf(stderr,
+ "FB: invalid frontend stride %d\n", row_stride);
+ return -1;
+ }
+ max_width = row_stride / (depth / 8);
+ if (width < 0 || width > max_width) {
+ fprintf(stderr,
+ "FB: invalid frontend width %d limited to %d\n",
+ width, max_width);
+ width = max_width;
+ }
+ if (offset < 0 || offset >= fb_len) {
+ fprintf(stderr,
+ "FB: invalid frontend offset %d (max %zu)\n",
+ offset, fb_len - 1);
+ return -1;
+ }
+ max_height = (fb_len - offset) / row_stride;
+ if (height < 0 || height > max_height) {
+ fprintf(stderr,
+ "FB: invalid frontend height %d limited to %d\n",
+ height, max_height);
+ height = max_height;
+ }
+ xenfb->fb_len = fb_len;
+ xenfb->row_stride = row_stride;
+ xenfb->depth = depth;
+ xenfb->width = width;
+ xenfb->height = height;
+ xenfb->offset = offset;
+ fprintf(stderr, "Framebuffer %dx%dx%d offset %d stride %d\n",
+ width, height, depth, offset, row_stride);
+ return 0;
+}
static void xenfb_on_fb_event(struct xenfb *xenfb)
{
@@ -511,10 +579,17 @@
xenfb_guest_copy(xenfb, x, y, w, h);
break;
case XENFB_TYPE_RESIZE:
- xenfb->width = event->resize.width;
- xenfb->height = event->resize.height;
- xenfb->row_stride = event->resize.stride;
+ if (xenfb_configure_fb(xenfb, xenfb->fb_len,
+ event->resize.width,
+ event->resize.height,
+ event->resize.depth,
+ xenfb->fb_len,
+ 0,
+ event->resize.stride) < 0)
+ break;
+
dpy_resize(xenfb->ds, xenfb->width, xenfb->height);
+ xenfb_invalidate(xenfb);
break;
}
}
@@ -695,22 +770,14 @@
if (xenfb_xs_scanf1(xenfb->xsh, xenfb->fb.nodename, "videoram", "%d", &videoram) < 0)
videoram = 0;
- videoram = videoram * 1024 * 1024;
fb_page = xenfb->fb.page;
- xenfb->depth = fb_page->depth;
- xenfb->width = fb_page->width;
- xenfb->height = fb_page->height;
- xenfb->fb_len = fb_page->mem_length;
- xenfb->row_stride = fb_page->line_length;
- /* Protect against hostile frontend, limit fb_len to configured */
- if (videoram && xenfb->fb_len > videoram) {
- xenfb->fb_len = videoram;
- if (xenfb->row_stride * xenfb->height > xenfb->fb_len)
- xenfb->height = xenfb->fb_len / xenfb->row_stride;
+ if (xenfb_configure_fb(xenfb, videoram * 1024 * 1024U,
+ fb_page->width, fb_page->height, fb_page->depth,
+ fb_page->mem_length, 0, fb_page->line_length) < 0) {
+ errno = EINVAL;
+ return -1;
}
- fprintf(stderr, "Framebuffer depth %d width %d height %d line %d\n",
- fb_page->depth, fb_page->width, fb_page->height, fb_page->line_length);
if (xenfb_map_fb(xenfb, xenfb->fb.otherend_id) < 0)
return -1;

View File

@ -1,22 +0,0 @@
Index: xen-3.2.1-testing/tools/ioemu/vl.c
===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/vl.c 2008-05-27 13:21:02.000000000 -0600
+++ xen-3.2.1-testing/tools/ioemu/vl.c 2008-05-27 13:26:47.000000000 -0600
@@ -7682,7 +7682,6 @@
init_timers();
init_timer_alarm();
- qemu_aio_init();
#ifdef _WIN32
socket_init();
@@ -7887,6 +7886,9 @@
direct_pci);
free(boot_device);
+ /* Must be after the machine init, otherwise signal can go to wrong thread*/
+ qemu_aio_init();
+
/* init USB devices */
if (usb_enabled) {
for(i = 0; i < usb_devices_index; i++) {

View File

@ -1,16 +1,16 @@
Index: xen-3.2.1-testing/tools/ioemu/xenstore.c Index: xen-3.3.0-testing/tools/ioemu/xenstore.c
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/ioemu/xenstore.c --- xen-3.3.0-testing.orig/tools/ioemu/xenstore.c
+++ xen-3.2.1-testing/tools/ioemu/xenstore.c +++ xen-3.3.0-testing/tools/ioemu/xenstore.c
@@ -91,6 +91,7 @@ void xenstore_parse_domain_config(int do @@ -88,6 +88,7 @@ void xenstore_parse_domain_config(int hv
char *fpath = NULL, *bpath = NULL, *btype = NULL, char *fpath = NULL, *bpath = NULL, *btype = NULL,
*dev = NULL, *params = NULL, *type = NULL, *drv = NULL; *dev = NULL, *params = NULL, *type = NULL, *drv = NULL;
int i, is_scsi, is_tap, is_hdN = 0; int i, is_scsi, is_tap, is_hdN = 0;
+ int j; + int j;
unsigned int len, num, hd_index; unsigned int len, num, hd_index, pci_devid = 0;
BlockDriverState *bs; BlockDriverState *bs;
BlockDriver *format;
@@ -173,12 +174,7 @@ void xenstore_parse_domain_config(int do @@ -179,12 +180,7 @@ void xenstore_parse_domain_config(int hv
continue; continue;
free(type); free(type);
type = xs_read(xsh, XBT_NULL, buf, &len); type = xs_read(xsh, XBT_NULL, buf, &len);
@ -24,7 +24,7 @@ Index: xen-3.2.1-testing/tools/ioemu/xenstore.c
/* read the name of the device */ /* read the name of the device */
if (pasprintf(&buf, "%s/type", bpath) == -1) if (pasprintf(&buf, "%s/type", bpath) == -1)
continue; continue;
@@ -186,6 +182,35 @@ void xenstore_parse_domain_config(int do @@ -192,6 +188,35 @@ void xenstore_parse_domain_config(int hv
drv = xs_read(xsh, XBT_NULL, buf, &len); drv = xs_read(xsh, XBT_NULL, buf, &len);
if (drv == NULL) if (drv == NULL)
continue; continue;
@ -57,6 +57,6 @@ Index: xen-3.2.1-testing/tools/ioemu/xenstore.c
+ continue; + continue;
+ } + }
+ +
/* Strip off blktap sub-type prefix aio: - QEMU can autodetect this */ /* Obtain blktap sub-type prefix */
if (!strcmp(drv, "tap") && params[0]) { if (!strcmp(drv, "tap") && params[0]) {
char *offset = strchr(params, ':'); char *offset = strchr(params, ':');

View File

@ -1,42 +1,25 @@
Index: xen-3.2-testing/tools/blktap/drivers/Makefile Index: xen-3.3.0-testing/tools/blktap/drivers/Makefile
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/blktap/drivers/Makefile --- xen-3.3.0-testing.orig/tools/blktap/drivers/Makefile
+++ xen-3.2-testing/tools/blktap/drivers/Makefile +++ xen-3.3.0-testing/tools/blktap/drivers/Makefile
@@ -8,7 +8,6 @@ QCOW_UTIL = img2qcow qcow2raw qcow-cr @@ -5,7 +5,6 @@ IBIN = blktapctrl tapdisk
INST_DIR = /usr/sbin QCOW_UTIL = img2qcow qcow2raw qcow-create
LIBAIO_DIR = ../../libaio/src LIBAIO_DIR = ../../libaio/src
-CFLAGS += -Werror -CFLAGS += -Werror
CFLAGS += -Wno-unused CFLAGS += -Wno-unused
CFLAGS += -I $(XEN_LIBXC) -I $(LIBAIO_DIR) CFLAGS += -I../lib
CFLAGS += $(INCLUDES) -I. -I../../xenstore CFLAGS += $(CFLAGS_libxenctrl)
Index: xen-3.2-testing/Config.mk Index: xen-3.3.0-testing/Config.mk
=================================================================== ===================================================================
--- xen-3.2-testing.orig/Config.mk --- xen-3.3.0-testing.orig/Config.mk
+++ xen-3.2-testing/Config.mk +++ xen-3.3.0-testing/Config.mk
@@ -19,7 +19,7 @@ SHELL ?= /bin/sh @@ -14,7 +14,7 @@ SHELL ?= /bin/sh
# Tools to run on system hosting the build # Tools to run on system hosting the build
HOSTCC = gcc HOSTCC = gcc
-HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer -HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes $(RPM_OPT_FLAGS) +HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes $(RPM_OPT_FLAGS)
HOSTCFLAGS += -fno-strict-aliasing HOSTCFLAGS += -fno-strict-aliasing
HOSTCFLAGS_x86_32 = -m32
HOSTCFLAGS_x86_64 = -m64
Index: xen-3.2-testing/tools/libxen/Makefile
===================================================================
--- xen-3.2-testing.orig/tools/libxen/Makefile
+++ xen-3.2-testing/tools/libxen/Makefile
@@ -21,10 +21,10 @@ include $(XEN_ROOT)/tools/Rules.mk
MAJOR = 1.0
MINOR = 0
-CFLAGS = -Iinclude \ DISTDIR ?= $(XEN_ROOT)/dist
+CFLAGS += -Iinclude \
$(shell xml2-config --cflags) \
$(shell curl-config --cflags) \
- -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC
+ -std=c99 -fPIC
LDFLAGS = $(shell xml2-config --libs) \
$(shell curl-config --libs)

View File

@ -1,99 +0,0 @@
Index: xen-3.2-testing/tools/ioemu/keymaps.c
===================================================================
--- xen-3.2-testing.orig/tools/ioemu/keymaps.c 2008-01-16 13:19:03.000000000 -0700
+++ xen-3.2-testing/tools/ioemu/keymaps.c 2008-05-07 09:02:03.000000000 -0600
@@ -50,6 +50,7 @@
struct key_range *keypad_range;
struct key_range *numlock_range;
struct key_range *shift_range;
+ struct key_range *localstate_range;
} kbd_layout_t;
static void add_to_key_range(struct key_range **krp, int code) {
@@ -126,11 +127,15 @@
if (rest && strstr(rest, "numlock")) {
add_to_key_range(&k->keypad_range, keycode);
add_to_key_range(&k->numlock_range, keysym);
- fprintf(stderr, "keypad keysym %04x keycode %d\n", keysym, keycode);
+ //fprintf(stderr, "keypad keysym %04x keycode %d\n", keysym, keycode);
}
if (rest && strstr(rest, "shift")) {
add_to_key_range(&k->shift_range, keysym);
- fprintf(stderr, "shift keysym %04x keycode %d\n", keysym, keycode);
+ //fprintf(stderr, "shift keysym %04x keycode %d\n", keysym, keycode);
+ }
+ if (rest && strstr(rest, "localstate")) {
+ add_to_key_range(&k->localstate_range, keycode);
+ //fprintf(stderr, "localstate keysym %04x keycode %d\n", keysym, keycode);
}
/* if(keycode&0x80)
@@ -221,3 +226,14 @@
return 1;
return 0;
}
+
+static int keycodeIsShiftable(void *kbd_layout, int keycode)
+{
+ kbd_layout_t *k = kbd_layout;
+ struct key_range *kr;
+
+ for (kr = k->localstate_range; kr; kr = kr->next)
+ if (keycode >= kr->start && keycode <= kr->end)
+ return 0;
+ return 1;
+}
Index: xen-3.2-testing/tools/ioemu/vnc.c
===================================================================
--- xen-3.2-testing.orig/tools/ioemu/vnc.c 2008-05-06 14:38:17.000000000 -0600
+++ xen-3.2-testing/tools/ioemu/vnc.c 2008-05-07 09:01:10.000000000 -0600
@@ -1107,6 +1107,7 @@
int keycode;
int shift_keys = 0;
int shift = 0;
+ int keypad = 0;
if (is_graphic_console()) {
if (sym >= 'A' && sym <= 'Z') {
@@ -1163,7 +1164,8 @@
return;
}
- if (keycodeIsKeypad(vs->kbd_layout, keycode)) {
+ keypad = keycodeIsKeypad(vs->kbd_layout, keycode);
+ if (keypad) {
/* If the numlock state needs to change then simulate an additional
keypress before sending this one. This will happen if the user
toggles numlock away from the VNC window.
@@ -1183,14 +1185,15 @@
if (is_graphic_console()) {
/* If the shift state needs to change then simulate an additional
- keypress before sending this one. Ignore for escape key, need to
- enhance for other non shiftable keys.
+ keypress before sending this one. Ignore for keypad keys and
+ those that have localstate, See keymaps/common
*/
- if (shift && !shift_keys && keycode != 1) {
+ if (shift && !shift_keys) {
press_key_shift_down(vs, down, keycode);
return;
}
- else if (!shift && shift_keys && keycode != 1) {
+ else if (!shift && shift_keys && !keypad &&
+ keycodeIsShiftable(vs->kbd_layout, keycode)) {
press_key_shift_up(vs, down, keycode);
return;
}
Index: xen-3.2-testing/tools/ioemu/vnc_keysym.h
===================================================================
--- xen-3.2-testing.orig/tools/ioemu/vnc_keysym.h 2008-01-16 13:19:03.000000000 -0700
+++ xen-3.2-testing/tools/ioemu/vnc_keysym.h 2008-05-07 09:01:26.000000000 -0600
@@ -345,6 +345,7 @@
{"Num_Lock", 0xff7f}, /* XK_Num_Lock */
{"Pause", 0xff13}, /* XK_Pause */
{"Escape", 0xff1b}, /* XK_Escape */
+{"ISO_Left_Tab", 0xfe20},/* XK_ISO_Left_Tab */
/* localized keys */
{"BackApostrophe", 0xff21},

View File

@ -1,8 +1,8 @@
Index: xen-3.2-testing/tools/python/xen/xm/create.py Index: xen-3.3.0-testing/tools/python/xen/xm/create.py
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/python/xen/xm/create.py --- xen-3.3.0-testing.orig/tools/python/xen/xm/create.py
+++ xen-3.2-testing/tools/python/xen/xm/create.py +++ xen-3.3.0-testing/tools/python/xen/xm/create.py
@@ -991,8 +991,7 @@ def spawn_vnc(display): @@ -1138,8 +1138,7 @@ def spawn_vnc(display):
returns the port that the vncviewer is listening on and sets the global returns the port that the vncviewer is listening on and sets the global
vncpid. On failure, returns 0. Note that vncviewer is daemonized. vncpid. On failure, returns 0. Note that vncviewer is daemonized.
""" """

View File

@ -1,30 +1,30 @@
Index: xen-3.2-testing/tools/ioemu/vnc.c Index: xen-3.3.0-testing/tools/ioemu/vnc.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/ioemu/vnc.c 2008-05-09 12:16:09.000000000 -0600 --- xen-3.3.0-testing.orig/tools/ioemu/vnc.c
+++ xen-3.2-testing/tools/ioemu/vnc.c 2008-05-09 12:21:37.000000000 -0600 +++ xen-3.3.0-testing/tools/ioemu/vnc.c
@@ -244,6 +244,7 @@ @@ -278,6 +278,7 @@ static void dequeue_framebuffer_update(V
static void vnc_update_client(void *opaque); static int is_empty_queue(VncState *vs);
static void vnc_client_read(void *opaque); static void free_queue(VncState *vs);
static void framebuffer_set_updated(VncState *vs, int x, int y, int w, int h); static void vnc_colourdepth(DisplayState *ds, int depth);
+static void vnc_write_newsize(VncState *vs); +static void vnc_write_newsize(VncState *vs);
#if 0 #if 0
static inline void vnc_set_bit(uint32_t *d, int k) static inline void vnc_set_bit(uint32_t *d, int k)
@@ -356,11 +357,7 @@ @@ -407,11 +408,7 @@ static void vnc_dpy_resize_shared(Displa
ds->height = h; vs->width = ds->width;
ds->linesize = w * vs->depth; vs->height = ds->height;
if (vs->csock != -1 && vs->has_resize && size_changed) { if (vs->update_requested) {
- vnc_write_u8(vs, 0); /* msg id */ - vnc_write_u8(vs, 0); /* msg id */
- vnc_write_u8(vs, 0); - vnc_write_u8(vs, 0);
- vnc_write_u16(vs, 1); /* number of rects */ - vnc_write_u16(vs, 1); /* number of rects */
- vnc_framebuffer_update(vs, 0, 0, ds->width, ds->height, -223); - vnc_framebuffer_update(vs, 0, 0, ds->width, ds->height, -223);
- vnc_flush(vs); - vnc_flush(vs);
+ vnc_write_newsize(vs); + vnc_write_newsize(vs);
vs->width = ds->width; vs->update_requested--;
vs->height = ds->height; } else {
} enqueue_framebuffer_update(vs, 0, 0, ds->width, ds->height, -223);
@@ -370,6 +367,15 @@ @@ -429,6 +426,15 @@ static void vnc_dpy_resize(DisplayState
framebuffer_set_updated(vs, 0, 0, ds->width, ds->height); vnc_dpy_resize_shared(ds, w, h, 0, w * (ds->depth / 8), NULL);
} }
+static void vnc_write_newsize(VncState *vs) +static void vnc_write_newsize(VncState *vs)
@ -39,7 +39,7 @@ Index: xen-3.2-testing/tools/ioemu/vnc.c
/* fastest code */ /* fastest code */
static void vnc_write_pixels_copy(VncState *vs, void *pixels, int size) static void vnc_write_pixels_copy(VncState *vs, void *pixels, int size)
{ {
@@ -1300,6 +1306,11 @@ @@ -1510,6 +1516,11 @@ static void set_encodings(VncState *vs,
break; break;
case -223: /* DesktopResize */ case -223: /* DesktopResize */
vs->has_resize = 1; vs->has_resize = 1;

View File

@ -1,7 +1,7 @@
Index: xen-3.2-testing/tools/misc/miniterm/miniterm.c Index: xen-3.3.0-testing/tools/misc/miniterm/miniterm.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/misc/miniterm/miniterm.c --- xen-3.3.0-testing.orig/tools/misc/miniterm/miniterm.c
+++ xen-3.2-testing/tools/misc/miniterm/miniterm.c +++ xen-3.3.0-testing/tools/misc/miniterm/miniterm.c
@@ -157,7 +157,7 @@ int main(int argc, char **argv) @@ -157,7 +157,7 @@ int main(int argc, char **argv)
case 0: case 0:
close(1); /* stdout not needed */ close(1); /* stdout not needed */
@ -35,10 +35,10 @@ Index: xen-3.2-testing/tools/misc/miniterm/miniterm.c
break; break;
} }
Index: xen-3.2-testing/xen/tools/symbols.c Index: xen-3.3.0-testing/xen/tools/symbols.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/xen/tools/symbols.c --- xen-3.3.0-testing.orig/xen/tools/symbols.c
+++ xen-3.2-testing/xen/tools/symbols.c +++ xen-3.3.0-testing/xen/tools/symbols.c
@@ -81,7 +81,8 @@ static int read_symbol(FILE *in, struct @@ -81,7 +81,8 @@ static int read_symbol(FILE *in, struct
if (rc != 3) { if (rc != 3) {
if (rc != EOF) { if (rc != EOF) {
@ -49,11 +49,11 @@ Index: xen-3.2-testing/xen/tools/symbols.c
} }
return -1; return -1;
} }
Index: xen-3.2-testing/tools/libxc/xc_dom_elfloader.c Index: xen-3.3.0-testing/tools/libxc/xc_dom_elfloader.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/libxc/xc_dom_elfloader.c --- xen-3.3.0-testing.orig/tools/libxc/xc_dom_elfloader.c
+++ xen-3.2-testing/tools/libxc/xc_dom_elfloader.c +++ xen-3.3.0-testing/tools/libxc/xc_dom_elfloader.c
@@ -195,8 +195,9 @@ static int xc_dom_load_elf_symtab(struct @@ -193,8 +193,9 @@ static int xc_dom_load_elf_symtab(struct
if ( load ) if ( load )
{ {
@ -64,23 +64,23 @@ Index: xen-3.2-testing/tools/libxc/xc_dom_elfloader.c
elf_section_start(elf, shdr2), elf_section_start(elf, shdr2),
size); size);
} }
Index: xen-3.2-testing/tools/xenstore/Makefile Index: xen-3.3.0-testing/tools/xenstore/Makefile
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/xenstore/Makefile --- xen-3.3.0-testing.orig/tools/xenstore/Makefile
+++ xen-3.2-testing/tools/xenstore/Makefile +++ xen-3.3.0-testing/tools/xenstore/Makefile
@@ -6,7 +6,7 @@ MAJOR = 3.0 @@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
MAJOR = 3.0
MINOR = 0 MINOR = 0
PROFILE=#-pg -CFLAGS += -Werror
-BASECFLAGS=-Werror +CFLAGS += -Werror -fno-strict-aliasing
+BASECFLAGS=-Werror -fno-strict-aliasing CFLAGS += -I.
# Make gcc generate dependencies. CFLAGS += $(CFLAGS_libxenctrl)
BASECFLAGS += -Wp,-MD,.$(@F).d
PROG_DEP = .*.d Index: xen-3.3.0-testing/tools/xenstore/xenstored_core.c
Index: xen-3.2-testing/tools/xenstore/xenstored_core.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/xenstore/xenstored_core.c --- xen-3.3.0-testing.orig/tools/xenstore/xenstored_core.c
+++ xen-3.2-testing/tools/xenstore/xenstored_core.c +++ xen-3.3.0-testing/tools/xenstore/xenstored_core.c
@@ -77,8 +77,8 @@ static void check_store(void); @@ -77,8 +77,8 @@ static void check_store(void);
int quota_nb_entry_per_domain = 1000; int quota_nb_entry_per_domain = 1000;
@ -92,7 +92,7 @@ Index: xen-3.2-testing/tools/xenstore/xenstored_core.c
TDB_CONTEXT *tdb_context(struct connection *conn) TDB_CONTEXT *tdb_context(struct connection *conn)
{ {
@@ -1789,10 +1789,10 @@ int main(int argc, char *argv[]) @@ -1803,10 +1803,10 @@ int main(int argc, char *argv[])
remove_local = false; remove_local = false;
break; break;
case 'S': case 'S':
@ -105,10 +105,10 @@ Index: xen-3.2-testing/tools/xenstore/xenstored_core.c
break; break;
case 'T': case 'T':
tracefile = optarg; tracefile = optarg;
Index: xen-3.2-testing/tools/xenstore/xenstored_domain.c Index: xen-3.3.0-testing/tools/xenstore/xenstored_domain.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/xenstore/xenstored_domain.c --- xen-3.3.0-testing.orig/tools/xenstore/xenstored_domain.c
+++ xen-3.2-testing/tools/xenstore/xenstored_domain.c +++ xen-3.3.0-testing/tools/xenstore/xenstored_domain.c
@@ -212,7 +212,7 @@ void handle_event(void) @@ -212,7 +212,7 @@ void handle_event(void)
{ {
evtchn_port_t port; evtchn_port_t port;
@ -118,7 +118,7 @@ Index: xen-3.2-testing/tools/xenstore/xenstored_domain.c
barf_perror("Failed to read from event fd"); barf_perror("Failed to read from event fd");
if (port == virq_port) if (port == virq_port)
@@ -516,7 +516,7 @@ static int dom0_init(void) @@ -561,7 +561,7 @@ static int dom0_init(void)
struct domain *dom0; struct domain *dom0;
port = xenbus_evtchn(); port = xenbus_evtchn();
@ -127,10 +127,10 @@ Index: xen-3.2-testing/tools/xenstore/xenstored_domain.c
return -1; return -1;
dom0 = new_domain(NULL, 0, port); dom0 = new_domain(NULL, 0, port);
Index: xen-3.2-testing/tools/xenstore/xenstored_transaction.c Index: xen-3.3.0-testing/tools/xenstore/xenstored_transaction.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/xenstore/xenstored_transaction.c --- xen-3.3.0-testing.orig/tools/xenstore/xenstored_transaction.c
+++ xen-3.2-testing/tools/xenstore/xenstored_transaction.c +++ xen-3.3.0-testing/tools/xenstore/xenstored_transaction.c
@@ -82,7 +82,7 @@ struct transaction @@ -82,7 +82,7 @@ struct transaction
struct list_head changed_domains; struct list_head changed_domains;
}; };
@ -140,11 +140,11 @@ Index: xen-3.2-testing/tools/xenstore/xenstored_transaction.c
static unsigned int generation; static unsigned int generation;
/* Return tdb context to use for this connection. */ /* Return tdb context to use for this connection. */
Index: xen-3.2-testing/tools/xenstore/xenstore_client.c Index: xen-3.3.0-testing/tools/xenstore/xenstore_client.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/xenstore/xenstore_client.c --- xen-3.3.0-testing.orig/tools/xenstore/xenstore_client.c
+++ xen-3.2-testing/tools/xenstore/xenstore_client.c +++ xen-3.3.0-testing/tools/xenstore/xenstore_client.c
@@ -119,7 +119,7 @@ do_chmod(char *path, struct xs_permissio @@ -251,7 +251,7 @@ do_chmod(char *path, struct xs_permissio
char **xsval = xs_directory(xsh, xth, path, &xsval_n); char **xsval = xs_directory(xsh, xth, path, &xsval_n);
if (xsval) { if (xsval) {
@ -153,43 +153,11 @@ Index: xen-3.2-testing/tools/xenstore/xenstore_client.c
for (i = 0; i < xsval_n; i++) { for (i = 0; i < xsval_n; i++) {
snprintf(buf, MAX_PATH_LEN, "%s/%s", path, xsval[i]); snprintf(buf, MAX_PATH_LEN, "%s/%s", path, xsval[i]);
Index: xen-3.2-testing/tools/xenstore/xsls.c Index: xen-3.3.0-testing/tools/libxen/src/xen_common.c
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/xenstore/xsls.c --- xen-3.3.0-testing.orig/tools/libxen/src/xen_common.c
+++ xen-3.2-testing/tools/xenstore/xsls.c +++ xen-3.3.0-testing/tools/libxen/src/xen_common.c
@@ -24,8 +24,7 @@ void print_dir(struct xs_handle *h, char @@ -1055,6 +1055,8 @@ static size_t size_of_member(const abstr
char **e;
char newpath[STRING_MAX], *val;
int newpath_len;
- int i;
- unsigned int num, len;
+ unsigned int i, num, len;
e = xs_directory(h, XBT_NULL, path, &num);
if (e == NULL)
@@ -69,7 +68,7 @@ void print_dir(struct xs_handle *h, char
printf(":\n");
}
else {
- if (max_width < (linewid + len + TAG_LEN)) {
+ if (max_width < (int)(linewid + len + TAG_LEN)) {
printf(" = \"%.*s\\...\"",
(int)(max_width - TAG_LEN - linewid),
sanitise_value(&ebuf, val, len));
@@ -94,7 +93,7 @@ void print_dir(struct xs_handle *h, char
warn("\ncould not access permissions for %s", e[i]);
}
else {
- int i;
+ unsigned int i;
fputs(" (", stdout);
for (i = 0; i < nperms; i++) {
if (i)
Index: xen-3.2-testing/tools/libxen/src/xen_common.c
===================================================================
--- xen-3.2-testing.orig/tools/libxen/src/xen_common.c
+++ xen-3.2-testing/tools/libxen/src/xen_common.c
@@ -1051,6 +1051,8 @@ static size_t size_of_member(const abstr
default: default:
assert(false); assert(false);
} }
@ -198,7 +166,7 @@ Index: xen-3.2-testing/tools/libxen/src/xen_common.c
} }
@@ -1550,6 +1552,8 @@ get_val_as_string(const struct abstract_ @@ -1566,6 +1568,8 @@ get_val_as_string(const struct abstract_
default: default:
assert(false); assert(false);
} }
@ -207,3 +175,25 @@ Index: xen-3.2-testing/tools/libxen/src/xen_common.c
} }
Index: xen-3.3.0-testing/tools/ioemu/hw/pass-through.c
===================================================================
--- xen-3.3.0-testing.orig/tools/ioemu/hw/pass-through.c
+++ xen-3.3.0-testing/tools/ioemu/hw/pass-through.c
@@ -1389,7 +1389,7 @@ static int pt_register_regions(struct pt
return 0;
}
-static int pt_unregister_regions(struct pt_dev *assigned_device)
+static void pt_unregister_regions(struct pt_dev *assigned_device)
{
int i, type, ret;
uint32_t e_size;
@@ -1434,7 +1434,7 @@ static int pt_unregister_regions(struct
}
}
-
+
}
uint8_t find_cap_offset(struct pci_dev *pci_dev, uint8_t cap)

View File

@ -1,11 +1,11 @@
From: Charles Coffing <ccoffing@novell.com> From: Charles Coffing <ccoffing@novell.com>
Upstream: no Upstream: no
Index: xen-3.2.1-testing/tools/python/xen/xm/main.py Index: xen-3.3.0-testing/tools/python/xen/xm/main.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xm/main.py --- xen-3.3.0-testing.orig/tools/python/xen/xm/main.py
+++ xen-3.2.1-testing/tools/python/xen/xm/main.py +++ xen-3.3.0-testing/tools/python/xen/xm/main.py
@@ -1830,6 +1830,10 @@ def xm_debug_keys(args): @@ -1871,6 +1871,10 @@ def xm_debug_keys(args):
def xm_top(args): def xm_top(args):
arg_check(args, "top", 0) arg_check(args, "top", 0)

View File

@ -1,8 +1,8 @@
Index: xen-unstable/tools/examples/Makefile Index: xen-3.3.0-testing/tools/examples/Makefile
=================================================================== ===================================================================
--- xen-unstable.orig/tools/examples/Makefile --- xen-3.3.0-testing.orig/tools/examples/Makefile
+++ xen-unstable/tools/examples/Makefile +++ xen-3.3.0-testing/tools/examples/Makefile
@@ -15,7 +15,7 @@ XEN_CONFIGS += xm-config-xenapi.xml @@ -13,7 +13,7 @@ XEN_CONFIGS += xm-config.xml
XEN_CONFIGS += xmexample1 XEN_CONFIGS += xmexample1
XEN_CONFIGS += xmexample2 XEN_CONFIGS += xmexample2
XEN_CONFIGS += xmexample.hvm XEN_CONFIGS += xmexample.hvm

View File

@ -1,9 +1,9 @@
Change various example paths in the config files to match SUSE. Change various example paths in the config files to match SUSE.
Index: xen-3.2-testing/tools/examples/xmexample1 Index: xen-3.3.0-testing/tools/examples/xmexample1
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/examples/xmexample1 --- xen-3.3.0-testing.orig/tools/examples/xmexample1
+++ xen-3.2-testing/tools/examples/xmexample1 +++ xen-3.3.0-testing/tools/examples/xmexample1
@@ -7,11 +7,13 @@ @@ -7,11 +7,13 @@
#============================================================================ #============================================================================
@ -23,7 +23,7 @@ Index: xen-3.2-testing/tools/examples/xmexample1
# The domain build function. Default is 'linux'. # The domain build function. Default is 'linux'.
#builder='linux' #builder='linux'
@@ -130,7 +132,7 @@ disk = [ 'phy:hda1,hda1,w' ] @@ -131,7 +133,7 @@ disk = [ 'phy:hda1,hda1,w' ]
#hostname= "vm%d" % vmid #hostname= "vm%d" % vmid
# Set root device. # Set root device.
@ -32,7 +32,7 @@ Index: xen-3.2-testing/tools/examples/xmexample1
# Root device for nfs. # Root device for nfs.
#root = "/dev/nfs" #root = "/dev/nfs"
@@ -139,8 +141,8 @@ root = "/dev/hda1 ro" @@ -140,8 +142,8 @@ root = "/dev/hda1 ro"
# Root directory on the nfs server. # Root directory on the nfs server.
#nfs_root = '/full/path/to/root/directory' #nfs_root = '/full/path/to/root/directory'
@ -43,10 +43,10 @@ Index: xen-3.2-testing/tools/examples/xmexample1
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Configure the behaviour when a domain exits. There are three 'reasons' # Configure the behaviour when a domain exits. There are three 'reasons'
Index: xen-3.2-testing/tools/examples/xmexample2 Index: xen-3.3.0-testing/tools/examples/xmexample2
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/examples/xmexample2 --- xen-3.3.0-testing.orig/tools/examples/xmexample2
+++ xen-3.2-testing/tools/examples/xmexample2 +++ xen-3.3.0-testing/tools/examples/xmexample2
@@ -35,11 +35,13 @@ xm_vars.var('vmid', @@ -35,11 +35,13 @@ xm_vars.var('vmid',
xm_vars.check() xm_vars.check()
@ -66,7 +66,7 @@ Index: xen-3.2-testing/tools/examples/xmexample2
# The domain build function. Default is 'linux'. # The domain build function. Default is 'linux'.
#builder='linux' #builder='linux'
@@ -166,7 +168,7 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid), @@ -167,7 +169,7 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid),
#hostname= "vm%d" % vmid #hostname= "vm%d" % vmid
# Set root device. # Set root device.
@ -75,7 +75,7 @@ Index: xen-3.2-testing/tools/examples/xmexample2
# Root device for nfs. # Root device for nfs.
#root = "/dev/nfs" #root = "/dev/nfs"
@@ -175,8 +177,8 @@ root = "/dev/sda1 ro" @@ -176,8 +178,8 @@ root = "/dev/sda1 ro"
# Root directory on the nfs server. # Root directory on the nfs server.
#nfs_root = '/full/path/to/root/directory' #nfs_root = '/full/path/to/root/directory'
@ -86,10 +86,10 @@ Index: xen-3.2-testing/tools/examples/xmexample2
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Configure the behaviour when a domain exits. There are three 'reasons' # Configure the behaviour when a domain exits. There are three 'reasons'
Index: xen-3.2-testing/tools/examples/xmexample3 Index: xen-3.3.0-testing/tools/examples/xmexample3
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/examples/xmexample3 --- xen-3.3.0-testing.orig/tools/examples/xmexample3
+++ xen-3.2-testing/tools/examples/xmexample3 +++ xen-3.3.0-testing/tools/examples/xmexample3
@@ -35,11 +35,13 @@ xm_vars.var('vmid', @@ -35,11 +35,13 @@ xm_vars.var('vmid',
xm_vars.check() xm_vars.check()
@ -109,11 +109,11 @@ Index: xen-3.2-testing/tools/examples/xmexample3
# The domain build function. Default is 'linux'. # The domain build function. Default is 'linux'.
#builder='linux' #builder='linux'
Index: xen-3.2-testing/tools/examples/xmexample.hvm Index: xen-3.3.0-testing/tools/examples/xmexample.hvm
=================================================================== ===================================================================
--- xen-3.2-testing.orig/tools/examples/xmexample.hvm --- xen-3.3.0-testing.orig/tools/examples/xmexample.hvm
+++ xen-3.2-testing/tools/examples/xmexample.hvm +++ xen-3.3.0-testing/tools/examples/xmexample.hvm
@@ -72,7 +72,7 @@ vif = [ 'type=ioemu, bridge=xenbr0' ] @@ -73,7 +73,7 @@ vif = [ 'type=ioemu, bridge=xenbr0' ]
# and MODE is r for read-only, w for read-write. # and MODE is r for read-only, w for read-write.
#disk = [ 'phy:hda1,hda1,r' ] #disk = [ 'phy:hda1,hda1,r' ]
@ -122,10 +122,10 @@ Index: xen-3.2-testing/tools/examples/xmexample.hvm
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Configure the behaviour when a domain exits. There are three 'reasons' # Configure the behaviour when a domain exits. There are three 'reasons'
Index: xen-3.2-testing/docs/man/xmdomain.cfg.pod.5 Index: xen-3.3.0-testing/docs/man/xmdomain.cfg.pod.5
=================================================================== ===================================================================
--- xen-3.2-testing.orig/docs/man/xmdomain.cfg.pod.5 --- xen-3.3.0-testing.orig/docs/man/xmdomain.cfg.pod.5
+++ xen-3.2-testing/docs/man/xmdomain.cfg.pod.5 +++ xen-3.3.0-testing/docs/man/xmdomain.cfg.pod.5
@@ -38,13 +38,13 @@ file. @@ -38,13 +38,13 @@ file.
The kernel image for the domain. The format of the parameter is the The kernel image for the domain. The format of the parameter is the
@ -161,10 +161,10 @@ Index: xen-3.2-testing/docs/man/xmdomain.cfg.pod.5
at hda1, which is the root filesystem. at hda1, which is the root filesystem.
=item I<NFS Root> =item I<NFS Root>
Index: xen-3.2-testing/docs/man/xm.pod.1 Index: xen-3.3.0-testing/docs/man/xm.pod.1
=================================================================== ===================================================================
--- xen-3.2-testing.orig/docs/man/xm.pod.1 --- xen-3.3.0-testing.orig/docs/man/xm.pod.1
+++ xen-3.2-testing/docs/man/xm.pod.1 +++ xen-3.3.0-testing/docs/man/xm.pod.1
@@ -106,8 +106,8 @@ soon as it is run. @@ -106,8 +106,8 @@ soon as it is run.
=item I<without config file> =item I<without config file>
@ -173,6 +173,6 @@ Index: xen-3.2-testing/docs/man/xm.pod.1
- kernel=/boot/vmlinuz-2.6.12.6-xenU \ - kernel=/boot/vmlinuz-2.6.12.6-xenU \
+ xm create /dev/null ramdisk=initrd-xen \ + xm create /dev/null ramdisk=initrd-xen \
+ kernel=/boot/vmlinuz-xen \ + kernel=/boot/vmlinuz-xen \
name=ramdisk nics=0 vcpus=1 \ name=ramdisk vif='' vcpus=1 \
memory=64 root=/dev/ram0 memory=64 root=/dev/ram0

View File

@ -1,8 +1,51 @@
-------------------------------------------------------------------
Tue Jul 8 16:39:42 MDT 2008 - carnold@novell.com
- Updated to xen-unstable changeset 17990.
-------------------------------------------------------------------
Tue Jul 8 15:09:51 MDT 2008 - kwolf@suse.de
- ioemu: Write barriers for blktap devices
ioemu-blktap-barriers.patch
-------------------------------------------------------------------
Thu Jul 3 13:28:35 MDT 2008 - kwolf@suse.de
- blktapctrl defaults to using ioemu instead of tapdisk now
blktapctrl-default-to-ioemu.patch
- Now that ioemu is default, it can be called with image paths
starting e.g. with tap:qcow2. If the image format is specified,
it has to be respected and no guessing on the image file must
happen.
ioemu-blktap-image-format.patch
- qcow2: Read/Write multiple sectors at once if possible to
improve performance.
ioemu-qcow2-multiblock-aio.patch
-------------------------------------------------------------------
Thu Jun 12 14:12:05 MDT 2008 - kwolf@novell.com
- Add snapshot support to ioemu and blktapctrl
snapshot-ioemu-save.patch
snapshot-ioemu-restore.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jun 6 08:56:56 MDT 2008 - jfehlig@novell.com Fri Jun 6 08:56:56 MDT 2008 - jfehlig@novell.com
- bnc#397890 - Create and own /var/lib/xen/dump - bnc#397890 - Create and own /var/lib/xen/dump
-------------------------------------------------------------------
Thu Jun 5 11:02:32 MDT 2008 - kwolf@novell.com
- Fix tapdisk for qcow2 images > 2 GB
1xxxx-qcow2-2gb-bug.patch
-------------------------------------------------------------------
Thu Jun 5 10:34:29 MDT 2008 - jfehlig@novell.com
- Updated to xen-unstable changeset 17772.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue May 27 13:29:22 MDT 2008 - plc@novell.com Tue May 27 13:29:22 MDT 2008 - plc@novell.com

237
xen.spec
View File

@ -1,5 +1,5 @@
# #
# spec file for package xen (Version 3.2.1_16881_04) # spec file for package xen (Version 3.3.0_17990_01)
# #
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine # This file and all modifications and additions to the pristine
@ -12,16 +12,16 @@
Name: xen Name: xen
%define xvers 3.2 %define xvers 3.3
%define xvermaj 3 %define xvermaj 3
%define changeset 16881 %define changeset 17990
%define xen_build_dir xen-3.2.1-testing %define xen_build_dir xen-3.3.0-testing
%if %sles_version %if %sles_version
%define with_kmp 1 %define with_kmp 1
%else %else
%define with_kmp 0 %define with_kmp 0
%endif %endif
BuildRequires: LibVNCServer-devel SDL-devel autoconf automake bin86 curl-devel dev86 graphviz latex2html libjpeg-devel libxml2-devel ncurses-devel openssl openssl-devel pciutils-devel python-devel transfig BuildRequires: LibVNCServer-devel SDL-devel automake bin86 curl-devel dev86 graphviz latex2html libjpeg-devel libxml2-devel ncurses-devel openssl openssl-devel pciutils-devel python-devel transfig
%if %suse_version >= 1030 %if %suse_version >= 1030
BuildRequires: texlive texlive-latex BuildRequires: texlive texlive-latex
%else %else
@ -33,14 +33,14 @@ BuildRequires: glibc-32bit glibc-devel-32bit
%if %{?with_kmp}0 %if %{?with_kmp}0
BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11 BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11
%endif %endif
Version: 3.2.1_16881_04 Version: 3.3.0_17990_01
Release: 5 Release: 1
License: GPL v2 only License: GPL v2 only
Group: System/Kernel Group: System/Kernel
AutoReqProv: on AutoReqProv: on
PreReq: %insserv_prereq %fillup_prereq PreReq: %insserv_prereq %fillup_prereq
Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel) Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel)
Source0: xen-3.2.1-testing-src.tar.bz2 Source0: xen-3.3.0-testing-src.tar.bz2
Source2: README.SuSE Source2: README.SuSE
Source3: boot.xen Source3: boot.xen
Source4: boot.local.xenU Source4: boot.local.xenU
@ -60,41 +60,6 @@ Source18: init.xen_loop
Source23: etc_pam.d_xen-api Source23: etc_pam.d_xen-api
Source24: xenapiusers Source24: xenapiusers
# Upstream patches # Upstream patches
Patch0: 16716-xend-version.patch
Patch1: 16718-batched-mmu-updates.patch
Patch2: 16740-suse-ifup.patch
Patch3: 16769-pci-high-memory-resource.patch
Patch4: 16873-net-nat.patch
Patch5: 16877-blktap.patch
Patch6: 16883-xend-crashed-state.patch
Patch7: 16884-xend-rename-restart.patch
Patch8: 16885-xend-config-comments.patch
Patch9: 16886-xenstore-leak.patch
Patch10: 16890-xenapi-version.patch
Patch11: 16931-hvm-hap-param.patch
Patch12: 16933-hvm-hap-fix.patch
Patch13: 16939-hvm-hap-fix.patch
Patch14: 16947-fvmachine-xenstore.patch
Patch15: 16977-xend-restart-count.patch
Patch16: 16989-xend-coredump.patch
Patch17: 17006-make-aio-optional.patch
Patch18: 17017-hpet-configuration.patch
Patch19: 17124-numa-free-memory-size.patch
Patch20: 17131-numa-set-vcpu-affinity.patch
Patch21: 17190-remove-hap-boot-param.patch
Patch22: 17191-remove-hap-boot-param-doc.patch
Patch23: 17209-xentop.patch
Patch24: 17210-xenapi-defaults.patch
Patch25: 17211-xenapi-defaults.patch
Patch26: 17212-xenapi-defaults.patch
Patch27: 17233-hap-check.patch
Patch28: 17246-numa-node-selection-fix.patch
Patch29: 17248-hvm-ignore-USB-RMRR.patch
Patch30: 17315-windows-bug-check-0x101-fix.patch
Patch31: 17500-hvm-load-diags.patch
Patch32: 17505-shadow-l1e-table-fix.patch
Patch33: 17526-variable-delay-timestamps-fix.patch
Patch34: 17532-xenstored-abort-fix.patch
# Our patches # Our patches
Patch100: xen-config.diff Patch100: xen-config.diff
Patch101: xend-config.diff Patch101: xend-config.diff
@ -136,20 +101,21 @@ Patch151: bridge-vlan.diff
Patch152: bridge-bonding.diff Patch152: bridge-bonding.diff
Patch153: bridge-hostonly.diff Patch153: bridge-hostonly.diff
Patch154: bridge-record-creation.patch Patch154: bridge-record-creation.patch
Patch155: xen-fbback-resize.patch Patch155: xend-core-dump-loc.diff
Patch156: xend-core-dump-loc.diff Patch156: blktap.patch
Patch157: blktap.patch Patch157: xen-api-auth.patch
Patch158: xen-api-auth.patch Patch158: pv_32_16_color_trans.patch
Patch159: pv_32_16_color_trans.patch Patch159: xen-qemu-iscsi-fix.patch
Patch160: xen-qemu-iscsi-fix.patch Patch160: keymap-vm.patch
Patch161: keymap-vm.patch Patch161: xen-vnc-resize.patch
Patch162: keymap_nl-be.patch # Patches for snapshot support
Patch163: key-shift-escape.patch Patch170: snapshot-ioemu-save.patch
Patch164: key-altgr.patch Patch171: snapshot-ioemu-restore.patch
Patch165: xen-shift-key.patch Patch172: snapshot-xend.patch
Patch166: xen-pvfb-security.patch Patch173: ioemu-qcow2-multiblock-aio.patch
Patch167: xen-vnc-resize.patch Patch174: ioemu-blktap-image-format.patch
Patch168: xen-qcow-aio_init.patch Patch175: blktapctrl-default-to-ioemu.patch
Patch176: ioemu-blktap-barriers.patch
# Maybe later # Maybe later
Patch200: hvm-ide-flush-o_direct.patch Patch200: hvm-ide-flush-o_direct.patch
# Patches from Jan # Patches from Jan
@ -173,17 +139,8 @@ Patch352: pvdrv_emulation_control.patch
Patch400: ns_tools.patch Patch400: ns_tools.patch
Patch401: ns_xen_base.patch Patch401: ns_xen_base.patch
Patch402: ns_xen_extension.patch Patch402: ns_xen_extension.patch
# Intel EPT / VPID patches # Temporary patch - remove as soon as kernel is updated
Patch500: ept-novell-x64.patch Patch900: tmp-revert-blktapctrl.patch
Patch501: vpid-novell-x64.patch
Patch502: livemig-ept-novell-x64.patch
Patch503: ept-2m-x64.patch
Patch504: ept-novell-i386.patch
Patch505: vpid-novell-i386.patch
Patch506: livemig-ept-novell-i386.patch
Patch507: ept-livemgr-x86-miss.patch
Patch508: vtd-fix.patch
Patch509: ept-supported-fix.patch
Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/ Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define pysite %(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()") %define pysite %(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()")
@ -514,41 +471,6 @@ Authors:
%prep %prep
%setup -q -n %xen_build_dir %setup -q -n %xen_build_dir
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch100 -p1 %patch100 -p1
%patch101 -p1 %patch101 -p1
%patch102 -p1 %patch102 -p1
@ -572,10 +494,10 @@ Authors:
%patch124 -p1 %patch124 -p1
%patch125 -p1 %patch125 -p1
%patch126 -p1 %patch126 -p1
%patch127 -p1 #%patch127 -p1 Not needed anymore?
%patch130 -p1 #%patch130 -p1 xen/include/public/foreign/ directory no longer exists
%patch131 -p1 #%patch131 -p1
%patch132 -p1 #%patch132 -p1
%patch133 -p1 %patch133 -p1
%patch134 -p1 %patch134 -p1
%patch135 -p1 %patch135 -p1
@ -596,45 +518,36 @@ Authors:
%patch159 -p1 %patch159 -p1
%patch160 -p1 %patch160 -p1
%patch161 -p1 %patch161 -p1
%patch162 -p1 %patch170 -p1
%patch163 -p1 %patch171 -p1
%patch164 -p1 %patch172 -p1
%patch165 -p1 %patch173 -p1
%patch166 -p1 %patch174 -p1
%patch167 -p1 %patch175 -p1
%patch168 -p1 %patch176 -p1
#%patch200 -p1 #%patch200 -p1
%patch240 -p1 #%patch240 -p1 Upstream?
%patch241 -p1 #%patch241 -p1 Upstream?
%patch242 -p1 #%patch242 -p1 Upstream?
%patch243 -p1 #%patch243 -p1 Upstream?
%patch244 -p1 #%patch244 -p1 Upstream?
%patch245 -p1 #%patch245 -p1 Upstream?
%patch246 -p1 #%patch246 -p1 if upstream, has since been modified
%patch247 -p1 #%patch247 -p1 ??
%patch248 -p1 #%patch248 -p1 Upstream?
%patch249 -p1 %patch249 -p1
%patch250 -p1 #%patch250 -p1 Upstream?
%patch251 -p1 #%patch251 -p1 Upstream?
%patch350 -p1 %patch350 -p1
%patch351 -p1 %patch351 -p1
%patch352 -p1 %patch352 -p1
%ifarch x86_64 # Don't use shim for now
%patch400 -p1 #%ifarch x86_64
%patch401 -p1 #%patch400 -p1
%patch402 -p1 #%patch401 -p1
%patch500 -p1 #%patch402 -p1
%patch501 -p1 #%endif
%patch502 -p1 %patch900 -p1
%patch503 -p1
%else
%patch504 -p1
%patch505 -p1
%patch506 -p1
%patch507 -p1
%endif
%patch508 -p1
%patch509 -p1
%build %build
XEN_EXTRAVERSION=%version-%release XEN_EXTRAVERSION=%version-%release
@ -644,7 +557,7 @@ sed -i "s/XEN_CHANGESET[\t ]*=.*\$/XEN_CHANGESET = %{changeset}/" xen/Makefi
RPM_OPT_FLAGS=${RPM_OPT_FLAGS//-fstack-protector/} RPM_OPT_FLAGS=${RPM_OPT_FLAGS//-fstack-protector/}
export CFLAGS="${RPM_OPT_FLAGS}" export CFLAGS="${RPM_OPT_FLAGS}"
export RPM_OPT_FLAGS export RPM_OPT_FLAGS
make -C xen/include/public/foreign make -C tools/include/xen-foreign
make tools docs make tools docs
%if %{?with_kmp}0 %if %{?with_kmp}0
# pv driver modules # pv driver modules
@ -698,7 +611,8 @@ make -C xen clean
%endif %endif
export CFLAGS="$RPM_OPT_FLAGS" export CFLAGS="$RPM_OPT_FLAGS"
export RPM_OPT_FLAGS export RPM_OPT_FLAGS
make -C xen/include/public/foreign #make -C xen/include/public/foreign
make -C tools/include/xen-foreign
# tools # tools
export XEN_PYTHON_NATIVE_INSTALL=1 export XEN_PYTHON_NATIVE_INSTALL=1
make -C tools install \ make -C tools install \
@ -801,11 +715,12 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
%files tools %files tools
%defattr(-,root,root) %defattr(-,root,root)
/usr/bin/lomount #/usr/bin/lomount
/usr/bin/xencons /usr/bin/xencons
/usr/bin/xenperf /usr/bin/xenperf
/usr/bin/xenstore* /usr/bin/xenstore*
/usr/bin/xentrace* /usr/bin/xentrace*
/usr/bin/pygrub
/usr/sbin/blktapctrl /usr/sbin/blktapctrl
/usr/sbin/flask-loadpolicy /usr/sbin/flask-loadpolicy
/usr/sbin/img2qcow /usr/sbin/img2qcow
@ -814,6 +729,7 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
/usr/sbin/rcxend /usr/sbin/rcxend
/usr/sbin/rcxendomains /usr/sbin/rcxendomains
/usr/sbin/tapdisk /usr/sbin/tapdisk
/usr/sbin/tapdisk-ioemu
/usr/sbin/xen* /usr/sbin/xen*
/usr/sbin/xm /usr/sbin/xm
/usr/sbin/xsview /usr/sbin/xsview
@ -830,6 +746,7 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
%{_libdir}/xen/bin/xc_save %{_libdir}/xen/bin/xc_save
%{_libdir}/xen/bin/xenconsole %{_libdir}/xen/bin/xenconsole
%{_libdir}/xen/bin/xenctx %{_libdir}/xen/bin/xenctx
%{_libdir}/xen/bin/lsevtchn
%{_mandir}/man1/*.1.gz %{_mandir}/man1/*.1.gz
%{_mandir}/man5/*.5.gz %{_mandir}/man5/*.5.gz
%{_mandir}/man8/*.8.gz %{_mandir}/man8/*.8.gz
@ -871,6 +788,7 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
%{_defaultdocdir}/xen/boot.xen %{_defaultdocdir}/xen/boot.xen
%{_defaultdocdir}/xen/misc %{_defaultdocdir}/xen/misc
%dir %pysite/xen %dir %pysite/xen
%dir %pysite/grub
# formerly tools-ioemu # formerly tools-ioemu
%dir %{_datadir}/xen %dir %{_datadir}/xen
%dir %{_datadir}/xen/qemu %dir %{_datadir}/xen/qemu
@ -879,13 +797,15 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
%{_libdir}/xen/bin/qemu-dm %{_libdir}/xen/bin/qemu-dm
%ifarch x86_64 %ifarch x86_64
/usr/lib/xen/bin/qemu-dm /usr/lib/xen/bin/qemu-dm
/usr/lib64/xen/bin/xc_kexec #/usr/lib64/xen/bin/xc_kexec
%else %else
/usr/lib/xen/bin/xc_kexec #/usr/lib/xen/bin/xc_kexec
%endif %endif
/usr/lib/xen/boot/hvmloader /usr/lib/xen/boot/hvmloader
%pysite/xen/* %pysite/xen/*
/usr/lib/xen/boot/domUloader.py /usr/lib/xen/boot/domUloader.py
%pysite/grub/*
%pysite/fsimage.so
%files tools-domU %files tools-domU
%defattr(-,root,root) %defattr(-,root,root)
@ -940,8 +860,33 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
/sbin/ldconfig /sbin/ldconfig
%changelog %changelog
* Tue Jul 08 2008 carnold@novell.com
- Updated to xen-unstable changeset 17990.
* Tue Jul 08 2008 kwolf@suse.de
- ioemu: Write barriers for blktap devices
ioemu-blktap-barriers.patch
* Thu Jul 03 2008 kwolf@suse.de
- blktapctrl defaults to using ioemu instead of tapdisk now
blktapctrl-default-to-ioemu.patch
- Now that ioemu is default, it can be called with image paths
starting e.g. with tap:qcow2. If the image format is specified,
it has to be respected and no guessing on the image file must
happen.
ioemu-blktap-image-format.patch
- qcow2: Read/Write multiple sectors at once if possible to
improve performance.
ioemu-qcow2-multiblock-aio.patch
* Thu Jun 12 2008 kwolf@novell.com
- Add snapshot support to ioemu and blktapctrl
snapshot-ioemu-save.patch
snapshot-ioemu-restore.patch
* Fri Jun 06 2008 jfehlig@novell.com * Fri Jun 06 2008 jfehlig@novell.com
- bnc#397890 - Create and own /var/lib/xen/dump - bnc#397890 - Create and own /var/lib/xen/dump
* Thu Jun 05 2008 kwolf@novell.com
- Fix tapdisk for qcow2 images > 2 GB
1xxxx-qcow2-2gb-bug.patch
* Thu Jun 05 2008 jfehlig@novell.com
- Updated to xen-unstable changeset 17772.
* Tue May 27 2008 plc@novell.com * Tue May 27 2008 plc@novell.com
- bnc#381368 - boot qcow image fix. - bnc#381368 - boot qcow image fix.
* Fri May 23 2008 jfehlig@novell.com * Fri May 23 2008 jfehlig@novell.com

View File

@ -1,8 +1,8 @@
Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py Index: xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py --- xen-3.3.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py
+++ xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py +++ xen-3.3.0-testing/tools/python/xen/xend/XendDomainInfo.py
@@ -2780,6 +2780,14 @@ class XendDomainInfo: @@ -3216,6 +3216,14 @@ class XendDomainInfo:
if not config.has_key('backend'): if not config.has_key('backend'):
config['backend'] = "00000000-0000-0000-0000-000000000000" config['backend'] = "00000000-0000-0000-0000-000000000000"

View File

@ -1,7 +1,7 @@
Index: xen-3.2.1-testing/tools/examples/init.d/sysconfig.xendomains Index: xen-3.3.0-testing/tools/examples/init.d/sysconfig.xendomains
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/examples/init.d/sysconfig.xendomains --- xen-3.3.0-testing.orig/tools/examples/init.d/sysconfig.xendomains
+++ xen-3.2.1-testing/tools/examples/init.d/sysconfig.xendomains +++ xen-3.3.0-testing/tools/examples/init.d/sysconfig.xendomains
@@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
-## Path: System/xen -## Path: System/xen
+## Path: System/Virtualization +## Path: System/Virtualization
@ -27,20 +27,11 @@ Index: xen-3.2.1-testing/tools/examples/init.d/sysconfig.xendomains
## Type: integer ## Type: integer
## Default: 300 ## Default: 300
Index: xen-3.2.1-testing/tools/examples/xend-config.sxp Index: xen-3.3.0-testing/tools/examples/xend-config.sxp
=================================================================== ===================================================================
--- xen-3.2.1-testing.orig/tools/examples/xend-config.sxp --- xen-3.3.0-testing.orig/tools/examples/xend-config.sxp
+++ xen-3.2.1-testing/tools/examples/xend-config.sxp +++ xen-3.3.0-testing/tools/examples/xend-config.sxp
@@ -49,16 +49,19 @@ @@ -54,12 +54,14 @@
#
# (9367 pam '' /etc/xen/xen-api.key /etc/xen/xen-api.crt)
#
-# Default:
-# (xen-api-server ((unix)))
+
+# Until the CIMOM supports authentication, do not require authentication on
+# the unix socket. The socket is restricted to root via file permissions.
+(xen-api-server ((unix none)))
#(xend-http-server no) #(xend-http-server no)
@ -48,19 +39,22 @@ Index: xen-3.2.1-testing/tools/examples/xend-config.sxp
+(xend-unix-server yes) +(xend-unix-server yes)
#(xend-tcp-xmlrpc-server no) #(xend-tcp-xmlrpc-server no)
#(xend-unix-xmlrpc-server yes) #(xend-unix-xmlrpc-server yes)
+# Only enable xend-relocation-server on trusted networks. Currently +# Only enable xend-relocation-server on trusted networks as it lacks
+# lacks encryption and authentication. +# encryption and authentication.
#(xend-relocation-server no) #(xend-relocation-server no)
-(xend-relocation-server yes) -(xend-relocation-server yes)
-#(xend-relocation-ssl-server no)
+# Enable xend-relocation-ssl-server for encrypted relocations.
+(xend-relocation-ssl-server yes)
#(xend-unix-path /var/lib/xend/xend-socket) #(xend-unix-path /var/lib/xend/xend-socket)
@@ -169,7 +172,7 @@ @@ -181,7 +183,7 @@
# Dom0 will balloon out when needed to free memory for domU. # dom0-min-mem is the lowest permissible memory level (in MB) for dom0.
# dom0-min-mem is the lowest memory level (in MB) dom0 will get down to. # This is a minimum both for auto-ballooning (as enabled by
# If dom0-min-mem=0, dom0 will never balloon out. # enable-dom0-ballooning below) and for xm mem-set when applied to dom0.
-(dom0-min-mem 196) -(dom0-min-mem 196)
+(dom0-min-mem 512) +(dom0-min-mem 512)
# In SMP system, dom0 will use dom0-cpus # of CPUS # Whether to enable auto-ballooning of dom0 to allow domUs to be created.
# If dom0-cpus = 0, dom0 will take all cpus available # If enable-dom0-ballooning = no, dom0 will never balloon out.

Some files were not shown because too many files have changed in this diff Show More