OBS User unknown 2008-04-12 19:41:18 +00:00 committed by Git OBS Bridge
parent 614a20ee4e
commit 750b94deb2
51 changed files with 1192 additions and 3248 deletions

48
16740-suse-ifup.patch Normal file
View File

@ -0,0 +1,48 @@
# 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()
{

View File

@ -6,10 +6,10 @@
network-nat: Fix NAT scripts.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Index: xen-3.2-testing/tools/examples/network-nat
Index: xen-3.2.1-testing/tools/examples/network-nat
===================================================================
--- xen-3.2-testing.orig/tools/examples/network-nat
+++ xen-3.2-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
@ -33,10 +33,10 @@ Index: xen-3.2-testing/tools/examples/network-nat
if [ "$dhcp" != 'no' ]
then
Index: xen-3.2-testing/tools/examples/vif-nat
Index: xen-3.2.1-testing/tools/examples/vif-nat
===================================================================
--- xen-3.2-testing.orig/tools/examples/vif-nat
+++ xen-3.2-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"
@ -111,11 +111,11 @@ Index: xen-3.2-testing/tools/examples/vif-nat
release_lock "vif-nat-dhcp"
"$dhcpd_init_file" restart || true
}
Index: xen-3.2-testing/tools/examples/xen-network-common.sh
Index: xen-3.2.1-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
@@ -89,6 +89,11 @@ find_dhcpd_init_file()
--- 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}
}

View File

@ -197,7 +197,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
return self.getDeviceController(deviceClass).sxprs()
else:
sxprs = []
@@ -2258,6 +2258,9 @@ class XendDomainInfo:
@@ -2257,6 +2257,9 @@ class XendDomainInfo:
return XEN_API_VM_POWER_STATE_SUSPENDED
else:
return XEN_API_VM_POWER_STATE_HALTED

View File

@ -205,7 +205,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
action_conf = {
'poweroff': 'actions_after_shutdown',
@@ -2559,9 +2567,10 @@ class XendDomainInfo:
@@ -2558,9 +2566,10 @@ class XendDomainInfo:
def get_on_crash(self):
after_crash = self.info.get('actions_after_crash')

View File

@ -0,0 +1,64 @@
# 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,

View File

@ -10,7 +10,7 @@ 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,6 +1754,39 @@ class XendDomainInfo:
@@ -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'])

21
17209-xentop.patch Normal file
View File

@ -0,0 +1,21 @@
# 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

@ -0,0 +1,84 @@
# 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

@ -0,0 +1,69 @@
# 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

@ -0,0 +1,302 @@
# 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

@ -2,7 +2,7 @@ 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
@@ -1837,7 +1837,7 @@ class XendDomainInfo:
@@ -1844,7 +1844,7 @@ class XendDomainInfo:
xc.domain_setmaxmem(self.domid, maxmem)
# Make sure there's enough RAM available for the domain

View File

@ -5,7 +5,7 @@ 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
@@ -2143,7 +2143,7 @@ class XendDomainInfo:
@@ -2150,7 +2150,7 @@ class XendDomainInfo:
(fn, BOOTLOADER_LOOPBACK_DEVICE))
vbd = {
@ -45,7 +45,7 @@ Index: xen-3.2.1-testing/tools/ioemu/xenstore.c
/* read the name of the device */
if (pasprintf(&buf, "%s/dev", bpath) == -1)
continue;
@@ -252,6 +260,7 @@ void xenstore_parse_domain_config(int do
@@ -262,6 +270,7 @@ void xenstore_parse_domain_config(int do
free(type);
free(params);
free(dev);

View File

@ -1,64 +1,47 @@
Index: xen-3.1-testing/tools/examples/network-bridge
Index: xen-3.2-testing/tools/examples/network-bridge
===================================================================
--- xen-3.1-testing.orig/tools/examples/network-bridge
+++ xen-3.1-testing/tools/examples/network-bridge
@@ -160,6 +160,21 @@ antispoofing () {
iptables -A FORWARD -m physdev --physdev-in ${vif0} -j ACCEPT
}
+# Find the netdev that is associated with the bridge by matching MAC addresses.
+find_bridged_netdev () {
+ local bridge=$1
+
+ bmac=`ip link show ${bridge} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'`
+ for i in `ls /sys/class/net/${bridge}/brif` ; do
+ mac=`ip link show ${i} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'`
+ if [ "${bmac}" = "${mac}" ] && [ ! "${bridge}" = "${i}" ] ; then
+ netdev=${i}
+ return 0
+ fi
+ done
+ return 1
+}
+
# Usage: show_status dev bridge
# Print ifconfig and routes.
show_status () {
@@ -201,9 +216,10 @@ using netloop.nloopbacks=<N> on the doma
create_bridge ${bridge}
- if link_exists "$vdev"; then
+ preiftransfer ${netdev}
+ . /etc/sysconfig/network/ifcfg-${netdev}
+ if [ ! "$BONDING_MASTER" = yes ] && link_exists "$vdev"; then
mac=`ip link show ${netdev} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'`
- preiftransfer ${netdev}
transfer_addrs ${netdev} ${vdev}
if ! ifdown ${netdev}; then
# If ifdown fails, remember the IP details.
@@ -222,6 +238,13 @@ using netloop.nloopbacks=<N> on the doma
add_to_bridge ${bridge} ${vif0}
add_to_bridge2 ${bridge} ${pdev}
do_ifup ${netdev}
+ elif [ "$BONDING_MASTER" = yes ]; then
+ ip link set ${bridge} arp on
+ add_to_bridge ${bridge} ${vif0}
+ ip link set ${vif0} up
+ add_to_bridge2 ${bridge} ${netdev}
+ transfer_addrs ${netdev} ${bridge}
+ transfer_routes ${netdev} ${bridge}
else
ip link set ${bridge} arp on
ip link set ${bridge} multicast on
@@ -266,6 +289,10 @@ op_stop () {
ip link set ${pdev} name ${netdev}
do_ifup ${netdev}
else
+ if [ ${netdev} = ${bridge} ]; then
+ find_bridged_netdev ${bridge}
+ fi
+ ip link set dev ${vif0} down
transfer_routes ${bridge} ${netdev}
ip link set ${bridge} down
--- xen-3.2-testing.orig/tools/examples/network-bridge
+++ xen-3.2-testing/tools/examples/network-bridge
@@ -230,6 +230,9 @@ op_start () {
return
fi
+ local bonded=""
+ [ -e /sys/class/net/${netdev}/bonding ] && bonded="yes"
+
vlans=$(find_active_vlans "${netdev}")
for vlan in $vlans ; do ifdown $vlan ; done
@@ -243,13 +246,27 @@ op_start () {
ip link set ${netdev} down
ip addr flush ${netdev}
fi
- ip link set ${netdev} name ${pdev}
- ip link set ${tdev} name ${bridge}
- setup_bridge_port ${pdev}
+ if [ "x${bonded}" = "xyes" ]
+ then
+ ip link set ${tdev} name ${bridge}
+ ln -sf /etc/sysconfig/network/ifcfg-${netdev} /etc/sysconfig/network/ifcfg-${pdev}
+ ifup ${pdev}
+ local gw=`ip route show dev ${pdev} | fgrep default | sed 's/default via //'`
+ ip addr flush ${pdev}
+ rm -f /etc/sysconfig/network/ifcfg-${pdev}
+ brctl addif ${bridge} ${pdev}
+ ip link set ${bridge} up
+ [ -n "$gw" ] && ip route add default via ${gw}
+ else
+ ip link set ${netdev} name ${pdev}
+ ip link set ${tdev} name ${bridge}
+
+ setup_bridge_port ${pdev}
- add_to_bridge2 ${bridge} ${pdev}
- do_ifup ${bridge}
+ add_to_bridge2 ${bridge} ${pdev}
+ do_ifup ${bridge}
+ fi
for vlan in $vlans ; do ifup $vlan ; done

View File

@ -22,12 +22,12 @@ Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
tools/examples/network-bridge | 37 +++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
Index: xen-3.1-testing/tools/examples/network-bridge
Index: xen-3.2.1-testing/tools/examples/network-bridge
===================================================================
--- xen-3.1-testing.orig/tools/examples/network-bridge
+++ xen-3.1-testing/tools/examples/network-bridge
@@ -299,6 +299,31 @@ op_stop () {
brctl delbr ${bridge}
--- xen-3.2.1-testing.orig/tools/examples/network-bridge
+++ xen-3.2.1-testing/tools/examples/network-bridge
@@ -305,6 +305,31 @@ op_stop () {
for vlan in $vlans ; do ifup $vlan ; done
}
+op_start_hostonly () {
@ -58,7 +58,7 @@ Index: xen-3.1-testing/tools/examples/network-bridge
# adds $dev to $bridge but waits for $dev to be in running state first
add_to_bridge2() {
local bridge=$1
@@ -323,11 +348,19 @@ add_to_bridge2() {
@@ -330,11 +355,19 @@ add_to_bridge2() {
case "$command" in
start)

View File

@ -0,0 +1,39 @@
diff -ru a/tools/examples/xen-network-common.sh b/tools/examples/xen-network-common.sh
--- a/tools/examples/xen-network-common.sh 2008-04-10 15:24:08.000000000 -0600
+++ b/tools/examples/xen-network-common.sh 2008-04-10 15:37:33.000000000 -0600
@@ -27,26 +27,18 @@
# that the virtual device will take once the physical device has
# been renamed.
-if ! which ifup >/dev/null 2>/dev/null
-then
- preiftransfer()
- {
+preiftransfer()
+{
true
- }
- ifup()
- {
+}
+ifup()
+{
false
- }
- ifdown()
- {
+}
+ifdown()
+{
false
- }
-else
- preiftransfer()
- {
- true
- }
-fi
+}
first_file()

View File

@ -0,0 +1,29 @@
diff -ru a/tools/examples/network-bridge b/tools/examples/network-bridge
--- a/tools/examples/network-bridge 2008-04-02 12:33:07.000000000 -0600
+++ b/tools/examples/network-bridge 2008-04-02 15:04:59.000000000 -0600
@@ -238,6 +238,11 @@
create_bridge ${tdev}
+ # Record creation of bridge in /dev/shm/sysconfig/xenbridges so other
+ # tools, e.g. yast2 lan, know that Xen bridging is active.
+ [ -d /dev/shm/sysconfig/xenbridges ] || mkdir /dev/shm/sysconfig/xenbridges
+ touch /dev/shm/sysconfig/xenbridges/${bridge}
+
preiftransfer ${netdev}
transfer_addrs ${netdev} ${tdev}
if ! ifdown ${netdev}; then
@@ -302,6 +307,13 @@
brctl delbr ${tdev}
+ # Remove record of bridge from /dev/shm/sysconfig/xenbridges ...
+ rm -f /dev/shm/sysconfig/xenbridges/${bridge}
+ # ... and directory itself if empty
+ if [ -z "$(ls -A /dev/shm/sysconfig/xenbridges 2>/dev/null)" ]; then
+ rmdir /dev/shm/sysconfig/xenbridges
+ fi
+
for vlan in $vlans ; do ifup $vlan ; done
}

View File

@ -1,71 +0,0 @@
Index: xen-3.1-testing/tools/examples/xen-network-common.sh
===================================================================
--- xen-3.1-testing.orig/tools/examples/xen-network-common.sh
+++ xen-3.1-testing/tools/examples/xen-network-common.sh
@@ -16,53 +16,21 @@
#
-# 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.
+preiftransfer()
+{
+ # Ensure the interface has an IP to transfer
+ /sbin/ifrenew $1 -o rc || true
+}
-##
-# preiftransfer
-#
-# @param $1 The current name for the physical device, which is also the name
-# 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
-then
- preiftransfer()
- {
- true
- }
- ifup()
- {
- false
- }
- ifdown()
- {
- false
- }
-else
- preiftransfer()
- {
- true
- }
-fi
+ifup()
+{
+ /sbin/ifup $1 -o rc || true
+}
+ifdown()
+{
+ /sbin/ifdown $1 -o rc
+}
first_file()
{

View File

@ -1,9 +1,9 @@
Index: xen-3.1-testing/tools/examples/network-bridge
Index: xen-3.2-testing/tools/examples/network-bridge
===================================================================
--- xen-3.1-testing.orig/tools/examples/network-bridge
+++ xen-3.1-testing/tools/examples/network-bridge
@@ -160,6 +160,24 @@ antispoofing () {
iptables -A FORWARD -m physdev --physdev-in ${vif0} -j ACCEPT
--- xen-3.2-testing.orig/tools/examples/network-bridge
+++ xen-3.2-testing/tools/examples/network-bridge
@@ -180,6 +180,28 @@ antispoofing () {
iptables -A FORWARD -m physdev --physdev-in ${pdev} -j ACCEPT
}
+find_active_vlans() {
@ -17,47 +17,55 @@ Index: xen-3.1-testing/tools/examples/network-bridge
+ continue
+ fi
+ . $vifcfg
+ if [ "$ETHERDEVICE" = "$netdev" ] && link_exists "$vlan" ; then
+ vlans="$vlans $vlan"
+ etherdevice="$ETHERDEVICE"
+ if [ -x /sbin/getcfg-interface ]; then
+ etherdevice=$(/sbin/getcfg-interface "$ETHERDEVICE")
+ fi
+ if [ "$ETHERDEVICE" = "$netdev" ] || [ "$etherdevice" = "$netdev" ] ; then
+ link_exists "$vlan" && vlans="$vlans $vlan"
+ fi
+ done
+ echo "$vlans"
+}
+
# Find the netdev that is associated with the bridge by matching MAC addresses.
find_bridged_netdev () {
local bridge=$1
@@ -221,6 +239,8 @@ using netloop.nloopbacks=<N> on the doma
if [ ! "$BONDING_MASTER" = yes ] && link_exists "$vdev"; then
mac=`ip link show ${netdev} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'`
transfer_addrs ${netdev} ${vdev}
+ vlans=$(find_active_vlans "${netdev}")
+ for vlan in $vlans ; do ifdown $vlan ; done
if ! ifdown ${netdev}; then
# If ifdown fails, remember the IP details.
get_ip_info ${netdev}
@@ -238,6 +258,7 @@ using netloop.nloopbacks=<N> on the doma
add_to_bridge ${bridge} ${vif0}
add_to_bridge2 ${bridge} ${pdev}
do_ifup ${netdev}
+ for vlan in $vlans ; do ifup $vlan ; done
elif [ "$BONDING_MASTER" = yes ]; then
ip link set ${bridge} arp on
add_to_bridge ${bridge} ${vif0}
@@ -272,6 +293,8 @@ op_stop () {
ip link set dev ${vif0} down
mac=`ip link show ${netdev} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'`
transfer_addrs ${netdev} ${pdev}
+ vlans=$(find_active_vlans "${netdev}")
+ for vlan in $vlans ; do ifdown $vlan ; done
if ! ifdown ${netdev}; then
get_ip_info ${netdev}
fi
@@ -288,6 +311,7 @@ op_stop () {
ip link set ${netdev} name ${vdev}
ip link set ${pdev} name ${netdev}
do_ifup ${netdev}
+ for vlan in $vlans ; do ifup $vlan ; done
else
if [ ${netdev} = ${bridge} ]; then
find_bridged_netdev ${bridge}
# Usage: show_status dev bridge
# Print ifconfig and routes.
show_status () {
@@ -208,6 +230,9 @@ op_start () {
return
fi
+ vlans=$(find_active_vlans "${netdev}")
+ for vlan in $vlans ; do ifdown $vlan ; done
+
create_bridge ${tdev}
preiftransfer ${netdev}
@@ -226,6 +251,8 @@ op_start () {
add_to_bridge2 ${bridge} ${pdev}
do_ifup ${bridge}
+ for vlan in $vlans ; do ifup $vlan ; done
+
if [ ${antispoof} = 'yes' ] ; then
antispoofing
fi
@@ -239,6 +266,9 @@ op_stop () {
return
fi
+ vlans=$(find_active_vlans "${netdev}")
+ for vlan in $vlans ; do ifdown $vlan ; done
+
transfer_addrs ${bridge} ${pdev}
if ! ifdown ${bridge}; then
get_ip_info ${bridge}
@@ -254,6 +284,8 @@ op_stop () {
do_ifup ${netdev}
brctl delbr ${tdev}
+
+ for vlan in $vlans ; do ifup $vlan ; done
}
# adds $dev to $bridge but waits for $dev to be in running state first

View File

@ -396,21 +396,24 @@ 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
@@ -217,6 +217,13 @@ void xenstore_parse_domain_config(int do
bdrv_set_type_hint(bs, BDRV_TYPE_CDROM);
if (pasprintf(&buf, "%s/params", bpath) != -1)
xs_watch(xsh, buf, dev);
+ /* if pyhsical put a watch on media-present after creating it */
+ if (drv && !strcmp(drv, "phy")) {
+ if (pasprintf(&buf, "%s/media-present", bpath) != -1) {
+ xs_write(xsh, XBT_NULL, buf, "1", strlen("1"));
+ xs_watch(xsh, buf, "media-present");
+ }
+ }
@@ -232,6 +232,16 @@ void xenstore_parse_domain_config(int do
fprintf(stderr, "qemu: could not open hard disk image '%s'\n",
params);
}
+ /* if pyhsical CDROM put a watch on media-present after creating it */
+ if (type && !strcmp(type, "cdrom") && drv && !strcmp(drv, "phy")) {
+ if (pasprintf(&buf, "%s/media-present", bpath) != -1) {
+ if (bdrv_is_inserted(bs_table[hd_index + (is_scsi ? MAX_DISKS : 0)]))
+ xs_write(xsh, XBT_NULL, buf, "1", strlen("1"));
+ else
+ xs_write(xsh, XBT_NULL, buf, "0", strlen("0"));
+ xs_watch(xsh, buf, "media-present");
+ }
+ }
}
/* open device now if media present */
@@ -418,6 +425,50 @@ void xenstore_record_dm_state(char *stat
/* Set a watch for log-dirty requests from the migration tools */
@@ -425,6 +435,50 @@ void xenstore_record_dm_state(char *stat
free(path);
}
@ -461,7 +464,7 @@ Index: xen-3.2.1-testing/tools/ioemu/xenstore.c
void xenstore_process_event(void *opaque)
{
char **vec, *offset, *bpath = NULL, *buf = NULL, *drv = NULL, *image = NULL;
@@ -437,6 +488,11 @@ void xenstore_process_event(void *opaque
@@ -444,6 +498,11 @@ void xenstore_process_event(void *opaque
goto out;
}
@ -485,7 +488,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c
} IDEState;
#define BM_STATUS_DMAING 0x01
@@ -1405,8 +1406,15 @@ static void ide_atapi_cmd(IDEState *s)
@@ -1446,8 +1447,15 @@ static void ide_atapi_cmd(IDEState *s)
switch(s->io_buffer[0]) {
case GPCMD_TEST_UNIT_READY:
if (bdrv_is_inserted(s->bs)) {

View File

@ -1,7 +1,7 @@
Index: 2008-01-07/xen/arch/ia64/xen/hypercall.c
Index: xen-3.2.1-testing/xen/arch/ia64/xen/hypercall.c
===================================================================
--- 2008-01-07.orig/xen/arch/ia64/xen/hypercall.c 2007-12-05 17:13:57.000000000 +0100
+++ 2008-01-07/xen/arch/ia64/xen/hypercall.c 2008-01-07 12:11:43.000000000 +0100
--- xen-3.2.1-testing.orig/xen/arch/ia64/xen/hypercall.c
+++ xen-3.2.1-testing/xen/arch/ia64/xen/hypercall.c
@@ -34,9 +34,6 @@
#include <xen/perfc.h>
#include <public/arch-ia64/debug_op.h>
@ -21,10 +21,10 @@ Index: 2008-01-07/xen/arch/ia64/xen/hypercall.c
{
long ret;
Index: 2008-01-07/xen/arch/x86/x86_32/traps.c
Index: xen-3.2.1-testing/xen/arch/x86/x86_32/traps.c
===================================================================
--- 2008-01-07.orig/xen/arch/x86/x86_32/traps.c 2007-11-26 16:57:03.000000000 +0100
+++ 2008-01-07/xen/arch/x86/x86_32/traps.c 2008-01-07 12:11:43.000000000 +0100
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_32/traps.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_32/traps.c
@@ -419,7 +419,7 @@ static long unregister_guest_callback(st
}
@ -34,10 +34,10 @@ Index: 2008-01-07/xen/arch/x86/x86_32/traps.c
{
long ret;
Index: 2008-01-07/xen/arch/x86/x86_64/traps.c
Index: xen-3.2.1-testing/xen/arch/x86/x86_64/traps.c
===================================================================
--- 2008-01-07.orig/xen/arch/x86/x86_64/traps.c 2007-11-02 17:25:58.000000000 +0100
+++ 2008-01-07/xen/arch/x86/x86_64/traps.c 2008-01-07 12:11:43.000000000 +0100
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_64/traps.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_64/traps.c
@@ -470,7 +470,7 @@ static long unregister_guest_callback(st
}
@ -47,10 +47,10 @@ Index: 2008-01-07/xen/arch/x86/x86_64/traps.c
{
long ret;
Index: 2008-01-07/xen/include/asm-x86/guest_access.h
Index: xen-3.2.1-testing/xen/include/asm-x86/guest_access.h
===================================================================
--- 2008-01-07.orig/xen/include/asm-x86/guest_access.h 2007-12-07 11:51:50.000000000 +0100
+++ 2008-01-07/xen/include/asm-x86/guest_access.h 2008-01-07 12:11:43.000000000 +0100
--- xen-3.2.1-testing.orig/xen/include/asm-x86/guest_access.h
+++ xen-3.2.1-testing/xen/include/asm-x86/guest_access.h
@@ -34,7 +34,8 @@
*/
#define copy_to_guest_offset(hnd, off, ptr, nr) ({ \
@ -71,11 +71,11 @@ Index: 2008-01-07/xen/include/asm-x86/guest_access.h
((void)((hnd).p == (ptr))); \
is_hvm_vcpu(current) ? \
copy_to_user_hvm(_d+(off), _s, sizeof(*_s)*(nr)) : \
Index: 2008-01-07/xen/include/public/arch-ia64.h
Index: xen-3.2.1-testing/xen/include/public/arch-ia64.h
===================================================================
--- 2008-01-07.orig/xen/include/public/arch-ia64.h 2008-01-07 12:02:52.000000000 +0100
+++ 2008-01-07/xen/include/public/arch-ia64.h 2008-01-07 12:11:43.000000000 +0100
@@ -47,18 +47,7 @@
--- xen-3.2.1-testing.orig/xen/include/public/arch-ia64.h
+++ xen-3.2.1-testing/xen/include/public/arch-ia64.h
@@ -53,18 +53,7 @@
#endif
#ifndef __ASSEMBLY__
@ -94,11 +94,11 @@ Index: 2008-01-07/xen/include/public/arch-ia64.h
#define PRI_xen_pfn "lx"
#endif
Index: 2008-01-07/xen/include/public/arch-powerpc.h
Index: xen-3.2.1-testing/xen/include/public/arch-powerpc.h
===================================================================
--- 2008-01-07.orig/xen/include/public/arch-powerpc.h 2008-01-07 12:02:52.000000000 +0100
+++ 2008-01-07/xen/include/public/arch-powerpc.h 2008-01-07 12:11:43.000000000 +0100
@@ -47,17 +47,7 @@
--- xen-3.2.1-testing.orig/xen/include/public/arch-powerpc.h
+++ xen-3.2.1-testing/xen/include/public/arch-powerpc.h
@@ -49,17 +49,7 @@
#endif
#ifndef __ASSEMBLY__
@ -116,11 +116,11 @@ Index: 2008-01-07/xen/include/public/arch-powerpc.h
#define PRI_xen_pfn "llx"
#endif
Index: 2008-01-07/xen/include/public/arch-x86/xen.h
Index: xen-3.2.1-testing/xen/include/public/arch-x86/xen.h
===================================================================
--- 2008-01-07.orig/xen/include/public/arch-x86/xen.h 2008-01-07 12:02:52.000000000 +0100
+++ 2008-01-07/xen/include/public/arch-x86/xen.h 2008-01-07 12:11:43.000000000 +0100
@@ -53,17 +53,7 @@
--- xen-3.2.1-testing.orig/xen/include/public/arch-x86/xen.h
+++ xen-3.2.1-testing/xen/include/public/arch-x86/xen.h
@@ -55,17 +55,7 @@
#endif
#ifndef __ASSEMBLY__
@ -138,10 +138,10 @@ Index: 2008-01-07/xen/include/public/arch-x86/xen.h
#define PRI_xen_pfn "lx"
#endif
Index: 2008-01-07/xen/include/public/xen.h
Index: xen-3.2.1-testing/xen/include/public/xen.h
===================================================================
--- 2008-01-07.orig/xen/include/public/xen.h 2008-01-07 12:02:52.000000000 +0100
+++ 2008-01-07/xen/include/public/xen.h 2008-01-07 12:11:43.000000000 +0100
--- xen-3.2.1-testing.orig/xen/include/public/xen.h
+++ xen-3.2.1-testing/xen/include/public/xen.h
@@ -39,6 +39,20 @@
#error "Unsupported architecture"
#endif

View File

@ -10,7 +10,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/traps.c
#include <asm/io.h>
#include <asm/atomic.h>
#include <asm/desc.h>
@@ -2880,7 +2881,7 @@ long unregister_guest_nmi_callback(void)
@@ -2884,7 +2885,7 @@ long unregister_guest_nmi_callback(void)
return 0;
}
@ -39,7 +39,7 @@ Index: xen-3.2.1-testing/xen/include/public/arch-x86/xen.h
===================================================================
--- xen-3.2.1-testing.orig/xen/include/public/arch-x86/xen.h
+++ xen-3.2.1-testing/xen/include/public/arch-x86/xen.h
@@ -98,7 +98,6 @@ struct trap_info {
@@ -100,7 +100,6 @@ struct trap_info {
unsigned long address; /* code offset */
};
typedef struct trap_info trap_info_t;

View File

@ -2,22 +2,29 @@ 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,15 +208,39 @@ static int setup_guest(int xc_handle,
@@ -208,10 +208,10 @@ 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. */
- /*
- * 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]);
if ( rc == 0 )
@@ -222,12 +222,32 @@ static int setup_guest(int xc_handle,
if ( count > 2048 )
count = 2048;
rc = xc_domain_memory_populate_physmap(
- xc_handle, dom, nr_pages - 0xc0, 0, 0, &page_array[0xc0]);
+ xc_handle, dom, 0x200 - 0xc0, 0, 0, &page_array[0xc0]);
- xc_handle, dom, count, 0, 0, &page_array[cur_pages]);
+ xc_handle, dom, 0x200 - cur_pages, 0, 0, &page_array[cur_pages]);
cur_pages += count;
}
if ( rc != 0 )
{
- PERROR("Could not allocate memory for HVM guest.\n");

View File

@ -18,7 +18,7 @@ Index: xen-3.2.1-testing/tools/libxc/xc_hvm_build.c
struct elf_binary elf;
uint64_t v_start, v_end;
int rc;
@@ -269,6 +271,18 @@ static int setup_guest(int xc_handle,
@@ -280,6 +282,18 @@ static int setup_guest(int xc_handle,
xc_set_hvm_param(xc_handle, dom, HVM_PARAM_BUFIOREQ_PFN, shared_page_nr-2);
xc_set_hvm_param(xc_handle, dom, HVM_PARAM_IOREQ_PFN, shared_page_nr);
@ -56,7 +56,7 @@ 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
@@ -105,11 +105,23 @@ static void vmx_init_vmcs_config(void)
@@ -107,11 +107,23 @@ static void vmx_init_vmcs_config(void)
if ( _vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
{
@ -84,7 +84,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
}
#if defined(__i386__)
@@ -301,6 +313,8 @@ int vmx_cpu_up(void)
@@ -303,6 +315,8 @@ int vmx_cpu_up(void)
return 0;
}
@ -93,7 +93,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
return 1;
}
@@ -439,6 +453,7 @@ void vmx_disable_intercept_for_msr(struc
@@ -441,6 +455,7 @@ void vmx_disable_intercept_for_msr(struc
static int construct_vmcs(struct vcpu *v)
{
@ -101,7 +101,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
uint16_t sysenter_cs;
unsigned long sysenter_eip;
@@ -448,10 +463,23 @@ static int construct_vmcs(struct vcpu *v
@@ -450,10 +465,23 @@ static int construct_vmcs(struct vcpu *v
__vmwrite(PIN_BASED_VM_EXEC_CONTROL, vmx_pin_based_exec_control);
__vmwrite(VM_EXIT_CONTROLS, vmx_vmexit_control);
__vmwrite(VM_ENTRY_CONTROLS, vmx_vmentry_control);
@ -128,7 +128,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
/* MSR access bitmap. */
if ( cpu_has_vmx_msr_bitmap )
@@ -569,7 +597,10 @@ static int construct_vmcs(struct vcpu *v
@@ -571,7 +599,10 @@ static int construct_vmcs(struct vcpu *v
__vmwrite(VMCS_LINK_POINTER_HIGH, ~0UL);
#endif
@ -140,7 +140,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
v->arch.hvm_vcpu.guest_cr[0] = X86_CR0_PE | X86_CR0_ET;
hvm_update_guest_cr(v, 0);
@@ -584,6 +615,19 @@ static int construct_vmcs(struct vcpu *v
@@ -586,6 +617,19 @@ static int construct_vmcs(struct vcpu *v
__vmwrite(TPR_THRESHOLD, 0);
}
@ -160,7 +160,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
vmx_vmcs_exit(v);
paging_update_paging_modes(v); /* will update HOST & GUEST_CR3 as reqd */
@@ -929,6 +973,8 @@ void vmcs_dump_vcpu(struct vcpu *v)
@@ -931,6 +975,8 @@ void vmcs_dump_vcpu(struct vcpu *v)
(uint32_t)vmr(IDT_VECTORING_ERROR_CODE));
printk("TPR Threshold = 0x%02x\n",
(uint32_t)vmr(TPR_THRESHOLD));
@ -757,16 +757,7 @@ Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmcs.h
#ifdef __x86_64__
struct vmx_msr_state msr_state;
@@ -120,6 +134,8 @@ void vmx_vmcs_exit(struct vcpu *v);
#define CPU_BASED_MWAIT_EXITING 0x00000400
#define CPU_BASED_RDPMC_EXITING 0x00000800
#define CPU_BASED_RDTSC_EXITING 0x00001000
+#define CPU_BASED_CR3_LOAD_EXITING 0x00008000
+#define CPU_BASED_CR3_STORE_EXITING 0x00010000
#define CPU_BASED_CR8_LOAD_EXITING 0x00080000
#define CPU_BASED_CR8_STORE_EXITING 0x00100000
#define CPU_BASED_TPR_SHADOW 0x00200000
@@ -148,6 +164,7 @@ extern u32 vmx_vmexit_control;
@@ -150,6 +164,7 @@ extern u32 vmx_vmexit_control;
extern u32 vmx_vmentry_control;
#define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
@ -774,7 +765,7 @@ Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmcs.h
#define SECONDARY_EXEC_WBINVD_EXITING 0x00000040
extern u32 vmx_secondary_exec_control;
@@ -163,6 +180,10 @@ extern bool_t cpu_has_vmx_ins_outs_instr
@@ -165,6 +180,10 @@ extern bool_t cpu_has_vmx_ins_outs_instr
(vmx_pin_based_exec_control & PIN_BASED_VIRTUAL_NMIS)
#define cpu_has_vmx_msr_bitmap \
(vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_MSR_BITMAP)
@ -785,7 +776,7 @@ Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmcs.h
/* GUEST_INTERRUPTIBILITY_INFO flags. */
#define VMX_INTR_SHADOW_STI 0x00000001
@@ -204,11 +225,23 @@ enum vmcs_field {
@@ -206,11 +225,23 @@ enum vmcs_field {
VIRTUAL_APIC_PAGE_ADDR = 0x00002012,
VIRTUAL_APIC_PAGE_ADDR_HIGH = 0x00002013,
APIC_ACCESS_ADDR = 0x00002014,

View File

@ -18,7 +18,7 @@ Index: xen-3.2.1-testing/tools/libxc/xc_hvm_build.c
struct elf_binary elf;
uint64_t v_start, v_end;
int rc;
@@ -269,6 +271,18 @@ static int setup_guest(int xc_handle,
@@ -280,6 +282,18 @@ static int setup_guest(int xc_handle,
xc_set_hvm_param(xc_handle, dom, HVM_PARAM_BUFIOREQ_PFN, shared_page_nr-2);
xc_set_hvm_param(xc_handle, dom, HVM_PARAM_IOREQ_PFN, shared_page_nr);
@ -56,7 +56,7 @@ 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
@@ -105,11 +105,23 @@ static void vmx_init_vmcs_config(void)
@@ -107,11 +107,23 @@ static void vmx_init_vmcs_config(void)
if ( _vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
{
@ -84,7 +84,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
}
#if defined(__i386__)
@@ -301,6 +313,8 @@ int vmx_cpu_up(void)
@@ -303,6 +315,8 @@ int vmx_cpu_up(void)
return 0;
}
@ -93,7 +93,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
return 1;
}
@@ -439,6 +453,7 @@ void vmx_disable_intercept_for_msr(struc
@@ -441,6 +455,7 @@ void vmx_disable_intercept_for_msr(struc
static int construct_vmcs(struct vcpu *v)
{
@ -101,7 +101,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
uint16_t sysenter_cs;
unsigned long sysenter_eip;
@@ -448,10 +463,23 @@ static int construct_vmcs(struct vcpu *v
@@ -450,10 +465,23 @@ static int construct_vmcs(struct vcpu *v
__vmwrite(PIN_BASED_VM_EXEC_CONTROL, vmx_pin_based_exec_control);
__vmwrite(VM_EXIT_CONTROLS, vmx_vmexit_control);
__vmwrite(VM_ENTRY_CONTROLS, vmx_vmentry_control);
@ -128,7 +128,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
/* MSR access bitmap. */
if ( cpu_has_vmx_msr_bitmap )
@@ -569,7 +597,10 @@ static int construct_vmcs(struct vcpu *v
@@ -571,7 +599,10 @@ static int construct_vmcs(struct vcpu *v
__vmwrite(VMCS_LINK_POINTER_HIGH, ~0UL);
#endif
@ -140,7 +140,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
v->arch.hvm_vcpu.guest_cr[0] = X86_CR0_PE | X86_CR0_ET;
hvm_update_guest_cr(v, 0);
@@ -584,6 +615,19 @@ static int construct_vmcs(struct vcpu *v
@@ -586,6 +617,19 @@ static int construct_vmcs(struct vcpu *v
__vmwrite(TPR_THRESHOLD, 0);
}
@ -160,7 +160,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
vmx_vmcs_exit(v);
paging_update_paging_modes(v); /* will update HOST & GUEST_CR3 as reqd */
@@ -929,6 +973,8 @@ void vmcs_dump_vcpu(struct vcpu *v)
@@ -931,6 +975,8 @@ void vmcs_dump_vcpu(struct vcpu *v)
(uint32_t)vmr(IDT_VECTORING_ERROR_CODE));
printk("TPR Threshold = 0x%02x\n",
(uint32_t)vmr(TPR_THRESHOLD));
@ -757,16 +757,7 @@ Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmcs.h
#ifdef __x86_64__
struct vmx_msr_state msr_state;
@@ -120,6 +134,8 @@ void vmx_vmcs_exit(struct vcpu *v);
#define CPU_BASED_MWAIT_EXITING 0x00000400
#define CPU_BASED_RDPMC_EXITING 0x00000800
#define CPU_BASED_RDTSC_EXITING 0x00001000
+#define CPU_BASED_CR3_LOAD_EXITING 0x00008000
+#define CPU_BASED_CR3_STORE_EXITING 0x00010000
#define CPU_BASED_CR8_LOAD_EXITING 0x00080000
#define CPU_BASED_CR8_STORE_EXITING 0x00100000
#define CPU_BASED_TPR_SHADOW 0x00200000
@@ -148,6 +164,7 @@ extern u32 vmx_vmexit_control;
@@ -150,6 +164,7 @@ extern u32 vmx_vmexit_control;
extern u32 vmx_vmentry_control;
#define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
@ -774,7 +765,7 @@ Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmcs.h
#define SECONDARY_EXEC_WBINVD_EXITING 0x00000040
extern u32 vmx_secondary_exec_control;
@@ -163,6 +180,10 @@ extern bool_t cpu_has_vmx_ins_outs_instr
@@ -165,6 +180,10 @@ extern bool_t cpu_has_vmx_ins_outs_instr
(vmx_pin_based_exec_control & PIN_BASED_VIRTUAL_NMIS)
#define cpu_has_vmx_msr_bitmap \
(vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_MSR_BITMAP)
@ -785,7 +776,7 @@ Index: xen-3.2.1-testing/xen/include/asm-x86/hvm/vmx/vmcs.h
/* GUEST_INTERRUPTIBILITY_INFO flags. */
#define VMX_INTR_SHADOW_STI 0x00000001
@@ -204,11 +225,23 @@ enum vmcs_field {
@@ -206,11 +225,23 @@ enum vmcs_field {
VIRTUAL_APIC_PAGE_ADDR = 0x00002012,
VIRTUAL_APIC_PAGE_ADDR_HIGH = 0x00002013,
APIC_ACCESS_ADDR = 0x00002014,

14
ept-supported-fix.patch Normal file
View File

@ -0,0 +1,14 @@
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

@ -1,47 +0,0 @@
Index: 2008-01-07/unmodified_drivers/linux-2.6/platform-pci/evtchn.c
===================================================================
--- 2008-01-07.orig/unmodified_drivers/linux-2.6/platform-pci/evtchn.c 2007-11-12 08:47:41.000000000 +0100
+++ 2008-01-07/unmodified_drivers/linux-2.6/platform-pci/evtchn.c 2008-01-17 17:53:37.000000000 +0100
@@ -118,8 +118,8 @@ void unmask_evtchn(int port)
ever bind event channels to vcpu 0 in HVM guests. */
if (unlikely(cpu != 0)) {
evtchn_unmask_t op = { .port = port };
- (void)HYPERVISOR_event_channel_op(EVTCHNOP_unmask,
- &op);
+ VOID(HYPERVISOR_event_channel_op(EVTCHNOP_unmask,
+ &op));
put_cpu();
return;
}
@@ -227,7 +227,8 @@ void unbind_from_irqhandler(unsigned int
mask_evtchn(evtchn);
if (irq_evtchn[irq].close) {
struct evtchn_close close = { .port = evtchn };
- HYPERVISOR_event_channel_op(EVTCHNOP_close, &close);
+ if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close))
+ BUG();
}
}
@@ -310,7 +311,7 @@ static irqreturn_t evtchn_interrupt(int
void force_evtchn_callback(void)
{
- (void)HYPERVISOR_xen_version(0, NULL);
+ VOID(HYPERVISOR_xen_version(0, NULL));
}
EXPORT_SYMBOL(force_evtchn_callback);
Index: 2008-01-07/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c
===================================================================
--- 2008-01-07.orig/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c 2007-11-02 17:25:53.000000000 +0100
+++ 2008-01-07/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c 2008-01-17 18:02:17.000000000 +0100
@@ -58,7 +58,7 @@ static int bp_suspend(void)
BUG_ON(!irqs_disabled());
- suspend_cancelled = HYPERVISOR_shutdown(SHUTDOWN_suspend);
+ suspend_cancelled = HYPERVISOR_suspend(0);
if (!suspend_cancelled) {
write_lock(&suspend_lock);

2
init.xen_loop Normal file
View File

@ -0,0 +1,2 @@
# Increase the number of loopback devices available for vm creation
options loop max_loop=64

22
key-shift-escape.patch Normal file
View File

@ -0,0 +1,22 @@
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;
}

29
keymap-vm.patch Normal file
View File

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

View File

@ -1,16 +0,0 @@
Signed-off-by: Robert Plillips <rphillips@xxxxxxxxxxxxxxx>
Signed-off-by: Ben Guthro <bguthro@xxxxxxxxxxxxxxxx>
Index: xen-3.2-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-3.2-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-3.2-testing/xen/arch/x86/hvm/svm/svm.c
@@ -642,7 +642,7 @@ static void svm_set_segment_register(str
break;
case x86_seg_ss:
memcpy(&vmcb->ss, reg, sizeof(*reg));
- vmcb->cpl = vmcb->ss.attr.fields.dpl;
+ vmcb->cpl = vmcb->cs.attr.fields.dpl;
break;
case x86_seg_tr:
memcpy(&vmcb->tr, reg, sizeof(*reg));

File diff suppressed because it is too large Load Diff

View File

@ -1,50 +0,0 @@
#!/bin/sh
#============================================================================
# multinet-include.template
#
# Version = 1.0.0
# Date = 2007-12-31
#
# Description:
#
# Script description goes here.
#
#============================================================================
#### start/stop info ########################################
#
# default-run: post-start pre-stop
#
# pre-start-num:
# post-start-num: 10
# pre-stop-num: 10
# post-stop-num:
#
###############################################################
#### Read config files and set variables ##################################
#. /etc/sysconfig/xend
#. /etc/xen/scripts/multinet-common.sh
#### Script Functions #####################################################
#### Main Code Body #######################################################
case $1 in
pre-start)
;;
post-start)
;;
pre-stop)
;;
post-stop)
;;
esac

View File

@ -1,389 +0,0 @@
#!/bin/sh
#============================================================================
# network-multinet
#
# Version = 3.0.0
# Date = 2008-01-30
#
# Maintainer(s) = Ron Terry - ron (at) pronetworkconsulting (dot) com
#
# The latest version can be found at:
#
# http://pronetworkconsulting.com/linux/scripts/network-multinet.html
#
# Description:
#
# Replacement for the Xen network-bridge, network-nat and network-route
# scripts. This script allows for the creation of multiple networks.
#
# This script can create 6 types of networks:
#
# bridged: -Networks that are connected to a physical network device
# in Dom0 and on which Dom0 can communitcate
# -This is the traditional type of network created in xen by
# the basic network-bridge script.
# -VMs on these network(s) appear to be on the real network(s)
#
# nohost: -Networks that are connected to Dom0 but on which Dom0 cannot
# communitcate
# -These can be used to allow virtual machines to communicate
# with the outside world but not with Dom0.
# (Usefull if you want to isolate traffic away from Dom0)
#
# hostonly: -Networks that are connected to Dom0 but are private from
# the physical network
# -This type of network will allow VMs connected to it to
# access only Dom0 and other VMs connected to the network.
# -This type of network is similiar to a VMware "HOST ONLY"
# network.
#
# nat: -Networks that are connected to Dom0 and are privet from the
# physical network but VMs can get out to the physical network
# -This type of network will allow VMs connected to it to access
# Dom0,the "outside world" via NAT and other VMs connected to it.
# -This type of network is similiar to a VMware "NAT" network.
#
# routed: -Networks that are not directly connected to the physical network
# but whi's traffic is directly routed to other networks
# -This type of network will allow VMs connected to it to access
# Dom0,the "outside world" via routing through Dom0 and other VMs
# connected to it.
#
# empty: -Networks that are not connected to either Dom0 or the physical
# network
# -These can be used to allow VMs in DomUs to communicate only
# with other DomUs and not Dom0.
#
#
# This script accepts the (start|stop|restart|status) parameters.
#
# This script requires that the vif-bridge script be used as the vif
# creation script (as opposed to vif-nat/vif-route).
#
# This script will test for the presence of the physical interfaces
# configured to be connected to bridged networks and only attempt to
# create networks on the ones that are present and up.
#
# Edit the NETWORK_LIST variable to define which networks to create on which
# interfaces. The default is to create a bridged network on the first
# interface active network interface.
#
# To enable this script edit the network-script field in the
# /etc/xen/xend-config.sxp file.
#
# Example: (network-script network-multinet)
#
# Depends on: $SCRIPT_PATH/multinet-common.sh
#
# Config file: /etc/sysconfig/xend
#
# Usage: network-multinet (start|stop|restart|status)
#
# Vars:
#
# --------------------------- In this script ----------------------------
#
# SCRIPT_PATH -Path to the directory containing the xen network
# configuration scripts (typically /etc/xen/scripts)
#
# ------------------------- In the config file --------------------------
# NETWORK_LIST -Space delimited list of network devices to create networks
# on using the following format:
#
# <network type>,<number of network type>,<network device>,<mac address>,<IP address/CIDR NetMask>,<dhcp server status>
#
# Example with 3 virtual devices:
#
# "bridge,0,default,default,dhcp-off nat,0,none,172.23.0.1/16,dhcp-off hostonly,0,none,172.23.0.1/16,dhcp-off"
#
# NAT_EXTERNAL_INTERFACE -Network interface to use as the external interface
# for NATed and Routed networks
#
#============================================================================
#### Read config files and set variables ##################################
# Source the configuration File
. /etc/sysconfig/xend
SCRIPT_PATH="/etc/xen/scripts"
#### Script Functions #####################################################
usage() {
# Gives help about usage parameters
echo "Usage: $0 {start|stop|restart|status}"
exit 1
}
get_option() {
# Determine which option was passed from the command line.
case "$1" in
start|stop|restart|status)
CMD_OPT="$1"
;;
*)
usage
;;
esac
}
. $SCRIPT_PATH/multinet-common.sh
make_config_dirs() {
# Create temporary storage directory if needed.
if ! [ -d "$NETWORK_SAVE_PATH" ]
then
mkdir $NETWORK_SAVE_PATH
fi
}
#***** Network Creation Main Function *************************************
create_networks() {
for NETWORK in $NETWORK_LIST
do
local NET_TYPE=`echo $NETWORK | cut -d "," -f 1`
local NET_NUMBER=`echo $NETWORK | cut -d "," -f 2`
local NET_DEV=`echo $NETWORK | cut -d "," -f 3`
local NET_DEV_IP=`echo $NETWORK | cut -d "," -f 4`
local NET_DHCP_SRV=`echo $NETWORK | cut -d "," -f 5`
case $NET_DHCP_SRV in
dhcp-on)
DHCP_SRV="on"
;;
*)
DHCP_SRV="off"
;;
esac
# Find the name of the network interface for the first bridged network
#---------------------------------------------------------------------
case $NET_DEV in
default)
local NET_DEV=`ip route list | awk '/^default / { print $NF }'`
;;
esac
case $NET_TYPE in
bridge)
# Create the network
#---------------------------------------------------------------------
configure_bridged_networks $CMD_OPT $NET_DEV $NET_NUMBER
;;
nat|route|hostonly)
# Create the network
#---------------------------------------------------------------------
configure_local_networks $CMD_OPT $NET_DEV $NET_TYPE $NET_NUMBER $NET_DEV_IP $NET_DHCP_SRV
;;
nohost)
# Create the network
#---------------------------------------------------------------------
configure_nohost_networks $CMD_OPT $NET_DEV $NET_NUMBER
;;
empty)
# Create the network
#---------------------------------------------------------------------
configure_empty_networks $CMD_OPT $NET_NUMBER
;;
esac
done
}
#***** Pre/Post Start/Stop Functions **************************************
run_prestart_scripts() {
echo ""
echo "============================================================"
echo "Running pre-start scripts"
echo
test -d $PLUGIN_DIR/pre-start || mkdir -p $PLUGIN_DIR/pre-start
if ls $PLUGIN_DIR/pre-start/*.sh > /dev/null 2>&1
then
for SCRIPT in `ls $PLUGIN_DIR/pre-start/*.sh`
do
echo ""
echo " Running $SCRIPT"
echo
$SCRIPT prestart
echo
echo "------------------------------------------------------------"
done
else
echo " No pre-start scripts to run. Continuing ..."
echo
fi
echo "============================================================"
}
run_poststart_scripts() {
echo ""
echo "============================================================"
echo "Running post-start scripts"
echo
test -d $PLUGIN_DIR/post-start || mkdir -p $PLUGIN_DIR/post-start
if ls $PLUGIN_DIR/post-start/*.sh > /dev/null 2>&1
then
for SCRIPT in `ls $PLUGIN_DIR/post-start/*.sh`
do
echo ""
echo " Running $SCRIPT"
echo
$SCRIPT poststart
echo
echo "------------------------------------------------------------"
done
else
echo " No post-start scripts to run. Continuing ..."
echo
fi
echo "============================================================"
}
run_prestop_scripts() {
echo ""
echo "============================================================"
echo "Running pre-stop scripts"
echo
test -d $PLUGIN_DIR/pre-stop || mkdir -p $PLUGIN_DIR/pre-stop
if ls $PLUGIN_DIR/pre-stop/*.sh > /dev/null 2>&1
then
for SCRIPT in `ls $PLUGIN_DIR/pre-stop/*.sh`
do
echo ""
echo " Running $SCRIPT"
echo
$SCRIPT prestop
echo
echo "------------------------------------------------------------"
done
else
echo " No pre-stop scripts to run. Continuing ..."
echo
fi
echo "============================================================"
}
run_poststop_scripts() {
echo ""
echo "============================================================"
echo "Running post-stop scripts"
echo
test -d $PLUGIN_DIR/post-stop || mkdir -p $PLUGIN_DIR/post-stop
if ls $PLUGIN_DIR/post-stop/*.sh > /dev/null 2>&1
then
for SCRIPT in `ls $PLUGIN_DIR/post-stop/*.sh`
do
echo ""
echo " Running $SCRIPT"
echo
$SCRIPT poststop
echo
echo "------------------------------------------------------------"
done
else
echo " No post-stop scripts to run. Continuing ..."
echo
fi
echo "============================================================"
}
#### Start, Stop, Status Functions ########################################
start_xend_network() {
echo ""
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo " Starting the xend network environment"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
# Determine if we are using SuSEfirewall2
use_sf2 start
# Run pre-start scripts
run_prestart_scripts
manage_firewall prestart
# Create the predefined networks
create_networks
# Run post-start scripts
manage_firewall poststart
run_poststart_scripts
}
stop_xend_network() {
echo ""
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo " Stopping the xend network environment"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
# Run pre-stop scripts
run_prestop_scripts
manage_firewall prestop
# Remove the networks
remove_all_networks
# Run post-stop scripts
manage_firewall poststop
run_poststop_scripts
# Clean-up if we are using the SuSEfirewall2
use_sf2 stop
}
show_xend_network_status() {
create_networks
}
#### Main Code Body #######################################################
get_option "$1"
make_config_dirs
touch $NETWORKTAB
case $CMD_OPT in
start)
# Start the Xen network
start_xend_network
# Start the DHCP server if it exists
#do_dhcpd start
;;
stop)
# Stop the DHCP server if it exists
#do_dhcpd stop
# Stop the Xen network
stop_xend_network
;;
restart)
# Stop the DHCP server if it exists
#do_dhcpd stop
# Stop the Xen network
CMD_OPT="stop"
stop_xend_network
# Start the Xen network
CMD_OPT="start"
start_xend_network
# Start the DHCP server if it exists
#do_dhcpd start
;;
status)
show_xend_network_status
#do_dhcpd status
;;
esac
exit 0

View File

@ -45,7 +45,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/image.py
===================================================================
--- xen-3.2.1-testing.orig/tools/python/xen/xend/image.py
+++ xen-3.2.1-testing/tools/python/xen/xend/image.py
@@ -438,6 +438,7 @@ class HVMImageHandler(ImageHandler):
@@ -441,6 +441,7 @@ class HVMImageHandler(ImageHandler):
self.apic = int(vmConfig['platform'].get('apic', 0))
self.acpi = int(vmConfig['platform'].get('acpi', 0))
@ -53,7 +53,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/image.py
self.guest_os_type = vmConfig['platform'].get('guest_os_type')
# Return a list of cmd line args to the device models based on the
@@ -528,6 +529,7 @@ class HVMImageHandler(ImageHandler):
@@ -531,6 +532,7 @@ class HVMImageHandler(ImageHandler):
log.debug("store_evtchn = %d", store_evtchn)
log.debug("memsize = %d", mem_mb)
log.debug("vcpus = %d", self.vm.getVCpuCount())
@ -61,7 +61,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/image.py
log.debug("acpi = %d", self.acpi)
log.debug("apic = %d", self.apic)
@@ -535,6 +537,7 @@ class HVMImageHandler(ImageHandler):
@@ -538,6 +540,7 @@ class HVMImageHandler(ImageHandler):
image = self.kernel,
memsize = mem_mb,
vcpus = self.vm.getVCpuCount(),

View File

@ -332,7 +332,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/x86_64/exits.S
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/hvm/vmx/x86_64/exits.S
+++ xen-3.2.1-testing/xen/arch/x86/hvm/vmx/x86_64/exits.S
@@ -112,6 +112,14 @@ vmx_process_softirqs:
@@ -116,6 +116,14 @@ vmx_process_softirqs:
ALIGN
ENTRY(vmx_asm_do_vmentry)
GET_CURRENT(%rbx)

View File

@ -2,7 +2,7 @@ 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
@@ -583,6 +583,9 @@ int bdrv_write(BlockDriverState *bs, int
@@ -587,6 +587,9 @@ int bdrv_write(BlockDriverState *bs, int
else
return 0;
} else {

View File

@ -1,142 +0,0 @@
#============================================================================
# /etc/sysconfig/xend
#
# Version = 3.0.0
# Date = 2008-01-30
#
# Maintainer(s) = Ron Terry - ron (at) pronetworkconsulting (dot) com
#
# The latest version can be found at:
#
# http://pronetworkconsulting.com/linux/scripts/network-multinet.html
#
# Description:
#
# This configuration file is for use with network-multinet version 3
#
#============================================================================
## Path: System/Virtualization
## Description:
## Type: list()
## Default: ""
## Config:
#
# Space delimited list of network types, physical/virtual network
# devices,mac addresses and IP addresses to create bridges on using
# the following format:
#
# <network type>,<number of network type>,<network device>,<IP address/CIDR NetMask>,<dhcp server status>
#
# Where:
# <network type> = bridge|nat|route|hostonly|nohost|empty
# <number of network type> = The network number (0,1,2,etc.) of that type of
# network (i.e. xennat0, xenbr1, xenhost3, etc.)
# <network device> = The network interface the bridge will be attached
# to (i.e. eth0, etc.)
# For NAT. Routed, or Hostonly networks this should
# be "none" because there is no device. For Bridged or
# Nohost interfaces this should be a physical
# interfaces (eth, bond, vlan, etc.) If set to
# 'default' the interface used for the default
# gateway will be used
# <IP address/CIDR Netmask> = The IP address and Subnet Mask to assign to
# <network device> format= 1.2.3.4/24
# <dhcp server status> = dhcp-on|dhcp-off (DHCP server on/off on that net)
#
# Network Definition Examples:
# bridged "bridge,0,default,default,dhcp-off"
# "bridge,1,eth1,default,dhcp-off"
# nat "nat,0,none,172.22.0.1/16,dhcp-off"
# routed "route,0,none,172.23.0.1/16,dhcp-off"
# hostonly "hostonly,0,none,172.24.0.1/16,dhcp-off"
# nohost "nohost,0,eth1,,"
# empty "empty,0,none,none,"
#
# Example: "bridge,0,eth0,default,dhcp-off nat,0,none,172.22.0.1/16,dhcp-off hostonly,0,none,172.23.0.1/16,dhcp-off empty,0,none,none,"
#
# The above example would create 4 networks the first being a bridged network
# (xenbr0), the second being a NATed network (xennat0), the third being a host
# only network (xenhost0) and the fourth being an empty network (xenempty0)
#
# Used by network-multinet v3.x only
#
NETWORK_LIST="bridge,0,default,default,dhcp-off hostonly,0,none,172.23.0.1/16,dhcp-off"
## Type: string(eth0,eth1,eth2,eth3)
## Default: "eth0"
## Config:
#
# Network interface to use as the external interface for NATed
# and Routed networks.
#
# If set to 'default" it will use the same interface used for the
# default route
#
NAT_EXTERNAL_INTERFACE="default"
## Type: string(128-249)
## Default: "128-249"
## Config:
#
# IP address range for the dhcp server. These should be the
# beginning and ending addresses from the last octet of the
# IP address
#
XEN_DHCP_RANGE="128-249"
## Type: string(10.0.0.1,10.0.0.2)
## Default: "gateway"
## Config:
#
# IP address(es) of DNS servers for the dhcp server to give out.
# If set to "gateway" then the IP address of the gateway will be
# set as the DNS server.
#
# Examples: "10.0.0.1,10.0.0.2"
# "gateway"
#
XEN_DHCP_DNS_SERVERS="gateway"
## Type: boolean
## Default: "false"
## Config:
#
# If set to true the xend-relocation script will enable/disable
# the vm migration feature of xend..
#
ENABLE_RELOCATION="false"
## Type: list()
## Default: "any"
## Config:
#
# Space delimited list of IP addresses/host names of machines
# that xen will accept vm migrations from. If set to 'any'
# xen will accept vm migrations from any host
#
# Example: "10.0.0.1 10.0.0.2" would allow relocation to/from thos IPs
# Example: "any" would allow reloaction to/from any host
#
RELOCATION_NODELIST="any"
## Type: boolean
## Default: "false"
## Config:
#
# If set to true the xend-relocation script will attempt to
# enable/disable vm migration on all relocation nodes listed
# in the RELOCATION_NODELIST variable.
#
# Note: Communication with the nodes is done via ssh so
# pre-distributed ssh keys is recommended.
#
MANAGE_ALL_RELOCATION_NODES="false"
## Type: integer
## Default: "8002"
## Config:
#
# The TCP port used by Xen for VM relocation
#
XEN_RELOCATION_PORT="8002"

View File

@ -12,7 +12,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
/* Dynamic (run-time adjusted) execution control flags. */
u32 vmx_pin_based_exec_control __read_mostly;
u32 vmx_cpu_based_exec_control __read_mostly;
@@ -110,6 +113,8 @@ static void vmx_init_vmcs_config(void)
@@ -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;
@ -21,7 +21,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
_vmx_secondary_exec_control = adjust_vmx_controls(
min2, opt2, MSR_IA32_VMX_PROCBASED_CTLS2);
@@ -315,6 +320,8 @@ int vmx_cpu_up(void)
@@ -317,6 +322,8 @@ int vmx_cpu_up(void)
ept_sync_all();
@ -30,7 +30,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
return 1;
}
@@ -628,6 +635,13 @@ static int construct_vmcs(struct vcpu *v
@@ -630,6 +637,13 @@ static int construct_vmcs(struct vcpu *v
#endif
}
@ -44,7 +44,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
vmx_vmcs_exit(v);
paging_update_paging_modes(v); /* will update HOST & GUEST_CR3 as reqd */
@@ -821,6 +835,7 @@ void vmx_do_resume(struct vcpu *v)
@@ -823,6 +837,7 @@ void vmx_do_resume(struct vcpu *v)
vmx_load_vmcs(v);
hvm_migrate_timers(v);
vmx_set_host_env(v);
@ -52,7 +52,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
}
debug_state = v->domain->debugger_attached;
@@ -975,6 +990,8 @@ void vmcs_dump_vcpu(struct vcpu *v)
@@ -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));

View File

@ -12,7 +12,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
/* Dynamic (run-time adjusted) execution control flags. */
u32 vmx_pin_based_exec_control __read_mostly;
u32 vmx_cpu_based_exec_control __read_mostly;
@@ -110,6 +113,8 @@ static void vmx_init_vmcs_config(void)
@@ -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;
@ -21,7 +21,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
_vmx_secondary_exec_control = adjust_vmx_controls(
min2, opt2, MSR_IA32_VMX_PROCBASED_CTLS2);
@@ -315,6 +320,8 @@ int vmx_cpu_up(void)
@@ -317,6 +322,8 @@ int vmx_cpu_up(void)
ept_sync_all();
@ -30,7 +30,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
return 1;
}
@@ -628,6 +635,13 @@ static int construct_vmcs(struct vcpu *v
@@ -630,6 +637,13 @@ static int construct_vmcs(struct vcpu *v
#endif
}
@ -44,7 +44,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
vmx_vmcs_exit(v);
paging_update_paging_modes(v); /* will update HOST & GUEST_CR3 as reqd */
@@ -821,6 +835,7 @@ void vmx_do_resume(struct vcpu *v)
@@ -823,6 +837,7 @@ void vmx_do_resume(struct vcpu *v)
vmx_load_vmcs(v);
hvm_migrate_timers(v);
vmx_set_host_env(v);
@ -52,7 +52,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/hvm/vmx/vmcs.c
}
debug_state = v->domain->debugger_attached;
@@ -975,6 +990,8 @@ void vmcs_dump_vcpu(struct vcpu *v)
@@ -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));

80
vtd-fix.patch Normal file
View File

@ -0,0 +1,80 @@
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

@ -133,7 +133,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_emulate.c
===================================================================
--- xen-3.2.1-testing.orig/xen/arch/x86/x86_emulate.c
+++ xen-3.2.1-testing/xen/arch/x86/x86_emulate.c
@@ -30,7 +30,10 @@
@@ -31,7 +31,10 @@
#include <xen/types.h>
#include <xen/lib.h>
#include <asm/regs.h>
@ -144,7 +144,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_emulate.c
#endif
#include <asm-x86/x86_emulate.h>
@@ -3320,60 +3323,64 @@ x86_emulate(
@@ -3321,60 +3324,64 @@ x86_emulate(
src.val = x86_seg_gs;
goto pop_seg;
@ -253,7 +253,7 @@ Index: xen-3.2.1-testing/xen/arch/x86/x86_emulate.c
case 0xc8 ... 0xcf: /* bswap */
dst.type = OP_REG;
@@ -3383,7 +3390,7 @@ x86_emulate(
@@ -3384,7 +3391,7 @@ x86_emulate(
{
default: /* case 2: */
/* Undefined behaviour. Writes zero on all tested CPUs. */

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b76bdbe8d7703cef1c7498bbdfc73f8b178ebafb737ddbdf352a76144c8d6e2b
size 5468802
oid sha256:b2ad468418ca46e89646e16047e70312c7d7082997919435ee04afba26970f39
size 5470154

View File

@ -158,7 +158,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
def _waitForDevice_destroy(self, deviceClass, devid, backpath):
return self.getDeviceController(deviceClass).waitForDevice_destroy(
devid, backpath)
@@ -2091,8 +2095,11 @@ class XendDomainInfo:
@@ -2098,8 +2102,11 @@ class XendDomainInfo:
blexec = osdep.pygrub_path
blcfg = None
@ -172,7 +172,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
if not disks:
msg = "Had a bootloader specified, but no disks are bootable"
@@ -2103,13 +2110,10 @@ class XendDomainInfo:
@@ -2110,13 +2117,10 @@ class XendDomainInfo:
devtype = devinfo[0]
disk = devinfo[1]['uname']
@ -189,7 +189,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
log.info("Mounting %s on %s." %
(fn, BOOTLOADER_LOOPBACK_DEVICE))
@@ -2121,7 +2125,9 @@ class XendDomainInfo:
@@ -2128,7 +2132,9 @@ class XendDomainInfo:
from xen.xend import XendDomain
dom0 = XendDomain.instance().privilegedDomain()
@ -200,7 +200,7 @@ Index: xen-3.2.1-testing/tools/python/xen/xend/XendDomainInfo.py
fn = BOOTLOADER_LOOPBACK_DEVICE
try:
@@ -2132,7 +2138,7 @@ class XendDomainInfo:
@@ -2139,7 +2145,7 @@ class XendDomainInfo:
log.info("Unmounting %s from %s." %
(fn, BOOTLOADER_LOOPBACK_DEVICE))

View File

@ -12,7 +12,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c
#if defined(__ia64__)
#include <xen/hvm/ioreq.h>
@@ -2248,6 +2251,27 @@ static void ide_reset(IDEState *s)
@@ -2288,6 +2291,27 @@ static void ide_reset(IDEState *s)
ide_dummy_transfer_stop(s);
}
@ -40,7 +40,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c
struct partition {
uint8_t boot_ind; /* 0x80 - active */
uint8_t head; /* starting head */
@@ -2649,6 +2673,9 @@ void pci_cmd646_ide_init(PCIBus *bus, Bl
@@ -2689,6 +2713,9 @@ void pci_cmd646_ide_init(PCIBus *bus, Bl
sizeof(PCIIDEState),
-1,
NULL, NULL);
@ -50,7 +50,7 @@ Index: xen-3.2.1-testing/tools/ioemu/hw/ide.c
d->type = IDE_TYPE_CMD646;
pci_conf = d->dev.config;
pci_conf[0x00] = 0x95; // CMD646
@@ -2823,6 +2850,9 @@ void pci_piix_ide_init(PCIBus *bus, Bloc
@@ -2863,6 +2890,9 @@ void pci_piix_ide_init(PCIBus *bus, Bloc
NULL, NULL);
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[0x00] = 0x86; // Intel
pci_conf[0x01] = 0x80;
@@ -2869,6 +2899,9 @@ void pci_piix3_ide_init(PCIBus *bus, Blo
@@ -2909,6 +2939,9 @@ void pci_piix3_ide_init(PCIBus *bus, Blo
NULL, NULL);
d->type = IDE_TYPE_PIIX3;
@ -266,7 +266,7 @@ 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
@@ -1499,6 +1499,8 @@ void kqemu_record_dump(void);
@@ -1501,6 +1501,8 @@ void kqemu_record_dump(void);
extern char domain_name[];
void destroy_hvm_domain(void);

View File

@ -1,13 +0,0 @@
Index: xen-3.2-testing/tools/blktap/drivers/block-qcow.c
===================================================================
--- xen-3.2-testing.orig/tools/blktap/drivers/block-qcow.c
+++ xen-3.2-testing/tools/blktap/drivers/block-qcow.c
@@ -1223,7 +1223,7 @@ int qcow_create(const char *filename, ui
int shift, length, adjust, flags = 0, ret = 0;
QCowHeader header;
QCowHeader_ext exthdr;
- char backing_filename[1024], *ptr;
+ char backing_filename[PATH_MAX], *ptr;
uint64_t tmp, size, total_length;
struct stat st;

62
xen-qemu-iscsi-fix.patch Normal file
View File

@ -0,0 +1,62 @@
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
@@ -91,6 +91,7 @@ void xenstore_parse_domain_config(int do
char *fpath = NULL, *bpath = NULL, *btype = NULL,
*dev = NULL, *params = NULL, *type = NULL, *drv = NULL;
int i, is_scsi, is_tap, is_hdN = 0;
+ int j;
unsigned int len, num, hd_index;
BlockDriverState *bs;
@@ -173,12 +174,7 @@ void xenstore_parse_domain_config(int do
continue;
free(type);
type = xs_read(xsh, XBT_NULL, buf, &len);
- if (pasprintf(&buf, "%s/params", bpath) == -1)
- continue;
- free(params);
- params = xs_read(xsh, XBT_NULL, buf, &len);
- if (params == NULL)
- continue;
+
/* read the name of the device */
if (pasprintf(&buf, "%s/type", bpath) == -1)
continue;
@@ -186,6 +182,35 @@ void xenstore_parse_domain_config(int do
drv = xs_read(xsh, XBT_NULL, buf, &len);
if (drv == NULL)
continue;
+
+ free(params);
+ if (!strcmp(drv,"iscsi"))
+ {
+ if (pasprintf(&buf, "%s/node", bpath) == -1)
+ continue;
+
+ /* wait for block-iscsi script to complete and populate the
+ * node entry. try 30 times (30 secs) */
+ for (j = 0; j < 30; j++) {
+ params = xs_read(xsh, XBT_NULL, buf, &len);
+ if (params != NULL)
+ break;
+ sleep(1);
+ }
+ if (params == NULL) {
+ fprintf(stderr, "qemu: iscsi device not found -- timed out \n");
+ continue;
+ }
+ }
+ else
+ {
+ if (pasprintf(&buf, "%s/params", bpath) == -1)
+ continue;
+ params = xs_read(xsh, XBT_NULL, buf, &len);
+ if (params == NULL)
+ continue;
+ }
+
/* Strip off blktap sub-type prefix aio: - QEMU can autodetect this */
if (!strcmp(drv, "tap") && params[0]) {
char *offset = strchr(params, ':');

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Fri Apr 11 08:38:21 MDT 2008 - carnold@novell.com
- Update to Xen 3.2.1 RC5 changeset 16864.
-------------------------------------------------------------------
Thu Apr 10 17:32:15 MDT 2008 - jfehlig@novell.com
- bnc#378595 - Do not use ifup/ifdown in network-bridge for now.
-------------------------------------------------------------------
Mon Mar 24 16:47:56 MDT 2008 - carnold@novell.com

137
xen.spec
View File

@ -1,5 +1,5 @@
#
# spec file for package xen (Version 3.2.1_16820_01)
# spec file for package xen (Version 3.2.1_16864_01)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@ -14,7 +14,7 @@
Name: xen
%define xvers 3.2
%define xvermaj 3
%define changeset 16820
%define changeset 16864
%define xen_build_dir xen-3.2.1-testing
%if %sles_version
%define with_kmp 1
@ -33,7 +33,7 @@ BuildRequires: glibc-32bit glibc-devel-32bit
%if %{?with_kmp}0
BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11
%endif
Version: 3.2.1_16820_01
Version: 3.2.1_16864_01
Release: 1
License: GPL v2 only
Group: System/Kernel
@ -55,40 +55,41 @@ Source12: block-iscsi
Source13: block-npiv
Source16: xmclone.sh
Source17: xend-relocation.sh
# network-multinet sources
Source18: sysconfig.xend
Source19: network-multinet
Source20: multinet-common.sh
Source21: multinet-include.template
Source22: xend-network
Source18: init.xen_loop
# Xen API remote authentication sources
Source23: etc_pam.d_xen-api
Source24: xenapiusers
# Upstream patches
Patch0: 16716-xend-version.patch
Patch1: 16718-batched-mmu-updates.patch
Patch2: 16769-pci-high-memory-resource.patch
Patch3: 16873-net-nat.patch
Patch4: 16877-blktap.patch
Patch5: 16883-xend-crashed-state.patch
Patch6: 16884-xend-rename-restart.patch
Patch7: 16885-xend-config-comments.patch
Patch8: 16886-xenstore-leak.patch
Patch9: 16890-xenapi-version.patch
Patch10: 16931-hvm-hap-param.patch
Patch11: 16933-hvm-hap-fix.patch
Patch12: 16939-hvm-hap-fix.patch
Patch13: 16947-fvmachine-xenstore.patch
Patch14: 16977-xend-restart-count.patch
Patch15: 16989-xend-coredump.patch
Patch16: 17017-hpet-configuration.patch
Patch17: 17124-numa-free-memory-size.patch
Patch18: 17131-numa-set-vcpu-affinity.patch
Patch19: 17190-remove-hap-boot-param.patch
Patch20: 17191-remove-hap-boot-param-doc.patch
Patch21: 17210-xenapi-defaults.patch
Patch22: 17211-xenapi-defaults.patch
Patch23: 17212-xenapi-defaults.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: 17246-numa-node-selection-fix.patch
Patch28: 17248-hvm-ignore-USB-RMRR.patch
Patch29: 17315-windows-bug-check-0x101-fix.patch
# Our patches
Patch100: xen-config.diff
Patch101: xend-config.diff
@ -124,28 +125,29 @@ Patch137: qemu-security-etch1.diff
Patch138: vnc-i18n-keys.diff
Patch139: rpmlint.diff
Patch140: cdrom-removable.patch
Patch150: bridge-suse.diff
Patch151: bridge-bonding.diff
Patch152: bridge-hostonly.diff
Patch153: bridge-vlan.diff
Patch154: keymap_nl-be.patch
Patch155: xen-fbback-resize.patch
Patch156: xend-core-dump-loc.diff
Patch157: blktap.patch
Patch158: xen-qcow-realpath-buffer-overflow.patch
Patch150: bridge-opensuse-11_0-temp.patch
Patch151: bridge-vlan.diff
Patch152: bridge-bonding.diff
Patch153: bridge-hostonly.diff
Patch154: bridge-record-creation.patch
Patch155: keymap_nl-be.patch
Patch156: xen-fbback-resize.patch
Patch157: xend-core-dump-loc.diff
Patch158: blktap.patch
Patch159: xen-api-auth.patch
Patch160: pv_32_16_color_trans.patch
Patch161: hvm-ide-flush-o_direct.patch
Patch162: migration-cpl-init.patch
Patch162: keymap-vm.patch
Patch163: xen-qemu-iscsi-fix.patch
Patch164: key-shift-escape.patch
# Patches from Jan
Patch240: xenctx.patch
Patch241: const-callback-arg.patch
Patch242: const-set-trap-table-arg.patch
Patch243: hypercall-check.patch
Patch244: pv-drv-mkbuildtree.patch
Patch245: x86_emulate.patch
Patch246: x86-extra-trap-info.patch
Patch247: 32on64-extra-mem.patch
Patch243: pv-drv-mkbuildtree.patch
Patch244: x86_emulate.patch
Patch245: x86-extra-trap-info.patch
Patch246: 32on64-extra-mem.patch
# PV Driver Patches
Patch350: pv-driver-build.patch
Patch351: xen-ioemu-hvm-pv-support.diff
@ -163,6 +165,8 @@ 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/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define pysite %(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()")
@ -225,6 +229,7 @@ Authors:
...
%package libs
License: GPL v2 or later
Summary: Xen Virtualization: Libraries
Group: System/Kernel
Requires: xen = %{version}
@ -274,6 +279,7 @@ Authors:
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%package tools
License: GPL v2 or later
Summary: Xen Virtualization: Control tools for domain 0
Group: System/Kernel
Requires: xen-libs = %{version}
@ -331,6 +337,7 @@ Authors:
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%package tools-domU
License: GPL v2 or later
Summary: Xen Virtualization: Control tools for domain U
Group: System/Kernel
Conflicts: xen-tools
@ -351,6 +358,7 @@ Authors:
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%package devel
License: GPL v2 or later
Summary: Xen Virtualization: Headers and libraries for development
Group: System/Kernel
Requires: xen-libs = %{version}
@ -401,6 +409,7 @@ Authors:
%if %{?with_kmp}0
%package KMP
License: GPL v2 or later
Group: System/Kernel
Summary: Xen para-virtual device drivers for fully virtualized guests
@ -448,6 +457,7 @@ Xen, but is not available for release due to license restrictions.
%endif
%package doc-html
License: GPL v2 or later
Summary: Xen Virtualization: HTML documentation
Group: Documentation/HTML
@ -466,6 +476,7 @@ Authors:
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%package doc-pdf
License: GPL v2 or later
Summary: Xen Virtualization: PDF documentation
Group: Documentation/Other
@ -510,6 +521,12 @@ Authors:
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
@ -545,9 +562,9 @@ Authors:
%patch139 -p1
%patch140 -p1
%patch150 -p1
#%patch151 -p1 # dump if all goes well with defaulting to network-multinet
#%patch152 -p1 # dump if all goes well with defaulting to network-multinet
#%patch153 -p1 # dump if all goes well with defaulting to network-multinet
%patch151 -p1
%patch152 -p1
#%patch153 -p1
%patch154 -p1
%patch155 -p1
%patch156 -p1
@ -556,7 +573,9 @@ Authors:
%patch159 -p1
%patch160 -p1
#%patch161 -p1
#%patch162 -p1
%patch162 -p1
%patch163 -p1
%patch164 -p1
%patch240 -p1
%patch241 -p1
%patch242 -p1
@ -564,7 +583,6 @@ Authors:
%patch244 -p1
%patch245 -p1
%patch246 -p1
%patch247 -p1
%patch350 -p1
%patch351 -p1
%patch352 -p1
@ -582,6 +600,8 @@ Authors:
%patch506 -p1
%patch507 -p1
%endif
%patch508 -p1
%patch509 -p1
%build
XEN_EXTRAVERSION=%version-%release
@ -682,21 +702,16 @@ install %SOURCE5 $RPM_BUILD_ROOT/etc/init.d/xend
ln -s /etc/init.d/xend $RPM_BUILD_ROOT/usr/sbin/rcxend
install %SOURCE6 $RPM_BUILD_ROOT/etc/init.d/xendomains
ln -s /etc/init.d/xendomains $RPM_BUILD_ROOT/usr/sbin/rcxendomains
mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
install -m644 %SOURCE18 $RPM_BUILD_ROOT/etc/modprobe.d/xen_loop
# example config
mkdir -p $RPM_BUILD_ROOT/etc/xen/{vm,examples}
mv $RPM_BUILD_ROOT/etc/xen/xmexample* $RPM_BUILD_ROOT/etc/xen/examples
rm $RPM_BUILD_ROOT/etc/xen/examples/*nbd
install -m644 %SOURCE9 %SOURCE10 $RPM_BUILD_ROOT/etc/xen/examples/
install -m644 %SOURCE18 $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.xend
# scripts
rm $RPM_BUILD_ROOT/etc/xen/scripts/block-*nbd
install -m755 %SOURCE11 %SOURCE12 %SOURCE13 %SOURCE16 %SOURCE17 $RPM_BUILD_ROOT/etc/xen/scripts/
# network-multinet scripts
mkdir -p $RPM_BUILD_ROOT/etc/xen/scripts/multinet.d/{post-start,post-stop,pre-start,pre-stop}
install -m644 %SOURCE18 $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.xend
install -m755 %SOURCE19 %SOURCE20 $RPM_BUILD_ROOT/etc/xen/scripts/
install -m644 %SOURCE21 $RPM_BUILD_ROOT/etc/xen/scripts/multinet.d/
install -m755 %SOURCE22 $RPM_BUILD_ROOT/usr/sbin/
# Xen API remote authentication files
install -d $RPM_BUILD_ROOT/etc/pam.d
install -m644 %SOURCE23 $RPM_BUILD_ROOT/etc/pam.d/xen-api
@ -809,6 +824,8 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
%config /etc/xen/*.xml
%config(noreplace) /etc/xen/xenapiusers
%config /etc/pam.d/xen-api
%config /etc/modprobe.d/xen_loop
%dir /etc/modprobe.d
%dir /etc/udev
%dir /etc/udev/rules.d
/etc/udev/rules.d/40-xen.rules
@ -888,6 +905,10 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
/sbin/ldconfig
%changelog
* Fri Apr 11 2008 carnold@novell.com
- Update to Xen 3.2.1 RC5 changeset 16864.
* Thu Apr 10 2008 jfehlig@novell.com
- bnc#378595 - Do not use ifup/ifdown in network-bridge for now.
* Mon Mar 24 2008 carnold@novell.com
- bnc#373194 - The xen module and the kernel for Dom0 don't match.
- Add ncurses-devel build dependency

View File

@ -2,7 +2,7 @@ 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
@@ -2773,6 +2773,14 @@ class XendDomainInfo:
@@ -2780,6 +2780,14 @@ class XendDomainInfo:
if not config.has_key('backend'):
config['backend'] = "00000000-0000-0000-0000-000000000000"

View File

@ -1,7 +1,7 @@
Index: xen-3.2-testing/tools/examples/init.d/sysconfig.xendomains
Index: xen-3.2.1-testing/tools/examples/init.d/sysconfig.xendomains
===================================================================
--- xen-3.2-testing.orig/tools/examples/init.d/sysconfig.xendomains
+++ xen-3.2-testing/tools/examples/init.d/sysconfig.xendomains
--- xen-3.2.1-testing.orig/tools/examples/init.d/sysconfig.xendomains
+++ xen-3.2.1-testing/tools/examples/init.d/sysconfig.xendomains
@@ -1,4 +1,4 @@
-## Path: System/xen
+## Path: System/Virtualization
@ -27,10 +27,10 @@ Index: xen-3.2-testing/tools/examples/init.d/sysconfig.xendomains
## Type: integer
## Default: 300
Index: xen-3.2-testing/tools/examples/xend-config.sxp
Index: xen-3.2.1-testing/tools/examples/xend-config.sxp
===================================================================
--- xen-3.2-testing.orig/tools/examples/xend-config.sxp
+++ xen-3.2-testing/tools/examples/xend-config.sxp
--- xen-3.2.1-testing.orig/tools/examples/xend-config.sxp
+++ xen-3.2.1-testing/tools/examples/xend-config.sxp
@@ -49,16 +49,19 @@
#
# (9367 pam '' /etc/xen/xen-api.key /etc/xen/xen-api.crt)
@ -55,63 +55,7 @@ Index: xen-3.2-testing/tools/examples/xend-config.sxp
#(xend-unix-path /var/lib/xend/xend-socket)
@@ -136,7 +139,54 @@
# two fake interfaces per guest domain. To do things like this, write
# yourself a wrapper script, and call network-bridge from it, as appropriate.
#
-(network-script network-bridge)
+#(network-script network-bridge)
+
+# network-multinet is a replacement for the Xen network-bridge, network-nat
+# and network-route scripts. network-multinet allows for the creation of
+# multiple networks, supporting the following types:
+#
+#
+# This script can create 6 types of networks:
+#
+# bridged: -Networks that are connected to a physical network device
+# in Dom0 and on which Dom0 can communitcate
+# -This is the traditional type of network created in xen by
+# the basic network-bridge script.
+# -VMs on these network(s) appear to be on the real network(s)
+#
+# nohost: -Networks that are connected to Dom0 but on which Dom0 cannot
+# communitcate
+# -These can be used to allow virtual machines to communicate
+# with the outside world but not with Dom0.
+# (Usefull if you want to isolate traffic away from Dom0)
+#
+# hostonly: -Networks that are connected to Dom0 but are private from
+# the physical network
+# -This type of network will allow VMs connected to it to
+# access only Dom0 and other VMs connected to the network.
+# -This type of network is similiar to a VMware "HOST ONLY"
+# network.
+#
+# nat: -Networks that are connected to Dom0 and are private from the
+# physical network but VMs can get out to the physical network
+# -This type of network will allow VMs connected to it to access
+# Dom0, the "outside world" via NAT and other VMs connected to it.
+# -This type of network is similiar to a VMware "NAT" network.
+#
+# routed: -Networks that are not directly connected to the physical network
+# but who's traffic is directly routed to other networks
+# -This type of network will allow VMs connected to it to access
+# Dom0, the "outside world" via routing through Dom0 and other VMs
+# connected to it.
+#
+# empty: -Networks that are not connected to either Dom0 or the physical
+# network
+# -These can be used to allow VMs in DomUs to communicate only
+# with other DomUs and not Dom0.
+#
+# See /etc/xen/scripts/network-multinet for more details.
+#
+(network-script network-multinet)
# The script used to control virtual interfaces. This can be overridden on a
# per-vif basis when creating a domain or a configuring a new vif. The
@@ -169,7 +219,7 @@
@@ -169,7 +172,7 @@
# Dom0 will balloon out when needed to free memory for domU.
# dom0-min-mem is the lowest memory level (in MB) dom0 will get down to.
# If dom0-min-mem=0, dom0 will never balloon out.

View File

@ -1,514 +0,0 @@
#!/bin/bash
#============================================================================
# xend-network
#
# Version = 1.1.1
# Date = 2008-01-10
#
# Maintainer(s) = Ron Terry - ron (at) pronetworkconsulting (dot) com
#
# The latest version can be found at:
#
# http://pronetworkconsulting.com/linux/scripts/network-multinet.html
#
# Description:
#
# This script creates, deletes, and modifies virtual networks on the fly
# without having to restart the Xen network script. The same functions
# are used to create/delete virtual networks in this script as are used
# in the network-multinet network script.
#
# Vars:
#
# SCRIPT_PATH- -Path to the directory that contains the Xen
# network helper scripts
#
# DEFAULT_SNM -Default subnet mask value to use (number of bits)
# if not defined from the command line
#
# MODE -Mode that the xend-network script is running in:
# (add, del, delall, mod, show)
#
# NET_DEV -Network interface name
# NET_DEV_MAC -MAC address to be assigned to the network interface
# NET_DEV_IP -IP address to be assigned to the network interface
# NET_TYPE -Type of netowrk
# (bridge, nat, hostonly, route, nohost, empty)
# NET_NUMBER -Number of the specifed network type
# NET_NAME -Name of the specified network
# (xenbr, xennat, xenhost, xenroute, xennohost, xenempty)
# NAT_EXTERNAL_INTERFACE -Network interface to masquerade all NAT network
# trafic with
# NET_DHCP_SRV -Parameter defining whether or not the DHCP server
# should be enabled on the specified network:
# (dhcp-on, dhcp-off)
#============================================================================
#### Read config files and set variables ##################################
SCRIPT_PATH="/etc/xen/scripts"
DEFAULT_SNM="24"
. $SCRIPT_PATH/multinet-common.sh
#### Script Functions #####################################################
usage() {
echo "Usage: xend-network add|del|mod {options}"
echo
echo " Options: -t <bridge type> :bridged|nat|hostonly|routed|nohost|empty"
echo " -i <dev> :Virtual network interface - vethX"
echo " (for nat, hostonly and routed bridges only)"
echo " -I <Pdev> :Physical network interface - ethX"
echo " (for bridged and nohost bridges only)"
echo " -m <MAC addr> :MAC address"
echo " (for nat, hostonly and routed bridges only)"
echo " -a <IP Address> :IP address"
echo " (for nat, hostonly and routed bridges only)"
echo " -n <bridge #> :Bridge number (optional)"
echo " -N <bridge name> :Bridge name (optional)"
echo " -M <bridge name> :New Bridge name (used with rename option only)"
echo " -e <ext iface> :External network interface"
echo " (optional - for nat and routed networks only)"
echo " -d :Enable DHCP on this network"
echo
echo "Examples:"
echo
echo " bridged network: xend-network add -t bridge -i eth0"
echo " nat network: xend-network add -t nat -i veth0 -m 00:11:22:aa:bb:cc -a 10.0.0.1"
echo " hostonly network: xend-network add -t hostonly -i veth0 -m 00:11:22:aa:bb:cc -a 10.0.0.1"
echo " routed network: xend-network add -t route -i veth0 -m 00:11:22:aa:bb:cc -a 10.0.0.1"
echo " nohost network: xend-network add -t nohost -i eth0"
echo " empty network: xend-network add -t empty"
echo " empty network: xend-network del -N nat1"
}
get_mode() {
if ! [ -z "$1" ] && ! echo "$1" | grep -q "^-"
then
case $1 in
add)
MODE="add"
echo "Running in add mode"
;;
del)
MODE="del"
echo "Running in delete mode"
;;
delall)
MODE="delall"
echo "Running in delete-all mode"
;;
mod)
MODE="mod"
echo "Running in modify mode"
;;
show)
MODE="show"
echo "Running in show mode"
;;
esac
shift
echo "Options: $*"
get_options $*
else
usage
exit 1
fi
}
get_options() {
while getopts "t:i:I:m:a:n:N:M:e:dh" OPTIONS
do
case $OPTIONS in
i)
NET_DEV=$OPTARG
echo "Network Interface = $NET_DEV"
echo "----------------------------"
;;
I)
NET_DEV=$OPTARG
echo "Network Interface = $NET_DEV"
echo "----------------------------"
;;
m)
NET_DEV_MAC=$OPTARG
echo "MAC Address = $NET_DEV_MAC"
echo "----------------------------"
;;
a)
NET_DEV_IP=$OPTARG
echo "IP Address = $NET_DEV_IP"
echo "----------------------------"
;;
t)
NET_TYPE=$OPTARG
echo "Network type = $NET_TYPE"
echo "----------------------------"
;;
n)
NET_NUMBER=$OPTARG
echo "Number of Network Type = $NET_NUMBER"
echo "----------------------------"
;;
N)
NET_NAME=$OPTARG
echo "Network Name = $NET_NAME"
echo "----------------------------"
;;
M)
NEW_NET_NAME=$OPTARG
echo "New Network Name = $NEW_NET_NAME"
echo "----------------------------"
;;
e)
NAT_EXTERNAL_INTERFACE=$OPTARG
echo "NAT External Interface = $NAT_EXTERNAL_INTERFACE"
echo "----------------------------"
;;
d)
NET_DHCP_SRV="dhcp-on"
;;
h)
usage
exit 0
;;
esac
done
if [ -z $NET_DHCP_SRV ]
then
NET_DHCP_SRV="dhcp-off"
fi
}
#***** Address Generating Functions ***************************************
gen_mac_addr() {
local RANDOM=`od -An -N2 -i /dev/random`
local MAC="00:16:3E"
MAC="$MAC:"`printf "%02X\n" $[ ( $RANDOM % 255 ) + 1 ] `
MAC="$MAC:"`printf "%02X\n" $[ ( $RANDOM % 255 ) + 1 ] `
MAC="$MAC:"`printf "%02X\n" $[ ( $RANDOM % 255 ) + 1 ] `
echo $MAC
#NET_DEV_MAC="$MAC"
}
gen_ip_addr(){
local DUP=""
until [ "$DUP" = "N" ]
do
local IP=10.$(( 1+(`od -An -N2 -i /dev/random` )%(254-1+1) )).$(( 1+(`od -An -N2 -i /dev/random` )%(254-1+1) )).$(( 1+(`od -An -N2 -i /dev/random` )%(254-1+1) ))
local NET_ID=`echo $IP|cut -d "." -f 1-3`.0\/$DEFAULT_SNM
if ! ip route show | grep "$NET_ID" && ! ip addr show | grep "$IP"
then
DUP="N"
fi
done
echo "$IP"/$DEFAULT_SNM
#NET_DEV_IP="$IP"\/24
}
#***** Option Finding Functions *******************************************
find_next_net_number() {
# Variables passed in (only one of the following):
# $BRIDGE_NAME $NAT_NAME $HOSTONLY_NAME $ROUTE_NAME $NOHOST_NAME $EMPTY_NAME
local TYPE_NAME="$1"
if [ -z $NET_NUMBER ]
then
local BRIDGE_TYPE_LIST=`ip addr show | grep ".*: $TYPE_NAME" | cut -d ":" -f 2 | cut -d " " -f 2`
for BRIDGE in $BRIDGE_TYPE_LIST
do
NET_NUMBER=${BRIDGE##${BRIDGE%%[0-9]*}}
done
((NET_NUMBER++))
if [ "$NET_NUMBER" -eq "1" ] && ! ip addr show | grep -q ".*: $TYPE_NAME"0
then
#((NET_NUMBER--))
NET_NUMBER="0"
fi
fi
}
find_next_net_device() {
# Variables passed in (only one fo the following):
# $BRIDGE_NAME $NAT_NAME $HOSTONLY_NAME $ROUTE_NAME $NOHOST_NAME
local DEV_NUMBER
local TYPE_NAME="$1"
if [ -z $NET_DEV ]
then
case $NET_TYPE in
bridge|nohost)
DEV_NAME="$DEFAULT_PDEV"
;;
nat|hostonly|route)
DEV_NAME="$DEFAULT_VDEV"
;;
esac
local DEV_LIST=`ip addr show | grep ".*: $DEV_NAME" | cut -d ":" -f 2 | cut -d " " -f 2`
for DEVICE in $DEV_LIST
do
DEV_NUMBER=${DEVICE##${DEVICE%%[0-9]*}}
done
NEXT_DEV_NUMBER="$DEV_NUMBER"
((NEXT_DEV_NUMBER++))
case $NET_TYPE in
bridge|nohost)
if ! ip addr show | grep -q ".*: $DEV_NAME$DEV_NUMBER" && ! ip addr show | grep -q ".*: $TYPE_NAME$DEV_NUMBER"
then
NET_DEV="$DEFAULT_DEV$DEV_NUMBER"
VIF_COUNT="$DEV_NUMBER"
else
NET_DEV="$DEFAULT_DEV$NEXT_DEV_NUMBER"
VIF_COUNT="$NEXT_DEV_NUMBER"
fi
;;
nat|hostonly|route)
if ! ip addr show | grep -q ".*: $TYPE_NAME$DEV_NUMBER"
then
NET_DEV="$DEV_NAME$DEV_NUMBER"
VIF_COUNT="$DEV_NUMBER"
else
NET_DEV="$DEV_NAME$NEXT_DEV_NUMBER"
VIF_COUNT="$NEXT_DEV_NUMBER"
fi
;;
esac
fi
}
find_network_type() {
if echo "$1" | grep -q "$BRIDGE_NAME"
then
NET_TYPE="bridge"
elif echo "$1" | grep -q "$NAT_NAME"
then
NET_TYPE="nat"
elif echo "$1" | grep -q "$HOSTONLY_NAME"
then
NET_TYPE="hostonly"
elif echo "$1" | grep -q "$ROUTE_NAME"
then
NET_TYPE="route"
elif echo "$1" | grep -q "$NOHOST_NAME"
then
NET_TYPE="nohost"
elif echo "$1" | grep -q "$EMPTY_NAME"
then
NET_TYPE="empty"
fi
}
#***** Network Creation/Deletion Functions ********************************
create_network() {
# The variable CMD_OPT must be set to one of the following before calling
# this function: start, stop, status
case $MODE in
add)
case $NET_TYPE in
bridge)
find_next_net_number $BRIDGE_NAME
find_next_net_device $BRIDGE_NAME
echo "Creating network of type: $NET_TYPE"
echo " Named: $BRIDGE_NAME$NET_NUMBER"
echo " On interface: $NET_DEV"
echo " Switchport: vif0.$VIF_COUNT"
# Create the network
#---------------------------------------------------------------------
create_bridged_networks $NET_DEV $NET_NUMBER
;;
nat|hostonly|route)
if [ -z $NET_NUMBER ]
then
case $NET_TYPE in
nat)
find_next_net_number $NAT_NAME
find_next_net_device $NAT_NAME
;;
hostonly)
find_next_net_number $HOSTONLY_NAME
find_next_net_device $HOSTONLY_NAME
;;
route)
find_next_net_number $ROUTE_NAME
find_next_net_device $ROUTE_NAME
;;
esac
fi
if [ -z $NET_DEV_MAC ]
then
echo "No MAC address was not supplied. Generating MAC"
NET_DEV_MAC="`gen_mac_addr`"
fi
if [ -z $NET_DEV_IP ]
then
echo "The IP address was not supplied. Generating IP"
NET_DEV_IP="`gen_ip_addr`"
fi
echo "Creating network of type: $NET_TYPE"
case $NET_TYPE in
nat)
echo " Named: $NAT_NAME$NET_NUMBER"
;;
hostonly)
echo " Named: $HOSTONLY_NAME$NET_NUMBER"
;;
route)
echo " Named: $ROUTE_NAME$NET_NUMBER"
;;
esac
echo " On interface: $NET_DEV"
echo " Switchport: vif0.$VIF_COUNT"
echo " MAC Addr: $NET_DEV_MAC"
echo " IP Address: $NET_DEV_IP"
echo " DHCP: $NET_DHCP_SRV"
# Create the network
#---------------------------------------------------------------------
create_local_networks $NET_DEV $NET_TYPE $NET_NUMBER $NET_DEV_MAC $NET_DEV_IP $NET_DHCP_SRV
;;
nohost)
if [ -z $NET_NUMBER ]
then
find_next_net_number $NOHOST_NAME
fi
find_next_net_device $NOHOST_NAME
echo "Creating network of type: $NET_TYPE"
echo " Named: $NOHOST_NAME$NET_NUMBER"
echo " On interface: $NET_DEV"
# Create the network
#---------------------------------------------------------------------
create_nohost_networks $NET_DEV $NET_NUMBER
;;
empty)
if [ -z $NET_NUMBER ]
then
find_next_net_number $EMPTY_NAME
fi
echo "Creating network of type: $NET_TYPE"
echo " Named: $EMPTY_NAME$NET_NUMBER"
# Create the network
#---------------------------------------------------------------------
create_empty_networks $NET_NUMBER
;;
*)
echo "Error: Incorrect Bridge Type: $NET_TYPE"
exit 1
;;
esac
;;
del)
VIF_COUNT=`grep $NET_NAME $NETWORK_SAVE_FILE | cut -d "," -f 2`
NET_TYPE=`grep $NET_NAME $NETWORK_SAVE_FILE | cut -d "," -f 3`
NET_NUMBER=`grep $NET_NAME $NETWORK_SAVE_FILE | cut -d "," -f 4`
NET_DEV=`grep $NET_NAME $NETWORK_SAVE_FILE | cut -d "," -f 5`
NET_DEV_MAC=`grep $NET_NAME $NETWORK_SAVE_FILE | cut -d "," -f 6`
NET_DEV_IP=`grep $NET_NAME $NETWORK_SAVE_FILE | cut -d "," -f 7`
NET_DEV_DHCP_SRV=`grep $NET_NAME $NETWORK_SAVE_FILE | cut -d "," -f 8`
echo "Removing network: $NET_NAME"
# Remove the network
#---------------------------------------------------------------------
case $NET_TYPE in
bridge)
create_bridged_networks $NET_DEV $NET_NUMBER
;;
nat|hostonly|route)
create_local_networks $NET_DEV $NET_TYPE $NET_NUMBER $NET_DEV_MAC $NET_DEV_IP $NET_DHCP_SRV
;;
nohost)
create_nohost_networks $NET_DEV $NET_NUMBER
;;
empty)
create_empty_networks $NET_NUMBER
;;
esac
;;
esac
}
#***** Network Renameing Functions ****************************************
modify_network() {
echo
echo "Modifying networks is currently unsupported."
echo
}
#***** Network Showing Functions ******************************************
show_networks() {
ACTIVE_NETWORK_LIST=`ip addr show | grep "xen" | cut -d ":" -f 2 | cut -d " " -f 2`
echo
echo "--------------------------------------"
echo " Active Virtual Networks"
echo "--------------------------------------"
for NET in $ACTIVE_NETWORK_LIST
do
echo $NET
echo
done
}
#### Main Code Body #######################################################
get_mode $*
touch $NETWORK_SAVE_FILE
case $MODE in
add)
CMD_OPT="start"
create_network
;;
del)
CMD_OPT="stop"
create_network
;;
delall)
CMD_OPT="stop"
remove_all_networks
mod)
modify_network
exit 0
;;
show)
show_networks
exit 0
;;
*)
echo "Only the following modes are supported: add|del|delall|rename|show"
;;
esac
exit 0