This commit is contained in:
parent
0477e22fd2
commit
075d47716d
@ -1,68 +0,0 @@
|
||||
diff -ru a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
|
||||
--- a/tools/python/xen/xend/XendDomainInfo.py 2007-06-08 11:19:37.000000000 -0600
|
||||
+++ b/tools/python/xen/xend/XendDomainInfo.py 2007-06-08 11:23:59.000000000 -0600
|
||||
@@ -545,20 +545,17 @@
|
||||
|
||||
def destroyDevice(self, deviceClass, devid, force = False):
|
||||
try:
|
||||
- devid = int(devid)
|
||||
+ dev = int(devid)
|
||||
except ValueError:
|
||||
- # devid is not a number, let's search for it in xenstore.
|
||||
- devicePath = '%s/device/%s' % (self.dompath, deviceClass)
|
||||
- for entry in xstransact.List(devicePath):
|
||||
- backend = xstransact.Read('%s/%s' % (devicePath, entry),
|
||||
- "backend")
|
||||
- devName = xstransact.Read(backend, "dev")
|
||||
- if devName == devid:
|
||||
- # We found the integer matching our devid, use it instead
|
||||
- devid = entry
|
||||
- break
|
||||
-
|
||||
- return self.getDeviceController(deviceClass).destroyDevice(devid, force)
|
||||
+ # devid is not a number but a string containing either device
|
||||
+ # name (e.g. xvda) or device_type/device_id (e.g. vbd/51728)
|
||||
+ dev = type(devid) is str and devid.split('/')[-1] or None
|
||||
+ if dev == None:
|
||||
+ log.debug("Could not find the device %s", devid)
|
||||
+ return None
|
||||
+
|
||||
+ log.debug("dev = %s", dev)
|
||||
+ return self.getDeviceController(deviceClass).destroyDevice(dev, force)
|
||||
|
||||
def getDeviceSxprs(self, deviceClass):
|
||||
if self._stateGet() in (DOM_STATE_RUNNING, DOM_STATE_PAUSED):
|
||||
@@ -1354,20 +1351,19 @@
|
||||
self.image.destroy(suspend)
|
||||
return
|
||||
|
||||
- while True:
|
||||
- t = xstransact("%s/device" % self.dompath)
|
||||
- for devclass in XendDevices.valid_devices():
|
||||
- for dev in t.list(devclass):
|
||||
- try:
|
||||
- t.remove(dev)
|
||||
- except:
|
||||
- # Log and swallow any exceptions in removal --
|
||||
- # there's nothing more we can do.
|
||||
- log.exception(
|
||||
- "Device release failed: %s; %s; %s",
|
||||
- self.info['name_label'], devclass, dev)
|
||||
- if t.commit():
|
||||
- break
|
||||
+ t = xstransact("%s/device" % self.dompath)
|
||||
+ for devclass in XendDevices.valid_devices():
|
||||
+ for dev in t.list(devclass):
|
||||
+ try:
|
||||
+ log.debug("Removing %s", dev);
|
||||
+ self.destroyDevice(devclass, dev, False);
|
||||
+ except:
|
||||
+ # Log and swallow any exceptions in removal --
|
||||
+ # there's nothing more we can do.
|
||||
+ log.exception("Device release failed: %s; %s; %s",
|
||||
+ self.info['name_label'], devclass, dev)
|
||||
+
|
||||
+
|
||||
|
||||
def getDeviceController(self, name):
|
||||
"""Get the device controller for this domain, and if it
|
104
15157_xend_device_destroy.patch
Normal file
104
15157_xend_device_destroy.patch
Normal file
@ -0,0 +1,104 @@
|
||||
# HG changeset patch
|
||||
# User kfraser@localhost.localdomain
|
||||
# Date 1180016489 -3600
|
||||
# Node ID 3ef4a4d8213061fe14d905e89594c99d0b9cb605
|
||||
# Parent 6a4af9502b4da269388a60416a7cca0ecadb3bb3
|
||||
xend: Fix for removing devices at save/destroy domain.
|
||||
|
||||
The function XendDomainInfo:_releaseDevices() is called during the
|
||||
save/destroy phase of a domain. It made some attempt to clean up the
|
||||
devices, but wasn't complete, leaving dangling devices in the
|
||||
xenstore. Not a big problem with normal use of Xen, but a buildup over
|
||||
a large number of save/destroy instances, it would make the xenstore
|
||||
database grow quite large, which in turn meant swap-thrashing in Dom0.
|
||||
|
||||
This patch makes use of the destroyDevices() function in
|
||||
XendDomainInfo. This function needed some re-writing to make it work
|
||||
correctly - I think it had some old code (not sure how old, as xm
|
||||
annotate says that it's changeset 12071, but that, I think, is when it
|
||||
was split out from XendDomain.py, rather than when it was created).
|
||||
|
||||
I have tested this over a few hundred save/restore cycles [two domains
|
||||
constantly saved/restored with a short sleep to let them process some
|
||||
work] combined with a loop of "xenstore-ls|wc". The output of the
|
||||
latter is pretty much constant (it obviously varies a bit depending on
|
||||
when in the save/restore cycle it hits). Previously, it would increase
|
||||
by some 10 lines or so per save/restore cycle.
|
||||
|
||||
Signed-off-by: Mats Petersson <mats.petersson@amd.com>
|
||||
|
||||
Index: xen-3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
===================================================================
|
||||
--- xen-3.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -544,20 +544,30 @@ class XendDomainInfo:
|
||||
self.getDeviceController(devclass).waitForDevices()
|
||||
|
||||
def destroyDevice(self, deviceClass, devid, force = False):
|
||||
+ found = True # Assume devid is an integer.
|
||||
try:
|
||||
devid = int(devid)
|
||||
except ValueError:
|
||||
# devid is not a number, let's search for it in xenstore.
|
||||
devicePath = '%s/device/%s' % (self.dompath, deviceClass)
|
||||
+ found = False
|
||||
for entry in xstransact.List(devicePath):
|
||||
+ log.debug("Attempting to find devid at %s/%s", devicePath, entry)
|
||||
backend = xstransact.Read('%s/%s' % (devicePath, entry),
|
||||
"backend")
|
||||
- devName = xstransact.Read(backend, "dev")
|
||||
- if devName == devid:
|
||||
- # We found the integer matching our devid, use it instead
|
||||
- devid = entry
|
||||
- break
|
||||
-
|
||||
+ if backend != None:
|
||||
+ devName = '%s/%s' % (deviceClass, entry)
|
||||
+ log.debug("devName=%s", devName)
|
||||
+ if devName == devid:
|
||||
+ # We found the integer matching our devid, use it instead
|
||||
+ devid = int(entry)
|
||||
+ found = True
|
||||
+ break
|
||||
+
|
||||
+ if not found:
|
||||
+ log.debug("Could not find the device %s", devid)
|
||||
+ return None
|
||||
+ log.debug("devid = %s", devid)
|
||||
return self.getDeviceController(deviceClass).destroyDevice(devid, force)
|
||||
|
||||
def getDeviceSxprs(self, deviceClass):
|
||||
@@ -1330,20 +1340,19 @@ class XendDomainInfo:
|
||||
self.image.destroy(suspend)
|
||||
return
|
||||
|
||||
- while True:
|
||||
- t = xstransact("%s/device" % self.dompath)
|
||||
- for devclass in XendDevices.valid_devices():
|
||||
- for dev in t.list(devclass):
|
||||
- try:
|
||||
- t.remove(dev)
|
||||
- except:
|
||||
- # Log and swallow any exceptions in removal --
|
||||
- # there's nothing more we can do.
|
||||
- log.exception(
|
||||
- "Device release failed: %s; %s; %s",
|
||||
- self.info['name_label'], devclass, dev)
|
||||
- if t.commit():
|
||||
- break
|
||||
+ t = xstransact("%s/device" % self.dompath)
|
||||
+ for devclass in XendDevices.valid_devices():
|
||||
+ for dev in t.list(devclass):
|
||||
+ try:
|
||||
+ log.debug("Removing %s", dev);
|
||||
+ self.destroyDevice(devclass, dev, False);
|
||||
+ except:
|
||||
+ # Log and swallow any exceptions in removal --
|
||||
+ # there's nothing more we can do.
|
||||
+ log.exception("Device release failed: %s; %s; %s",
|
||||
+ self.info['name_label'], devclass, dev)
|
||||
+
|
||||
+
|
||||
|
||||
def getDeviceController(self, name):
|
||||
"""Get the device controller for this domain, and if it
|
69
15250_xend_device_destroy.patch
Normal file
69
15250_xend_device_destroy.patch
Normal file
@ -0,0 +1,69 @@
|
||||
# HG changeset patch
|
||||
# User kfraser@localhost.localdomain
|
||||
# Date 1181553294 -3600
|
||||
# Node ID a43a03d53781e159da41f79d8cc615905b95ab80
|
||||
# Parent 93f77a5a8437df0b34919a6987f48e84342b4a43
|
||||
xend: Fix xm block-detach regression introduced by c/s 15157.
|
||||
|
||||
Prior to this c/s, user was able to specify device name or id, e.g.
|
||||
xm block-detach dom xvdb
|
||||
xm block-detach dom 15728
|
||||
|
||||
Now, 'xm block-detach dom xvdb' silently fails. xend.log does contain
|
||||
the following
|
||||
|
||||
[2007-06-07 11:39:18 xend.XendDomainInfo 3775] DEBUG
|
||||
(XendDomainInfo:519) devName=vbd/51712
|
||||
[2007-06-07 11:39:18 xend.XendDomainInfo 3775] DEBUG
|
||||
(XendDomainInfo:527) Could not find the device xvdb
|
||||
|
||||
This patch restores the previous behavior but retains the bugfix
|
||||
introduced by c/s 15571.
|
||||
|
||||
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
|
||||
|
||||
Index: xen-3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
===================================================================
|
||||
--- xen-3.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -544,31 +544,18 @@ class XendDomainInfo:
|
||||
self.getDeviceController(devclass).waitForDevices()
|
||||
|
||||
def destroyDevice(self, deviceClass, devid, force = False):
|
||||
- found = True # Assume devid is an integer.
|
||||
try:
|
||||
- devid = int(devid)
|
||||
+ dev = int(devid)
|
||||
except ValueError:
|
||||
- # devid is not a number, let's search for it in xenstore.
|
||||
- devicePath = '%s/device/%s' % (self.dompath, deviceClass)
|
||||
- found = False
|
||||
- for entry in xstransact.List(devicePath):
|
||||
- log.debug("Attempting to find devid at %s/%s", devicePath, entry)
|
||||
- backend = xstransact.Read('%s/%s' % (devicePath, entry),
|
||||
- "backend")
|
||||
- if backend != None:
|
||||
- devName = '%s/%s' % (deviceClass, entry)
|
||||
- log.debug("devName=%s", devName)
|
||||
- if devName == devid:
|
||||
- # We found the integer matching our devid, use it instead
|
||||
- devid = int(entry)
|
||||
- found = True
|
||||
- break
|
||||
+ # devid is not a number but a string containing either device
|
||||
+ # name (e.g. xvda) or device_type/device_id (e.g. vbd/51728)
|
||||
+ dev = type(devid) is str and devid.split('/')[-1] or None
|
||||
+ if dev == None:
|
||||
+ log.debug("Could not find the device %s", devid)
|
||||
+ return None
|
||||
|
||||
- if not found:
|
||||
- log.debug("Could not find the device %s", devid)
|
||||
- return None
|
||||
- log.debug("devid = %s", devid)
|
||||
- return self.getDeviceController(deviceClass).destroyDevice(devid, force)
|
||||
+ log.debug("dev = %s", dev)
|
||||
+ return self.getDeviceController(deviceClass).destroyDevice(dev, force)
|
||||
|
||||
def getDeviceSxprs(self, deviceClass):
|
||||
if self._stateGet() in (DOM_STATE_RUNNING, DOM_STATE_PAUSED):
|
66
15273_libxenapi.patch
Normal file
66
15273_libxenapi.patch
Normal file
@ -0,0 +1,66 @@
|
||||
# HG changeset patch
|
||||
# User kfraser@localhost.localdomain
|
||||
# Date 1181730428 -3600
|
||||
# Node ID 7f9362a8ae3daeb5dc7bc62069eae872c42a5a14
|
||||
# Parent 30449e0e0a64618c29e47ed7774cd2b689711319
|
||||
xenapi: Fix segfault in libxenapi.
|
||||
|
||||
When calling xen_vbd_set_mode(), libxenapi attempted to convert enum
|
||||
mode parameter to a string twice - resulting in segfault. Removed
|
||||
first conversion since conversion is taking place in
|
||||
marshalling/demarshalling layer. Fixed similar double enum conversion
|
||||
in other places as well.
|
||||
|
||||
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
|
||||
|
||||
diff -r 30449e0e0a64 -r 7f9362a8ae3d tools/libxen/src/xen_vbd.c
|
||||
--- a/tools/libxen/src/xen_vbd.c Wed Jun 13 11:13:11 2007 +0100
|
||||
+++ b/tools/libxen/src/xen_vbd.c Wed Jun 13 11:27:08 2007 +0100
|
||||
@@ -463,7 +463,7 @@ xen_vbd_set_mode(xen_session *session, x
|
||||
{ .type = &abstract_type_string,
|
||||
.u.string_val = vbd },
|
||||
{ .type = &xen_vbd_mode_abstract_type_,
|
||||
- .u.string_val = xen_vbd_mode_to_string(mode) }
|
||||
+ .u.enum_val = mode }
|
||||
};
|
||||
|
||||
xen_call_(session, "VBD.set_mode", param_values, 2, NULL, NULL);
|
||||
@@ -479,7 +479,7 @@ xen_vbd_set_type(xen_session *session, x
|
||||
{ .type = &abstract_type_string,
|
||||
.u.string_val = vbd },
|
||||
{ .type = &xen_vbd_type_abstract_type_,
|
||||
- .u.string_val = xen_vbd_type_to_string(type) }
|
||||
+ .u.enum_val = type }
|
||||
};
|
||||
|
||||
xen_call_(session, "VBD.set_type", param_values, 2, NULL, NULL);
|
||||
diff -r 30449e0e0a64 -r 7f9362a8ae3d tools/libxen/src/xen_vm.c
|
||||
--- a/tools/libxen/src/xen_vm.c Wed Jun 13 11:13:11 2007 +0100
|
||||
+++ b/tools/libxen/src/xen_vm.c Wed Jun 13 11:27:08 2007 +0100
|
||||
@@ -1142,7 +1142,7 @@ xen_vm_set_actions_after_shutdown(xen_se
|
||||
{ .type = &abstract_type_string,
|
||||
.u.string_val = vm },
|
||||
{ .type = &xen_on_normal_exit_abstract_type_,
|
||||
- .u.string_val = xen_on_normal_exit_to_string(after_shutdown) }
|
||||
+ .u.enum_val = after_shutdown }
|
||||
};
|
||||
|
||||
xen_call_(session, "VM.set_actions_after_shutdown", param_values, 2, NULL, NULL);
|
||||
@@ -1158,7 +1158,7 @@ xen_vm_set_actions_after_reboot(xen_sess
|
||||
{ .type = &abstract_type_string,
|
||||
.u.string_val = vm },
|
||||
{ .type = &xen_on_normal_exit_abstract_type_,
|
||||
- .u.string_val = xen_on_normal_exit_to_string(after_reboot) }
|
||||
+ .u.enum_val = after_reboot }
|
||||
};
|
||||
|
||||
xen_call_(session, "VM.set_actions_after_reboot", param_values, 2, NULL, NULL);
|
||||
@@ -1174,7 +1174,7 @@ xen_vm_set_actions_after_crash(xen_sessi
|
||||
{ .type = &abstract_type_string,
|
||||
.u.string_val = vm },
|
||||
{ .type = &xen_on_crash_behaviour_abstract_type_,
|
||||
- .u.string_val = xen_on_crash_behaviour_to_string(after_crash) }
|
||||
+ .u.enum_val = after_crash }
|
||||
};
|
||||
|
||||
xen_call_(session, "VM.set_actions_after_crash", param_values, 2, NULL, NULL);
|
30
15274_xenapi.patch
Normal file
30
15274_xenapi.patch
Normal file
@ -0,0 +1,30 @@
|
||||
# HG changeset patch
|
||||
# User kfraser@localhost.localdomain
|
||||
# Date 1181730467 -3600
|
||||
# Node ID ffdbe8aebde21710deca4ae84bba95e38f4b089b
|
||||
# Parent 7f9362a8ae3daeb5dc7bc62069eae872c42a5a14
|
||||
xenapi: Implement XenAPI method VBD.set_mode in python.
|
||||
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
|
||||
|
||||
Index: xen-3.1-testing/tools/python/xen/xend/XendAPI.py
|
||||
===================================================================
|
||||
--- xen-3.1-testing.orig/tools/python/xen/xend/XendAPI.py
|
||||
+++ xen-3.1-testing/tools/python/xen/xend/XendAPI.py
|
||||
@@ -1873,6 +1873,17 @@ class XendAPI(object):
|
||||
xd.managed_config_save(vm)
|
||||
return xen_api_success_void()
|
||||
|
||||
+ def VBD_set_mode(self, session, vbd_ref, mode):
|
||||
+ if mode == 'RW':
|
||||
+ mode = 'w'
|
||||
+ else:
|
||||
+ mode = 'r'
|
||||
+ xd = XendDomain.instance()
|
||||
+ vm = xd.get_vm_with_dev_uuid('vbd', vbd_ref)
|
||||
+ vm.set_dev_property('vbd', vbd_ref, 'mode', mode)
|
||||
+ xd.managed_config_save(vm)
|
||||
+ return xen_api_success_void()
|
||||
+
|
||||
def VBD_get_all(self, session):
|
||||
xendom = XendDomain.instance()
|
||||
vbds = [d.get_vbds() for d in XendDomain.instance().list('all')]
|
27
15275_xenapi.patch
Normal file
27
15275_xenapi.patch
Normal file
@ -0,0 +1,27 @@
|
||||
# HG changeset patch
|
||||
# User kfraser@localhost.localdomain
|
||||
# Date 1181730493 -3600
|
||||
# Node ID b643179d7452a91cd874ee713c78bf30f8df3d2d
|
||||
# Parent ffdbe8aebde21710deca4ae84bba95e38f4b089b
|
||||
xenapi: Implement VM.set_VCPUs_at_startup and VM.set_VCPUs_max XenAPI
|
||||
methods in xend.
|
||||
|
||||
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
|
||||
|
||||
Index: xen-3.1-testing/tools/python/xen/xend/XendAPI.py
|
||||
===================================================================
|
||||
--- xen-3.1-testing.orig/tools/python/xen/xend/XendAPI.py
|
||||
+++ xen-3.1-testing/tools/python/xen/xend/XendAPI.py
|
||||
@@ -1474,6 +1474,12 @@ class XendAPI(object):
|
||||
else:
|
||||
return xen_api_success_void()
|
||||
|
||||
+ def VM_set_VCPUs_at_startup(self, session, vm_ref, num):
|
||||
+ return self.VM_set('VCPUs_at_startup', session, vm_ref, num)
|
||||
+
|
||||
+ def VM_set_VCPUs_max(self, session, vm_ref, num):
|
||||
+ return self.VM_set('VCPUs_max', session, vm_ref, num)
|
||||
+
|
||||
def VM_set_actions_after_shutdown(self, session, vm_ref, action):
|
||||
if action not in XEN_API_ON_NORMAL_EXIT:
|
||||
return xen_api_error(['VM_ON_NORMAL_EXIT_INVALID', vm_ref])
|
@ -1,6 +1,15 @@
|
||||
diff -r c21b18b97a61 tools/libxc/xc_domain_restore.c
|
||||
--- a/tools/libxc/xc_domain_restore.c Tue Jun 05 17:05:13 2007 +0100
|
||||
+++ b/tools/libxc/xc_domain_restore.c Tue Jun 05 17:40:40 2007 +0100
|
||||
|
||||
# HG changeset patch
|
||||
# User kfraser@localhost.localdomain
|
||||
# Date 1182415659 -3600
|
||||
# Node ID a83632dfbb28038ec4218e00f92ea220a85b6887
|
||||
# Parent 11bf94b2d51a10980a88aa3ee0b3b8c6e14cbfe0
|
||||
libxenguest: Add missing range-check on count field read from a domain
|
||||
save/restore file.
|
||||
Signed-off-by: Keir Fraser <keir@xensource.com>
|
||||
|
||||
--- a/tools/libxc/xc_domain_restore.c Wed Jun 20 19:31:37 2007 +0100
|
||||
+++ b/tools/libxc/xc_domain_restore.c Thu Jun 21 09:47:39 2007 +0100
|
||||
@@ -903,13 +903,14 @@ int xc_domain_restore(int xc_handle, int
|
||||
|
||||
/* Get the list of PFNs that are not in the psuedo-phys map */
|
||||
@ -20,3 +29,4 @@ diff -r c21b18b97a61 tools/libxc/xc_domain_restore.c
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
12
clear_DF_for_kernel.patch
Normal file
12
clear_DF_for_kernel.patch
Normal file
@ -0,0 +1,12 @@
|
||||
Index: xen-3.1-testing/xen/arch/x86/x86_64/entry.S
|
||||
===================================================================
|
||||
--- xen-3.1-testing.orig/xen/arch/x86/x86_64/entry.S
|
||||
+++ xen-3.1-testing/xen/arch/x86/x86_64/entry.S
|
||||
@@ -34,6 +34,7 @@ switch_to_kernel:
|
||||
jnc 1f
|
||||
movb $TBF_INTERRUPT,TRAPBOUNCE_flags(%rdx)
|
||||
1: call create_bounce_frame
|
||||
+ andl $~X86_EFLAGS_DF,UREGS_eflags(%rsp)
|
||||
jmp test_all_events
|
||||
|
||||
/* %rbx: struct vcpu, interrupts disabled */
|
742
man-page.diff
Normal file
742
man-page.diff
Normal file
@ -0,0 +1,742 @@
|
||||
Index: xen-3.1-testing/docs/man/xm.pod.1
|
||||
===================================================================
|
||||
--- xen-3.1-testing.orig/docs/man/xm.pod.1
|
||||
+++ xen-3.1-testing/docs/man/xm.pod.1
|
||||
@@ -4,7 +4,7 @@ xm - Xen management user interface
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
-xm <subcommand> [args]
|
||||
+B<xm> I<subcommand> [I<args>]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@@ -13,46 +13,50 @@ domains. The program can be used to crea
|
||||
domains. It can also be used to list current domains, enable or pin
|
||||
VCPUs, and attach or detach virtual block devices.
|
||||
|
||||
-The basic structure of every xm command is almost always:
|
||||
+The basic structure of every B<xm> command is almost always:
|
||||
|
||||
- xm <subcommand> <domain-id> [OPTIONS]
|
||||
+=over 2
|
||||
|
||||
-Where I<subcommand> is one of the sub commands listed below, I<domain-id>
|
||||
+B<xm> I<subcommand> I<domain-id> [I<OPTIONS>]
|
||||
+
|
||||
+=back
|
||||
+
|
||||
+Where I<subcommand> is one of the subcommands listed below, I<domain-id>
|
||||
is the numeric domain id, or the domain name (which will be internally
|
||||
-translated to domain id), and I<OPTIONS> are sub command specific
|
||||
+translated to domain id), and I<OPTIONS> are subcommand specific
|
||||
options. There are a few exceptions to this rule in the cases where
|
||||
-the sub command in question acts on all domains, the entire machine,
|
||||
-or directly on the xen hypervisor. Those exceptions will be clear for
|
||||
-each of those sub commands.
|
||||
+the subcommand in question acts on all domains, the entire machine,
|
||||
+or directly on the Xen hypervisor. Those exceptions will be clear for
|
||||
+each of those subcommands.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
All B<xm> operations rely upon the Xen control daemon, aka B<xend>.
|
||||
-For any xm commands to run xend must also be running. For this reason
|
||||
-you should start xend as a service when your system first boots using
|
||||
-xen.
|
||||
+For any B<xm> commands to run, xend must also be running. For this
|
||||
+reason you should start xend as a service when your system first boots
|
||||
+using Xen.
|
||||
|
||||
Most B<xm> commands require root privileges to run due to the
|
||||
communications channels used to talk to the hypervisor. Running as
|
||||
non root will return an error.
|
||||
|
||||
Most B<xm> commands act asynchronously, so just because the B<xm>
|
||||
-command returned, doesn't mean the action is complete. This is
|
||||
+command returned doesn't mean the action is complete. This is
|
||||
important, as many operations on domains, like create and shutdown,
|
||||
can take considerable time (30 seconds or more) to bring the machine
|
||||
into a fully compliant state. If you want to know when one of these
|
||||
-actions has finished you must poll through xm list periodically.
|
||||
+actions has finished you must poll through B<xm list> periodically.
|
||||
|
||||
=head1 DOMAIN SUBCOMMANDS
|
||||
|
||||
-The following sub commands manipulate domains directly, as stated
|
||||
-previously most commands take domain-id as the first parameter.
|
||||
+The following subcommands manipulate domains directly. As stated
|
||||
+previously, most commands take I<domain-id> as the first parameter.
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<console> I<domain-id>
|
||||
|
||||
-Attach to domain domain-id's console. If you've set up your Domains to
|
||||
+Attach to domain I<domain-id>'s console. If you've set up your domains to
|
||||
have a traditional log in console this will look much like a normal
|
||||
text log in screen.
|
||||
|
||||
@@ -63,15 +67,15 @@ The attached console will perform much l
|
||||
so running curses based interfaces over the console B<is not
|
||||
advised>. Vi tends to get very odd when using it over this interface.
|
||||
|
||||
-=item B<create> I<[-c]> I<configfile> I<[name=value]>..
|
||||
+=item B<create> [B<-c>] I<configfile> [I<name>=I<value>]..
|
||||
|
||||
-The create sub command requires a configfile and can optional take a
|
||||
+The create sub command requires a config file and can optionally take a
|
||||
series of name value pairs that add to or override variables defined
|
||||
in the config file. See L<xmdomain.cfg> for full details of that file
|
||||
format, and possible options used in either the configfile or
|
||||
-Name=Value combinations.
|
||||
+I<name>=I<value> combinations.
|
||||
|
||||
-Configfile can either be an absolute path to a file, or a relative
|
||||
+I<configfile> can either be an absolute path to a file, or a relative
|
||||
path to a file located in /etc/xen.
|
||||
|
||||
Create will return B<as soon> as the domain is started. This B<does
|
||||
@@ -116,10 +120,10 @@ virtual networking. (This example comes
|
||||
|
||||
=item B<destroy> I<domain-id>
|
||||
|
||||
-Immediately terminate the domain domain-id. This doesn't give the domain
|
||||
-OS any chance to react, and it the equivalent of ripping the power
|
||||
-cord out on a physical machine. In most cases you will want to use
|
||||
-the B<shutdown> command instead.
|
||||
+Immediately terminate the domain I<domain-id>. This doesn't give the
|
||||
+domain OS any chance to react, and is the equivalent of ripping the
|
||||
+power cord out on a physical machine. In most cases you will want to
|
||||
+use the B<shutdown> command instead.
|
||||
|
||||
=item B<domid> I<domain-name>
|
||||
|
||||
@@ -129,14 +133,14 @@ Converts a domain name to a domain id us
|
||||
|
||||
Converts a domain id to a domain name using xend's internal mapping.
|
||||
|
||||
-=item B<help> I<[--long]>
|
||||
+=item B<help> [B<--long>]
|
||||
|
||||
Displays the short help message (i.e. common commands).
|
||||
|
||||
-The I<--long> option prints out the complete set of B<xm> subcommands,
|
||||
+The B<--long> option prints out the complete set of B<xm> subcommands,
|
||||
grouped by function.
|
||||
|
||||
-=item B<list> I<[--long | --label]> I<[domain-id, ...]>
|
||||
+=item B<list> [B<--long> | B<--label>] [I<domain-id> ...]
|
||||
|
||||
Prints information about one or more domains. If no domains are
|
||||
specified it prints out information about all domains.
|
||||
@@ -151,21 +155,23 @@ An example format for the list is as fol
|
||||
Mandrake10.2 167 128 1 ------ 2.5
|
||||
Suse9.2 168 100 1 ------ 1.8
|
||||
|
||||
-Name is the name of the domain. ID the domain numeric id. Mem is the
|
||||
-size of the memory allocated to the domain. VCPUS is the number of
|
||||
-VCPUS allocated to domain. State is the run state (see below). Time
|
||||
-is the total run time of the domain as accounted for by Xen.
|
||||
+Name is the name of the domain. ID the numeric domain id. Mem is the
|
||||
+desired amount of memory to allocate to the domain (although it may
|
||||
+not be the currently allocated amount). VCPUs is the number of
|
||||
+virtual CPUs allocated to the domain. State is the run state (see
|
||||
+below). Time is the total run time of the domain as accounted for by
|
||||
+Xen.
|
||||
|
||||
B<STATES>
|
||||
|
||||
=over 4
|
||||
|
||||
-The State field lists 6 states for a Xen Domain, and which ones the
|
||||
-current Domain is in.
|
||||
+The State field lists 6 states for a Xen domain, and which ones the
|
||||
+current domain is in.
|
||||
|
||||
=item B<r - running>
|
||||
|
||||
-The domain is currently running on a CPU
|
||||
+The domain is currently running on a CPU.
|
||||
|
||||
=item B<b - blocked>
|
||||
|
||||
@@ -203,12 +209,12 @@ B<LONG OUTPUT>
|
||||
|
||||
=over 4
|
||||
|
||||
-If I<--long> is specified, the output for xm list is not the table
|
||||
+If B<--long> is specified, the output for B<xm list> is not the table
|
||||
view shown above, but instead is an S-Expression representing all
|
||||
information known about all domains asked for. This is mostly only
|
||||
useful for external programs to parse the data.
|
||||
|
||||
-B<Note:> there is no stable guarantees on the format of this data.
|
||||
+B<Note:> There is no stable guarantees on the format of this data.
|
||||
Use at your own risk.
|
||||
|
||||
=back
|
||||
@@ -217,10 +223,10 @@ B<LABEL OUTPUT>
|
||||
|
||||
=over 4
|
||||
|
||||
-If I<--label> is specified, the security labels are added to the
|
||||
-output of xm list and the lines are sorted by the labels (ignoring
|
||||
-case). The I<--long> option prints the labels by default and cannot be
|
||||
-combined with I<--label>. See the ACCESS CONTROL SUBCOMMAND section of
|
||||
+If B<--label> is specified, the security labels are added to the
|
||||
+output of B<xm list> and the lines are sorted by the labels (ignoring
|
||||
+case). The B<--long> option prints the labels by default and cannot be
|
||||
+combined with B<--label>. See the ACCESS CONTROL SUBCOMMAND section of
|
||||
this man page for more information about labels.
|
||||
|
||||
==back
|
||||
@@ -230,7 +236,7 @@ B<NOTES>
|
||||
=over 4
|
||||
|
||||
The Time column is deceptive. Virtual IO (network and block devices)
|
||||
-used by Domains requires coordination by Domain0, which means that
|
||||
+used by domains requires coordination by Domain0, which means that
|
||||
Domain0 is actually charged for much of the time that a DomainU is
|
||||
doing IO. Use of this time value to determine relative utilizations
|
||||
by domains is thus very suspect, as a high IO workload may show as
|
||||
@@ -240,11 +246,11 @@ less utilized than a high CPU workload.
|
||||
|
||||
=item B<mem-max> I<domain-id> I<mem>
|
||||
|
||||
-Specify the maximum amount of memory the Domain is able to use. Mem
|
||||
+Specify the maximum amount of memory the domain is able to use. I<mem>
|
||||
is specified in megabytes.
|
||||
|
||||
The mem-max value may not correspond to the actual memory used in the
|
||||
-Domain, as it may balloon down it's memory to give more back to the OS.
|
||||
+domain, as it may balloon down its memory to give more back to the OS.
|
||||
|
||||
=item B<mem-set> I<domain-id> I<mem>
|
||||
|
||||
@@ -252,20 +258,20 @@ Set the domain's used memory using the b
|
||||
operation requires cooperation from the domain operating system, there
|
||||
is no guarantee that it will succeed.
|
||||
|
||||
-B<Warning:> there is no good way to know in advance how small of a
|
||||
+B<Warning:> There is no good way to know in advance how small of a
|
||||
mem-set will make a domain unstable and cause it to crash. Be very
|
||||
careful when using this command on running domains.
|
||||
|
||||
-=item B<migrate> I<domain-id> I<host> I<[options]>
|
||||
+=item B<migrate> I<domain-id> I<host> [I<OPTIONS>]
|
||||
|
||||
-Migrate a domain to another Host machine. B<Xend> must be running on
|
||||
-other host machine, it must be running the same version of xen, it
|
||||
+Migrate a domain to another host machine. Xend must be running on
|
||||
+other host machine, it must be running the same version of Xen, it
|
||||
must have the migration TCP port open and accepting connections from
|
||||
the source host, and there must be sufficient resources for the domain
|
||||
to run (memory, disk, etc).
|
||||
|
||||
-Migration is pretty complicated, and has many security implications,
|
||||
-please read the Xen Users Guide to ensure you understand the
|
||||
+Migration is pretty complicated, and has many security implications.
|
||||
+Please read the Xen User's Guide to ensure you understand the
|
||||
ramifications and limitations on migration before attempting it in
|
||||
production.
|
||||
|
||||
@@ -273,13 +279,13 @@ B<OPTIONS>
|
||||
|
||||
=over 4
|
||||
|
||||
-=item B<-l, --live>
|
||||
+=item B<-l>, B<--live>
|
||||
|
||||
Use live migration. This will migrate the domain between hosts
|
||||
-without shutting down the domain. See the Xen Users Guide for more
|
||||
+without shutting down the domain. See the Xen User's Guide for more
|
||||
information.
|
||||
|
||||
-=item B<-r, --resource> I<Mbs>
|
||||
+=item B<-r>, B<--resource> I<Mbs>
|
||||
|
||||
Set maximum Mbs allowed for migrating the domain. This ensures that
|
||||
the network link is not saturated with migration traffic while
|
||||
@@ -293,7 +299,7 @@ Pause a domain. When in a paused state
|
||||
allocated resources such as memory, but will not be eligible for
|
||||
scheduling by the Xen hypervisor.
|
||||
|
||||
-=item B<reboot> I<[options]> I<domain-id>
|
||||
+=item B<reboot> [I<OPTIONS>] I<domain-id>
|
||||
|
||||
Reboot a domain. This acts just as if the domain had the B<reboot>
|
||||
command run from the console. The command returns as soon as it has
|
||||
@@ -301,18 +307,18 @@ executed the reboot action, which may be
|
||||
domain actually reboots.
|
||||
|
||||
The behavior of what happens to a domain when it reboots is set by the
|
||||
-I<on_reboot> parameter of the xmdomain.cfg file when the domain was
|
||||
+B<on_reboot> parameter of the xmdomain.cfg file when the domain was
|
||||
created.
|
||||
|
||||
B<OPTIONS>
|
||||
|
||||
=over 4
|
||||
|
||||
-=item B<-a, --all>
|
||||
+=item B<-a>, B<--all>
|
||||
|
||||
-Reboot all domains
|
||||
+Reboot all domains.
|
||||
|
||||
-=item B<-w, --wait>
|
||||
+=item B<-w>, B<--wait>
|
||||
|
||||
Wait for reboot to complete before returning. This may take a while,
|
||||
as all services in the domain will have to be shut down cleanly.
|
||||
@@ -321,7 +327,7 @@ as all services in the domain will have
|
||||
|
||||
=item B<restore> I<state-file>
|
||||
|
||||
-Build a domain from an B<xm save> state file. See I<save> for more info.
|
||||
+Build a domain from an B<xm save> state file. See B<save> for more info.
|
||||
|
||||
=item B<save> I<domain-id> I<state-file>
|
||||
|
||||
@@ -334,16 +340,16 @@ This is roughly equivalent to doing a hi
|
||||
with all the same limitations. Open network connections may be
|
||||
severed upon restore, as TCP timeouts may have expired.
|
||||
|
||||
-=item B<shutdown> I<[options]> I<domain-id>
|
||||
+=item B<shutdown> [I<OPTIONS>] I<domain-id>
|
||||
|
||||
Gracefully shuts down a domain. This coordinates with the domain OS
|
||||
to perform graceful shutdown, so there is no guarantee that it will
|
||||
succeed, and may take a variable length of time depending on what
|
||||
services must be shutdown in the domain. The command returns
|
||||
-immediately after signally the domain unless that I<-w> flag is used.
|
||||
+immediately after signally the domain unless that B<-w> flag is used.
|
||||
|
||||
The behavior of what happens to a domain when it reboots is set by the
|
||||
-I<on_shutdown> parameter of the xmdomain.cfg file when the domain was
|
||||
+B<on_shutdown> parameter of the xmdomain.cfg file when the domain was
|
||||
created.
|
||||
|
||||
B<OPTIONS>
|
||||
@@ -386,7 +392,7 @@ Attempting to set the VCPUs to a number
|
||||
configured VCPU count is an error. Trying to set VCPUs to < 1 will be
|
||||
quietly ignored.
|
||||
|
||||
-=item B<vcpu-list> I<[domain-id]>
|
||||
+=item B<vcpu-list> [I<domain-id>]
|
||||
|
||||
Lists VCPU information for a specific domain. If no domain is
|
||||
specified, VCPU information for all domains will be provided.
|
||||
@@ -394,7 +400,7 @@ specified, VCPU information for all doma
|
||||
=item B<vcpu-pin> I<domain-id> I<vcpu> I<cpus>
|
||||
|
||||
Pins the the VCPU to only run on the specific CPUs. The keyword
|
||||
-I<all> can be used to apply the I<cpus> list to all VCPUs in the
|
||||
+B<all> can be used to apply the I<cpus> list to all VCPUs in the
|
||||
domain.
|
||||
|
||||
Normally VCPUs can float between available CPUs whenever Xen deems a
|
||||
@@ -408,7 +414,7 @@ CPUs.
|
||||
|
||||
=over 4
|
||||
|
||||
-=item B<dmesg> I<[-c]>
|
||||
+=item B<dmesg> [B<-c>]
|
||||
|
||||
Reads the Xen message buffer, similar to dmesg on a Linux system. The
|
||||
buffer contains informational, warning, and error messages created
|
||||
@@ -419,7 +425,7 @@ B<OPTIONS>
|
||||
|
||||
=over 4
|
||||
|
||||
-=item B<-c, --clear>
|
||||
+=item B<-c>, B<--clear>
|
||||
|
||||
Clears Xen's message buffer.
|
||||
|
||||
@@ -431,8 +437,8 @@ Print information about the Xen host in
|
||||
reporting a Xen bug, please provide this information as part of the
|
||||
bug report.
|
||||
|
||||
-Sample xen domain info looks as follows (lines wrapped manually to
|
||||
-make the man page more readable):
|
||||
+Sample output looks as follows (lines wrapped manually to make the man
|
||||
+page more readable):
|
||||
|
||||
host : talon
|
||||
release : 2.6.12.6-xen0
|
||||
@@ -470,36 +476,36 @@ B<FIELDS>
|
||||
Not all fields will be explained here, but some of the less obvious
|
||||
ones deserve explanation:
|
||||
|
||||
-=item I<hw_caps>
|
||||
+=item B<hw_caps>
|
||||
|
||||
A vector showing what hardware capabilities are supported by your
|
||||
processor. This is equivalent to, though more cryptic, the flags
|
||||
field in /proc/cpuinfo on a normal Linux machine.
|
||||
|
||||
-=item I<free_memory>
|
||||
+=item B<free_memory>
|
||||
|
||||
-Available memory (in MB) not allocated to Xen, or any other Domains.
|
||||
+Available memory (in MB) not allocated to Xen, or any other domains.
|
||||
|
||||
-=item I<xen_caps>
|
||||
+=item B<xen_caps>
|
||||
|
||||
-The xen version, architecture. Architecture values can be one of:
|
||||
+The Xen version and architecture. Architecture values can be one of:
|
||||
x86_32, x86_32p (i.e. PAE enabled), x86_64, ia64.
|
||||
|
||||
-=item I<xen_changeset>
|
||||
+=item B<xen_changeset>
|
||||
|
||||
-The xen mercurial changeset id. Very useful for determining exactly
|
||||
+The Xen mercurial changeset id. Very useful for determining exactly
|
||||
what version of code your Xen system was built from.
|
||||
|
||||
=back
|
||||
|
||||
=item B<log>
|
||||
|
||||
-Print out the B<xend> log. This log file can be found in
|
||||
+Print out the xend log. This log file can be found in
|
||||
/var/log/xend.log.
|
||||
|
||||
=item B<top>
|
||||
|
||||
-Executes the xentop command, which provides real time monitoring of
|
||||
+Executes the B<xentop> command, which provides real time monitoring of
|
||||
domains. Xentop is a curses interface, and reasonably self
|
||||
explanatory.
|
||||
|
||||
@@ -508,13 +514,41 @@ explanatory.
|
||||
=head1 SCHEDULER SUBCOMMANDS
|
||||
|
||||
Xen ships with a number of domain schedulers, which can be set at boot
|
||||
-time with the I<sched=> parameter on the Xen command line. By
|
||||
-default I<sedf> is used for scheduling.
|
||||
+time with the B<sched=> parameter on the Xen command line. By
|
||||
+default B<credit> is used for scheduling.
|
||||
|
||||
FIXME: we really need a scheduler expert to write up this section.
|
||||
|
||||
=over 4
|
||||
|
||||
+=item B<sched-credit> [ B<-d> I<domain-id> [ B<-w>[B<=>I<WEIGHT>] | B<-c>[B<=>I<CAP>] ] ]
|
||||
+
|
||||
+Set credit scheduler parameters. The credit scheduler is a
|
||||
+proportional fair share CPU scheduler built from the ground up to be
|
||||
+work conserving on SMP hosts.
|
||||
+
|
||||
+Each domain (including Domain0) is assigned a weight and a cap.
|
||||
+
|
||||
+B<PARAMETERS>
|
||||
+
|
||||
+=over 4
|
||||
+
|
||||
+=item I<WEIGHT>
|
||||
+
|
||||
+A domain with a weight of 512 will get twice as much CPU as a domain
|
||||
+with a weight of 256 on a contended host. Legal weights range from 1
|
||||
+to 65535 and the default is 256.
|
||||
+
|
||||
+=item I<CAP>
|
||||
+
|
||||
+The cap optionally fixes the maximum amount of CPU a domain will be
|
||||
+able to consume, even if the host system has idle CPU cycles. The cap
|
||||
+is expressed in percentage of one physical CPU: 100 is 1 physical CPU,
|
||||
+50 is half a CPU, 400 is 4 CPUs, etc. The default, 0, means there is
|
||||
+no upper cap.
|
||||
+
|
||||
+=back
|
||||
+
|
||||
=item B<sched-sedf> I<period> I<slice> I<latency-hint> I<extratime> I<weight>
|
||||
|
||||
Set Simple EDF (Earliest Deadline First) scheduler parameters. This
|
||||
@@ -546,7 +580,7 @@ Flag for allowing domain to run in extra
|
||||
|
||||
=item I<weight>
|
||||
|
||||
-Another way of setting cpu slice.
|
||||
+Another way of setting CPU slice.
|
||||
|
||||
=back
|
||||
|
||||
@@ -591,7 +625,7 @@ event.
|
||||
|
||||
=over 4
|
||||
|
||||
-=item B<block-attach> I<domain-id> I<be-dev> I<fe-dev> I<mode> I<[bedomain-id]>
|
||||
+=item B<block-attach> I<domain-id> I<be-dev> I<fe-dev> I<mode> [I<bedomain-id>]
|
||||
|
||||
Create a new virtual block device. This will trigger a hotplug event
|
||||
for the guest.
|
||||
@@ -619,7 +653,7 @@ devices, or by device id, such as 0x1400
|
||||
=item I<mode>
|
||||
|
||||
The access mode for the device from the guest domain. Supported modes
|
||||
-are I<w> (read/write) or I<r> (read-only).
|
||||
+are B<w> (read/write) or B<r> (read-only).
|
||||
|
||||
=item I<bedomain-id>
|
||||
|
||||
@@ -635,62 +669,65 @@ B<EXAMPLES>
|
||||
|
||||
xm block-attach guestdomain file://path/to/dsl-2.0RC2.iso /dev/hdc ro
|
||||
|
||||
-This will mount the dsl iso as /dev/hdc in the guestdomain as a read
|
||||
-only device. This will probably not be detected as a cdrom by the
|
||||
+This will mount the dsl ISO as /dev/hdc in the guestdomain as a read
|
||||
+only device. This will probably not be detected as a CD-ROM by the
|
||||
guest, but mounting /dev/hdc manually will work.
|
||||
|
||||
=back
|
||||
|
||||
-=item B<block-detach> I<domain-id> I<devid>
|
||||
+=item B<block-detach> I<domain-id> I<devid> [B<--force>]
|
||||
|
||||
-Destroy a domain's virtual block device. devid B<must> be the device
|
||||
-id given to the device by domain 0. You will need to run I<xm
|
||||
-block-list> to determine that number.
|
||||
+Detach a domain's virtual block device. I<devid> may be the symbolic
|
||||
+name or the numeric device id given to the device by domain 0. You
|
||||
+will need to run B<xm block-list> to determine that number.
|
||||
+
|
||||
+Detaching the device requires the cooperation of the domain. If the
|
||||
+domain fails to release the device (perhaps because the domain is hung
|
||||
+or is still using the device), the detach will fail. The B<--force>
|
||||
+parameter will forcefully detach the device, but may cause IO errors
|
||||
+in the domain.
|
||||
|
||||
-FIXME: this is currently B<broken>. Even though a block device is
|
||||
-removed from domU, it appears to still be allocated in the domain 0.
|
||||
-
|
||||
-=item B<block-list> I<[-l|--long]> I<domain-id>
|
||||
+=item B<block-list> [B<-l>|B<--long>] I<domain-id>
|
||||
|
||||
List virtual block devices for a domain. The returned output is
|
||||
-formatted as a list or as an S-Expression if the '--long' option was given.
|
||||
+formatted as a list or as an S-Expression if the B<--long> option was given.
|
||||
|
||||
=head2 NETWORK DEVICES
|
||||
|
||||
-=item B<network-attach> I<domain-id> I<[script=scriptname]> I<[ip=ipaddr]>
|
||||
-I<[mac=macaddr]> I<[bridge=bridge-name]> I<[backend=bedomain-id]>
|
||||
+=item B<network-attach> I<domain-id> [B<script=>I<scriptname>] [B<ip=>I<ipaddr>]
|
||||
+[B<mac=>I<macaddr>] [B<bridge=>I<bridge-name>] [B<backend=>I<bedomain-id>]
|
||||
|
||||
-Creates a new network device in the domain specified by domain-id. It
|
||||
+Creates a new network device in the domain specified by I<domain-id>. It
|
||||
takes the following optional options:
|
||||
|
||||
B<OPTIONS>
|
||||
|
||||
=over 4
|
||||
|
||||
-=item I<script=scriptname>
|
||||
+=item B<script=>I<scriptname>
|
||||
|
||||
Use the specified script name to bring up the network. Defaults to
|
||||
-the default setting in xend-config.sxp for I<vif-script>.
|
||||
+the default setting in xend-config.sxp for B<vif-script>.
|
||||
|
||||
-=item I<ip=ipaddr>
|
||||
+=item B<ip=>I<ipaddr>
|
||||
|
||||
Passes the specified IP Address to the adapter on creation.
|
||||
|
||||
FIXME: this currently appears to be B<broken>. I'm not sure under what
|
||||
circumstances this should actually work.
|
||||
|
||||
-=item I<mac=macaddr>
|
||||
+=item B<mac=>I<macaddr>
|
||||
|
||||
The MAC address that the domain will see on its Ethernet device. If
|
||||
the device is not specified it will be randomly generated with the
|
||||
00:16:3e vendor id prefix.
|
||||
|
||||
-=item I<bridge=bridge-name>
|
||||
+=item B<bridge=>I<bridge-name>
|
||||
|
||||
The name of the bridge to attach the vif to, in case you have more
|
||||
-than one. This defaults to
|
||||
+than one. This defaults to xenbr0.
|
||||
|
||||
-=item I<backend=bedomain-id>
|
||||
+=item B<backend=>I<bedomain-id>
|
||||
|
||||
The backend domain id. By default this is domain 0.
|
||||
|
||||
@@ -705,17 +742,17 @@ I<devid> is the virtual interface device
|
||||
FIXME: this is currently B<broken>. Network devices aren't completely
|
||||
removed from domain 0.
|
||||
|
||||
-=item B<network-list> I<[-l|--long]> I<domain-id>
|
||||
+=item B<network-list> [B<-l>|B<--long>]> I<domain-id>
|
||||
|
||||
List virtual network interfaces for a domain. The returned output is
|
||||
-formatted as a list or as an S-Expression if the '--long' option was given.
|
||||
+formatted as a list or as an S-Expression if the B<--long> option was given.
|
||||
|
||||
=head2 VIRTUAL TPM DEVICES
|
||||
|
||||
-=item B<vtpm-list> I<[-l|--long]> I<domain-id>
|
||||
+=item B<vtpm-list> [B<-l>|B<--long>] I<domain-id>
|
||||
|
||||
Show the virtual TPM device for a domain. The returned output is
|
||||
-formatted as a list or as an S-Expression if the '--long' option was given.
|
||||
+formatted as a list or as an S-Expression if the B<--long> option was given.
|
||||
|
||||
=back
|
||||
|
||||
@@ -728,7 +765,7 @@ out entirely.
|
||||
|
||||
=over 4
|
||||
|
||||
-=item B<vnet-list> I<[-l|--long]>
|
||||
+=item B<vnet-list> [B<-l>|B<--long>]
|
||||
|
||||
List vnets.
|
||||
|
||||
@@ -762,7 +799,7 @@ subcommands described below. Currently,
|
||||
interpret labels:
|
||||
|
||||
(1) Simple Type Enforcement: Labels are interpreted to decide access
|
||||
-of domains to comunication means and virtual or physical
|
||||
+of domains to communication means and virtual or physical
|
||||
resources. Communication between domains as well as access to
|
||||
resources are forbidden by default and can only take place if they are
|
||||
explicitly allowed by the security policy. The proper assignment of
|
||||
@@ -796,8 +833,8 @@ time with the B<cfgbootpolicy> subcomman
|
||||
=over 4
|
||||
|
||||
I<policy> is a dot-separated list of names. The last part is the file
|
||||
-name pre-fix for the policy xml file. The preceding name parts are
|
||||
-translated into the local path pointing to the policy xml file
|
||||
+name pre-fix for the policy XML file. The preceding name parts are
|
||||
+translated into the local path pointing to the policy XML file
|
||||
relative to the global policy root directory
|
||||
(/etc/xen/acm-security/policies). For example,
|
||||
example.chwall_ste.client_v1 denotes the policy file
|
||||
@@ -823,16 +860,16 @@ I<boot title> parameter to specify a uni
|
||||
|
||||
Prints the current security policy state information of Xen.
|
||||
|
||||
-=item B<labels> [I<policy>] [I<type>=dom|res|any]
|
||||
+=item B<labels> [I<policy>] [B<type=dom>|B<res>|B<any>]
|
||||
|
||||
Lists all labels of a I<type> (domain, resource, or both) that are
|
||||
defined in the I<policy>. Unless specified, the default I<policy> is
|
||||
the currently enforced access control policy. The default for I<type>
|
||||
is 'dom'. The labels are arranged in alphabetical order.
|
||||
|
||||
-=item B<addlabel> I<label> dom I<configfile> [I<policy>]
|
||||
+=item B<addlabel> I<label> B<dom> I<configfile> [I<policy>]
|
||||
|
||||
-=item B<addlabel> I<label> res I<resource> [I<policy>]
|
||||
+=item B<addlabel> I<label> B<res> I<resource> [I<policy>]
|
||||
|
||||
Adds the security label with name I<label> to a domain
|
||||
I<configfile> (dom) or to the global resource label file for the
|
||||
@@ -841,17 +878,17 @@ currently enforced access control policy
|
||||
verifies that the I<policy> definition supports the specified I<label>
|
||||
name.
|
||||
|
||||
-=item B<rmlabel> dom I<configfile>
|
||||
+=item B<rmlabel> B<dom> I<configfile>
|
||||
|
||||
-=item B<rmlabel> res I<resource>
|
||||
+=item B<rmlabel> B<res> I<resource>
|
||||
|
||||
-Works the same as the I<addlabel> command (above), except that this
|
||||
+Works the same as the B<addlabel> command (above), except that this
|
||||
command will remove the label from the domain I<configfile> (dom) or
|
||||
the global resource label file (res).
|
||||
|
||||
-=item B<getlabel> dom I<configfile>
|
||||
+=item B<getlabel> B<dom> I<configfile>
|
||||
|
||||
-=item B<getlabel> res I<resource>
|
||||
+=item B<getlabel> B<res> I<resource>
|
||||
|
||||
Shows the label for the given I<configfile> or I<resource>
|
||||
|
||||
@@ -881,7 +918,7 @@ Then recompile and install xen and the s
|
||||
|
||||
cd xen_source_dir/xen; make clean; make; cp xen.gz /boot;
|
||||
cd xen_source_dir/tools/security; make install;
|
||||
- reboot into xen
|
||||
+ reboot into Xen
|
||||
|
||||
=back
|
||||
|
||||
@@ -944,10 +981,10 @@ B<ATTACHING A SECURITY LABEL TO A DOMAIN
|
||||
|
||||
=over 4
|
||||
|
||||
-The I<addlabel> subcommand can attach a security label to a domain
|
||||
+The B<addlabel> subcommand can attach a security label to a domain
|
||||
configuration file, here a HomeBanking label. The example policy
|
||||
ensures that this domain does not share information with other
|
||||
-non-hombanking user domains (i.e., domains labeled as dom_Fun or
|
||||
+non-homebanking user domains (i.e., domains labeled as dom_Fun or
|
||||
dom_Boinc) and that it will not run simultaneously with domains
|
||||
labeled as dom_Fun.
|
||||
|
||||
@@ -958,7 +995,7 @@ probably just a browser environment for
|
||||
xm addlabel dom_HomeBanking dom myconfig.xm
|
||||
|
||||
The very simple configuration file might now look as printed
|
||||
-below. The I<addlabel> subcommand added the B<access_control> entry at
|
||||
+below. The B<addlabel> subcommand added the B<access_control> entry at
|
||||
the end of the file, consisting of a label name and the policy that
|
||||
specifies this label name:
|
||||
|
||||
@@ -986,7 +1023,7 @@ B<ATTACHING A SECURITY LABEL TO A RESOUR
|
||||
|
||||
=over 4
|
||||
|
||||
-The I<addlabel> subcommand can also be used to attach a security
|
||||
+The B<addlabel> subcommand can also be used to attach a security
|
||||
label to a resource. Following the home banking example from above,
|
||||
we can label a disk resource (e.g., a physical partition or a file)
|
||||
to make it accessible to the home banking domain. The example policy
|
||||
@@ -1002,7 +1039,7 @@ attaches this disk to the domain at boot
|
||||
disk = [ 'phy:hda6,sda2,w' ]
|
||||
|
||||
Alternatively, the resource can be attached after booting the domain
|
||||
-by using the I<block-attach> subcommand.
|
||||
+by using the B<block-attach> subcommand.
|
||||
|
||||
xm block-attach homebanking phy:hda6 sda2 w
|
||||
|
||||
@@ -1010,7 +1047,7 @@ Note that labeled resources cannot be us
|
||||
off. Any attempt to use labeled resources with security turned off
|
||||
will result in a failure with a corresponding error message. The
|
||||
solution is to enable security or, if security is no longer desired,
|
||||
-to remove the resource label using the I<rmlabel> subcommand.
|
||||
+to remove the resource label using the B<rmlabel> subcommand.
|
||||
|
||||
=back
|
||||
|
||||
@@ -1048,7 +1085,7 @@ B<POLICY REPRESENTATIONS>
|
||||
=over 4
|
||||
|
||||
We distinguish three representations of the Xen access control policy:
|
||||
-the I<source XML> version, its I<binary> counterpart, and a I<mapping>
|
||||
+the source XML version, its binary counterpart, and a mapping
|
||||
representation that enables the tools to deterministically translate
|
||||
back and forth between label names of the XML policy and label
|
||||
identifiers of the binary policy. All three versions must be kept
|
||||
@@ -1075,8 +1112,6 @@ their binary identifiers (ssidrefs) used
|
||||
|
||||
=back
|
||||
|
||||
-=head1 EXAMPLES
|
||||
-
|
||||
=head1 SEE ALSO
|
||||
|
||||
B<xmdomain.cfg>(5), B<xentop>(1)
|
396
network-multi
396
network-multi
@ -1,15 +1,16 @@
|
||||
#!/bin/sh
|
||||
#============================================================================
|
||||
# network-multi
|
||||
# network-multi_net
|
||||
#
|
||||
# Version = 1.0.0
|
||||
# Date = 2007-05-12
|
||||
# Version = 1.1.0
|
||||
# Date = 2007-06-08
|
||||
#
|
||||
# Maintainer(s) = Ron Terry - ron (at) pronetworkconsulting (dot) com
|
||||
# Charles Coffing -
|
||||
#
|
||||
# The latest version can be found at:
|
||||
#
|
||||
# http://pronetworkconsulting.com/linux/scripts/network-multi.html
|
||||
# http://pronetworkconsulting.com/linux/scripts/network-multi_net.html
|
||||
#
|
||||
# Description:
|
||||
#
|
||||
@ -24,7 +25,7 @@
|
||||
# -This is the traditional type of network bridge
|
||||
# created in xen by the network-bridge script.
|
||||
#
|
||||
# host bridges: -Bridges that contain only a virtual network
|
||||
# local bridges: -Bridges that contain only a virtual network
|
||||
# device (vethX) from Dom0.
|
||||
# -These bridges can be configured in the
|
||||
# following ways:
|
||||
@ -55,8 +56,7 @@
|
||||
# -These can be used to allow VMs in DomUs to
|
||||
# communicate only with other DomUs and not Dom0.
|
||||
#
|
||||
# This script accepts the (start|stop|status) parameters. If not specified
|
||||
# it sends the start parameter.
|
||||
# This script accepts the (start|stop|restart|status) parameters.
|
||||
#
|
||||
# This script depends on an unmodified version of the network-bridge script
|
||||
# because it uses it to create the traditional bridges. It passes the
|
||||
@ -65,7 +65,10 @@
|
||||
# devices so that they may change the network configuration of the Physical
|
||||
# network interfaces.
|
||||
#
|
||||
# Host bridges do not need to be disassembled to change the IP address
|
||||
# This script requires that the vif-bridge script be used as the vif
|
||||
# creation script (as opposed to vif-nat/vif-route).
|
||||
#
|
||||
# Local bridges do not need to be disassembled to change the IP address
|
||||
# of the virtual interfaces because they do not contain interfaces that
|
||||
# have been renamed like the traditional briges (created by the
|
||||
# network-bridge script) do. The stop parameter does however cause them
|
||||
@ -81,18 +84,18 @@
|
||||
# configured to be connected to traditional bridges and only attempt to
|
||||
# create bridges on the ones that are present and up. It will also test
|
||||
# for the presence of virtual interfaces configured to be connected to
|
||||
# host bridges and only create bridges for the ones that exist and
|
||||
# local bridges and only create bridges for the ones that exist and
|
||||
# are not already connected to an existing bridge.
|
||||
#
|
||||
# Edit the NETDEV_LIST variable to define which physical interfaces
|
||||
# Edit the BRIDGE_NETDEV_LIST variable to define which physical interfaces
|
||||
# you wish to create traditional bridges on. The default is to create a
|
||||
# traditional bridge on only the first interface (eth0).
|
||||
#
|
||||
# Edit the HOST_BRIDGE_LIST variable to define which virtual interfaces
|
||||
# you wish to create host bridges on. The default is the 3rd and 4th
|
||||
# virtual interfaces (veth2, veth3). The first host bridge (on veth2) is
|
||||
# configured as a NAT network and the second host bridge (on veth3) is
|
||||
# configured as a hostonly network.
|
||||
# Edit the LOCAL_BRIDGE_LIST variable to define which virtual interfaces
|
||||
# you wish to create local bridges on. The default is the 3rd and 4th
|
||||
# virtual interfaces (veth2, veth3). The first local bridge (on veth2)
|
||||
# is configured as a NAT network and the second host bridge (on veth3)
|
||||
# is configured as a hostonly network.
|
||||
#
|
||||
# Edit the EMPTY_BRIDGE_LIST variable to define which empty bridges to
|
||||
# create. This list should contain the numbers of the bridges to
|
||||
@ -101,25 +104,25 @@
|
||||
# To enable this script edit the network-script field in the
|
||||
# /etc/xen/xen-config.sxp file.
|
||||
#
|
||||
# Example: (network-script network-multi)
|
||||
# Example: (network-script network-multi_net)
|
||||
#
|
||||
# Depends on: /etc/xen/scripts/xen-network-common.sh
|
||||
# /etc/xen/scripts/network-bridge
|
||||
#
|
||||
# Can use: /etc/sysconfig/dom0config
|
||||
# Config file: /etc/sysconfig/xendconfig
|
||||
#
|
||||
# Usage: network-multi (start|stop|status)
|
||||
# Usage: network-multi_net (start|stop|restart|status)
|
||||
#
|
||||
# Vars:
|
||||
#
|
||||
# SCRIPT_PATH -Path to the directory conaining the xen network-bridge
|
||||
# script (typically /etc/xen/scripts)
|
||||
# SCRIPT_PATH -Path to the directory conaining the xen network-bridge
|
||||
# script (typically /etc/xen/scripts)
|
||||
#
|
||||
# NETDEV_LIST -Space delimited list of physical network devices to
|
||||
# create traditional bridges on
|
||||
# BRIDGE_NETDEV_LIST -Space delimited list of physical network devices to
|
||||
# create traditional bridges on
|
||||
#
|
||||
# HOST_BRIDGE_LIST -Space delimited list of virtual network devices to
|
||||
# create host bridges on using the following format:
|
||||
# LOCAL_BRIDGE_LIST -Space delimited list of virtual network devices to
|
||||
# create local bridges on using the following format:
|
||||
#
|
||||
# <virtual network device>,<mac address>,<IP address/CIDR NetMask>,<nat|hostonly|routed>
|
||||
#
|
||||
@ -127,13 +130,13 @@
|
||||
#
|
||||
# "veth2,00:16:3E:01:00:02,172.22.0.1/16,nat veth3,00:16:3E:01:00:03,172.23.0.1/16,hostonly"
|
||||
#
|
||||
# EMPTY_BRIDGE_LIST -Space delimited list of bridge numbers to create as
|
||||
# empty bridges.
|
||||
# EMPTY_BRIDGE_LIST -Space delimited list of bridge numbers to create as
|
||||
# empty bridges.
|
||||
#
|
||||
# BRIDGE_NAME -Name of bridge to create (example: xenbr)
|
||||
# BRIDGE_NAME -Name of bridge to create (example: xenbr)
|
||||
#
|
||||
# NAT_EXTIF -Network interface to use as the external interface for
|
||||
# NATed and Routed networks
|
||||
# NAT_EXTERNAL_INTERFACE -Network interface to use as the external interface
|
||||
# for NATed and Routed networks
|
||||
#
|
||||
#============================================================================
|
||||
|
||||
@ -141,29 +144,26 @@
|
||||
|
||||
. /etc/xen/scripts/xen-network-common.sh
|
||||
|
||||
# If you do not source the /etc/sysconfig/xend file, uncomment the variables
|
||||
# below.
|
||||
# Source the configuration File
|
||||
|
||||
. /etc/sysconfig/xend
|
||||
. /etc/sysconfig/xendconfig
|
||||
|
||||
#NETDEV_LIST="eth0 eth1 eth2"
|
||||
#HOST_BRIDGE_LIST="veth2,00:16:3E:01:00:02,172.22.0.1/16,nat veth3,00:16:3E:01:00:03,172.23.0.1/16,hostonly"
|
||||
#EMPTY_BRIDGE_LIST="4 5 6 7"
|
||||
#BRIDGE_NAME="xenbr"
|
||||
#SCRIPT_PATH="/etc/xen/scripts"
|
||||
#NAT_EXTIF="eth0"
|
||||
SCRIPT_PATH="/etc/xen/scripts"
|
||||
NETWORK_SAVE_PATH="/var/lib/xend/network_save"
|
||||
IPTABLES_SAVE_FILE="$NETWORK_SAVE_PATH/iptables-save"
|
||||
|
||||
#### Script Functions #####################################################
|
||||
|
||||
help() {
|
||||
echo "Usage: $0 {start|stop|status}"
|
||||
# Gives hlep 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|status)
|
||||
start|stop|restart|status)
|
||||
CMD_OPT="$1"
|
||||
;;
|
||||
*)
|
||||
@ -172,6 +172,143 @@ get_option() {
|
||||
esac
|
||||
}
|
||||
|
||||
make_save_dir() {
|
||||
# Create temporary storage directory if needed.
|
||||
if ! [ -d "$NETWORK_SAVE_PATH" ]
|
||||
then
|
||||
mkdir $NETWORK_SAVE_PATH
|
||||
fi
|
||||
}
|
||||
|
||||
manage_routing() {
|
||||
# Saves and restores the ip forward and Network Address Translation state
|
||||
# that exist before the script runs
|
||||
#
|
||||
# This function reads the start,stop parameter from the $CMD_OPT
|
||||
# variable and responds respectively.
|
||||
|
||||
case $CMD_OPT in
|
||||
start)
|
||||
#------------------------------------------------------------------
|
||||
# Determine the initial state of the ip_forward parameter
|
||||
#------------------------------------------------------------------
|
||||
case `cat /proc/sys/net/ipv4/ip_forward` in
|
||||
0)
|
||||
INIT_IP_FWD="off"
|
||||
echo "0" > $NETWORK_SAVE_PATH/init_ip_fwd_state
|
||||
;;
|
||||
1)
|
||||
INIT_IP_FWD="on"
|
||||
echo "1" > $NETWORK_SAVE_PATH/init_ip_fwd_state
|
||||
;;
|
||||
esac
|
||||
|
||||
#------------------------------------------------------------------
|
||||
# Determine if we need to enable ip_forward
|
||||
#------------------------------------------------------------------
|
||||
if echo $LOCAL_BRIDGE_LIST | grep -qE "(nat|NAT|route|ROUTE)"
|
||||
then
|
||||
IP_FWD="on"
|
||||
echo ""
|
||||
echo "============================================================"
|
||||
echo "Enabling IP Forwarding"
|
||||
echo "============================================================"
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
else
|
||||
IP_FWD="off"
|
||||
echo ""
|
||||
echo "============================================================"
|
||||
echo "Disabling IP Forwarding"
|
||||
echo "============================================================"
|
||||
echo 0 > /proc/sys/net/ipv4/ip_forward
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------
|
||||
# Determine if we need to enable NAT
|
||||
#------------------------------------------------------------------
|
||||
if echo $LOCAL_BRIDGE_LIST | grep -qE "(nat|NAT)"
|
||||
then
|
||||
echo ""
|
||||
echo "============================================================"
|
||||
echo "Enabling Network Adress Translation"
|
||||
echo "============================================================"
|
||||
iptables -t nat -A POSTROUTING -o $NAT_EXTERNAL_INTERFACE -j MASQUERADE
|
||||
sysctl -q -w net.bridge.bridge-nf-call-iptables="0"
|
||||
NAT_DONE="yes"
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
#------------------------------------------------------------------
|
||||
# Set the ip_forward value back to its original state
|
||||
#------------------------------------------------------------------
|
||||
echo ""
|
||||
echo "============================================================"
|
||||
echo "Restoring IP Forwarding to its original state"
|
||||
echo "============================================================"
|
||||
case `cat $NETWORK_SAVE_PATH/init_ip_fwd_state` in
|
||||
0)
|
||||
echo "ip_forward = 0"
|
||||
echo "0" > /proc/sys/net/ipv4/ip_forward
|
||||
;;
|
||||
1)
|
||||
echo "ip_forward = 0"
|
||||
echo "1" > /proc/sys/net/ipv4/ip_forward
|
||||
;;
|
||||
*)
|
||||
echo "Original state unknown. Using default value."
|
||||
echo "ip_forward = 0"
|
||||
echo "0" > /proc/sys/net/ipv4/ip_forward
|
||||
;;
|
||||
esac
|
||||
|
||||
#------------------------------------------------------------------
|
||||
# Clean up init_ip_fwd_state file
|
||||
#------------------------------------------------------------------
|
||||
rm $NETWORK_SAVE_PATH/init_ip_fwd_state
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
manage_iptables() {
|
||||
# Saves and restores the iptables rules that exist before the script runs
|
||||
#
|
||||
# This function reads the start,stop parameter from the $CMD_OPT
|
||||
# variable and responds respectively.
|
||||
|
||||
case $CMD_OPT in
|
||||
start)
|
||||
echo ""
|
||||
echo "============================================================"
|
||||
echo "Saving iptables rules"
|
||||
echo "============================================================"
|
||||
#iptables-save > $IPTABLES_SAVE_FILE
|
||||
for TABLE in `iptables-save |grep '*'|cut -d '*' -f 2`
|
||||
do
|
||||
echo "Saving table: $TABLE"
|
||||
iptables-save -t $TABLE > $IPTABLES_SAVE_FILE@$TABLE
|
||||
echo "Flushing table: $TABLE"
|
||||
iptables -F -t $TABLE
|
||||
echo "-----------------------"
|
||||
done
|
||||
;;
|
||||
stop)
|
||||
echo ""
|
||||
echo "============================================================"
|
||||
echo "Restoring iptables rules"
|
||||
echo "============================================================"
|
||||
for TABLE in `ls $IPTABLES_SAVE_FILE*|cut -d "@" -f 2`
|
||||
do
|
||||
echo "Restoring table: $TABLE"
|
||||
iptables-restore < $IPTABLES_SAVE_FILE@$TABLE
|
||||
rm $IPTABLES_SAVE_FILE@$TABLE
|
||||
echo "-----------------------"
|
||||
done
|
||||
#iptables-restore < $IPTABLES_SAVE_FILE
|
||||
#rm $IPTABLES_SAVE_FILE
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
setup_host_interface() {
|
||||
# Configure the MAC and IP address of a virtual device.
|
||||
#
|
||||
@ -210,13 +347,13 @@ setup_host_interface() {
|
||||
esac
|
||||
}
|
||||
|
||||
create_bridges() {
|
||||
create_traditional_bridges() {
|
||||
# Uses the network-bridge script to create bridges on physical devices in Dom0.
|
||||
#
|
||||
# This fuction passes the start,stop,status parameters on to the network-bridge
|
||||
# script.
|
||||
|
||||
for NETDEVICE in $NETDEV_LIST
|
||||
for NETDEVICE in $BRIDGE_NETDEV_LIST
|
||||
do
|
||||
local BRIDGE_NUM=${NETDEVICE##${NETDEVICE%%[0-9]*}}
|
||||
|
||||
@ -231,61 +368,37 @@ create_bridges() {
|
||||
echo ""
|
||||
$SCRIPT_PATH/network-bridge $CMD_OPT netdev=$NETDEVICE bridge=$BRIDGE_NAME$BRIDGE_NUM vifnum=$BRIDGE_NUM
|
||||
echo ""
|
||||
echo "------------------------------------------------------------"
|
||||
else
|
||||
echo " Physical Interface $NETDEVICE is not up. Skipping $BRIDGE_NAME$BRIDGE_NUM"
|
||||
echo "------------------------------------------------------------"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
create_host_bridges() {
|
||||
create_local_bridges() {
|
||||
# Creates bridges attached to virtual devices in Dom0 and enables nat or routing
|
||||
# on the bridges if specified.
|
||||
#
|
||||
# This fuction reads the start,stop,status parameter from the $CMD_OPT variable
|
||||
# and responds respectively.
|
||||
|
||||
for IFACE in $HOST_BRIDGE_LIST
|
||||
for IFACE in $LOCAL_BRIDGE_LIST
|
||||
do
|
||||
|
||||
|
||||
# Set local function variables
|
||||
local DEV=`echo $IFACE|cut -d "," -f 1`
|
||||
local MAC=`echo $IFACE|cut -d "," -f 2`
|
||||
local IPADDR=`echo $IFACE|cut -d "," -f 3`
|
||||
|
||||
local BRIDGE_TYPE=`echo $IFACE|cut -d "," -f 4`
|
||||
local NAT_GW_IP=`echo $IFACE|cut -d "," -f 3|cut -d "/" -f 1`
|
||||
#local NAT_EXTIF=`echo $NETDEV_LIST|cut -d " " -f 1`
|
||||
local NAT_INTIF=`echo $IFACE|cut -d "," -f 1`
|
||||
|
||||
local BRIDGE_NUM=${NAT_INTIF##${NAT_INTIF%%[0-9]*}}
|
||||
local BR_NAME=$BRIDGE_NAME$BRIDGE_NUM
|
||||
local VIF=vif0.$BRIDGE_NUM
|
||||
|
||||
# Determine the initial state of the ip_forward parameter
|
||||
#####################################################################
|
||||
# FIX ME: We need to make this persistant.
|
||||
# Should we write it out to a file?
|
||||
#####################################################################
|
||||
if [ `cat /proc/sys/net/ipv4/ip_forward` -eq "0" ]
|
||||
then
|
||||
local INIT_IP_FWD="off"
|
||||
else
|
||||
local INIT_IP_FWD="on"
|
||||
fi
|
||||
|
||||
# Determine if we need to enable ip_forward
|
||||
if echo $HOST_BRIDGE_LIST | grep -qE "(nat|NAT|route|ROUTE)"
|
||||
then
|
||||
local IP_FWD="on"
|
||||
else
|
||||
local IP_FWD="off"
|
||||
fi
|
||||
|
||||
case $CMD_OPT in
|
||||
start)
|
||||
if ! brctl show | grep -qw $DEV && /sbin/ip address show $DEV
|
||||
if ! brctl show | grep -qw $DEV && /sbin/ip address show $DEV > /dev/null
|
||||
then
|
||||
#------------------------------------------------------------------
|
||||
# Create the bridge
|
||||
@ -298,10 +411,10 @@ create_host_bridges() {
|
||||
echo " using- Virtual Interface: $VIF"
|
||||
echo " Virtual Device: $DEV"
|
||||
|
||||
create_bridge $BR_NAME
|
||||
setup_bridge_port $VIF
|
||||
add_to_bridge $BR_NAME $VIF
|
||||
setup_host_interface $DEV $MAC $IPADDR
|
||||
create_bridge $BR_NAME > /dev/null 2>&1
|
||||
setup_bridge_port $VIF > /dev/null 2>&1
|
||||
add_to_bridge $BR_NAME $VIF > /dev/null 2>&1
|
||||
setup_host_interface $DEV $MAC $IPADDR > /dev/null 2>&1
|
||||
|
||||
#------------------------------------------------------------------
|
||||
# Set up the bridge as a hostonly / NAT / Routed network
|
||||
@ -309,27 +422,17 @@ create_host_bridges() {
|
||||
case $BRIDGE_TYPE in
|
||||
NAT|nat) # Set up the bridge as NATed network
|
||||
echo " Gateway: $NAT_GW_IP"
|
||||
echo " External Interface: $NAT_EXTIF"
|
||||
if ! [ "$NAT_DONE" = "yes" ]
|
||||
then
|
||||
if [ "$IP_FWD" = "on" ]
|
||||
then
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
IP_FWD="done"
|
||||
fi
|
||||
iptables -t nat -A POSTROUTING -o $NAT_EXTIF -j MASQUERADE
|
||||
sysctl -q -w net.bridge.bridge-nf-call-iptables="0"
|
||||
NAT_DONE="yes"
|
||||
fi
|
||||
echo " External Interface: $NAT_EXTERNAL_INTERFACE"
|
||||
#if ! [ "$NAT_DONE" = "yes" ]
|
||||
#then
|
||||
# iptables -t nat -A POSTROUTING -o $NAT_EXTERNAL_INTERFACE -j MASQUERADE
|
||||
# sysctl -q -w net.bridge.bridge-nf-call-iptables="0"
|
||||
# NAT_DONE="yes"
|
||||
#fi
|
||||
;;
|
||||
ROUTE|route) # Set up the bridge as Routed network
|
||||
echo " Gateway: $NAT_GW_IP"
|
||||
echo " External Interface: $NAT_EXTIF"
|
||||
if [ "$IP_FWD" = "off" ]
|
||||
then
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
IP_FWD="on"
|
||||
fi
|
||||
echo " External Interface: $NAT_EXTERNAL_INTERFACE"
|
||||
;;
|
||||
HOSTONLY|hostonly) # Set up the bridge as hostonly network
|
||||
if [ "$IP_FWD" = "on" ]
|
||||
@ -339,14 +442,12 @@ create_host_bridges() {
|
||||
;;
|
||||
esac
|
||||
echo "============================================================"
|
||||
echo "------------------------------------------------------------"
|
||||
else
|
||||
#------------------------------------------------------------------
|
||||
# Skip this bridge
|
||||
#------------------------------------------------------------------
|
||||
echo " Virtual Interface $DEV is already attached to a bridge or it does not exist."
|
||||
echo " Skipping $BR_NAME"
|
||||
echo "------------------------------------------------------------"
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
@ -366,62 +467,32 @@ create_host_bridges() {
|
||||
#------------------------------------------------------------------
|
||||
case $BRIDGE_TYPE in
|
||||
NAT|nat)
|
||||
#####################################################################
|
||||
# FIX ME: We need to set the ip_forward value back to the state it
|
||||
# was in before the Network script ran.
|
||||
# How do we determine that state?
|
||||
#####################################################################
|
||||
|
||||
# We could use this if we set the INIT_IP_FWD value from some
|
||||
# persistant source.
|
||||
#----------------------------------------------------------------------
|
||||
#if [ "$INIT_IP_FWD" = "off" ]
|
||||
#then
|
||||
# echo 0 > /proc/sys/net/ipv4/ip_forward
|
||||
#fi
|
||||
|
||||
# This would wack all nat rules. What if they were set before we
|
||||
# configured Xen networking?
|
||||
#----------------------------------------------------------------------
|
||||
#if ! [ "$NAT_REMOVED" = "yes" ]
|
||||
#then
|
||||
# # Remove all nat iptables rules (host bridge nat PREROUTING DROP, etc.)
|
||||
# iptables -F -t nat
|
||||
# NAT_REMOVED="yes"
|
||||
#fi
|
||||
|
||||
# Turn off routing and clean out the bridge specific nat iptables rule
|
||||
echo 0 > /proc/sys/net/ipv4/ip_forward
|
||||
iptables -t nat -D POSTROUTING -o $NAT_EXTIF -j MASQUERADE
|
||||
sysctl -q -w net.bridge.bridge-nf-call-iptables="1"
|
||||
## Clean out the bridge specific nat iptables rule
|
||||
#iptables -t nat -D POSTROUTING -o $NAT_EXTERNAL_INTERFACE -j MASQUERADE
|
||||
#sysctl -q -w net.bridge.bridge-nf-call-iptables="1"
|
||||
;;
|
||||
HOSTONLY|hostonly)
|
||||
|
||||
# Clean out the bridge specific nat iptables rule
|
||||
iptables -t nat -D PREROUTING -i $NAT_INTIF -j DROP
|
||||
;;
|
||||
ROUTE|route)
|
||||
#####################################################################
|
||||
# FIX ME: We need to set the ip_forward value back to the state it
|
||||
# was in before the Network script ran.
|
||||
# How do we determine that state?
|
||||
#####################################################################
|
||||
|
||||
# Turn off routing
|
||||
echo 0 > /proc/sys/net/ipv4/ip_forward
|
||||
#echo 0 > /proc/sys/net/ipv4/ip_forward
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "============================================================"
|
||||
|
||||
#------------------------------------------------------------------
|
||||
# Then unconfigure the veth
|
||||
#------------------------------------------------------------------
|
||||
setup_host_interface $DEV $MAC $IPADDR
|
||||
setup_host_interface $DEV $MAC $IPADDR > /dev/null 2>&1
|
||||
|
||||
#------------------------------------------------------------------
|
||||
# remove vif from the bridge
|
||||
#------------------------------------------------------------------
|
||||
brctl delif $BR_NAME $VIF
|
||||
|
||||
|
||||
#------------------------------------------------------------------
|
||||
# unconfigure the vif
|
||||
#------------------------------------------------------------------
|
||||
@ -436,8 +507,6 @@ create_host_bridges() {
|
||||
#------------------------------------------------------------------
|
||||
ip link set $BR_NAME down
|
||||
brctl delbr $BR_NAME
|
||||
|
||||
echo "------------------------------------------------------------"
|
||||
;;
|
||||
status)
|
||||
#------------------------------------------------------------------
|
||||
@ -454,8 +523,6 @@ create_host_bridges() {
|
||||
brctl show | grep -w "^$BR_NAME"
|
||||
echo ""
|
||||
ip addr show $DEV
|
||||
#echo ""
|
||||
#echo "ip_forward is set to: `cat /proc/sys/net/ipv4/ip_forward`"
|
||||
echo "============================================================"
|
||||
;;
|
||||
esac
|
||||
@ -500,11 +567,60 @@ create_empty_bridges() {
|
||||
echo "============================================================"
|
||||
}
|
||||
|
||||
#### Call Functions #######################################################
|
||||
#### Start, Stop, Status Functions ########################################
|
||||
|
||||
start_xend_network() {
|
||||
echo ""
|
||||
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||
echo " Starting the xend network environment"
|
||||
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||
make_save_dir
|
||||
manage_iptables
|
||||
create_traditional_bridges
|
||||
manage_routing
|
||||
create_local_bridges
|
||||
create_empty_bridges
|
||||
}
|
||||
|
||||
stop_xend_network() {
|
||||
echo ""
|
||||
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||
echo " Stopping the xend network environment"
|
||||
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
|
||||
create_traditional_bridges
|
||||
create_local_bridges
|
||||
create_empty_bridges
|
||||
manage_routing
|
||||
manage_iptables
|
||||
}
|
||||
|
||||
show_xend_network_status() {
|
||||
create_traditional_bridges
|
||||
create_local_bridges
|
||||
create_empty_bridges
|
||||
}
|
||||
|
||||
#### Maid Code Body #######################################################
|
||||
|
||||
get_option "$1"
|
||||
create_bridges
|
||||
create_host_bridges
|
||||
create_empty_bridges
|
||||
|
||||
case $CMD_OPT in
|
||||
start)
|
||||
start_xend_network
|
||||
;;
|
||||
stop)
|
||||
stop_xend_network
|
||||
;;
|
||||
restart)
|
||||
CMD_OPT="stop"
|
||||
stop_xend_network
|
||||
|
||||
CMD_OPT="start"
|
||||
start_xend_network
|
||||
;;
|
||||
status)
|
||||
show_xend_network_status
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
@ -1,53 +1,75 @@
|
||||
## Path: System/Virtualization
|
||||
## Description:
|
||||
## Type: list(eth0 eth1 eth2 eth3)
|
||||
## Default: "eth0"
|
||||
## Type: string(xenbr)
|
||||
## Default: "xenbr"
|
||||
## Config:
|
||||
#
|
||||
# Space delimited list of physical network
|
||||
# devices tocreate traditional bridges on
|
||||
# Name of bridge to create (xenbr0, xenbr1, etc.)
|
||||
#
|
||||
NETDEV_LIST="eth0"
|
||||
BRIDGE_NAME="xenbr"
|
||||
|
||||
## Type: list(0 1 2 3)
|
||||
## Type: list()
|
||||
## Default: "eth0"
|
||||
## Config:
|
||||
#
|
||||
# Space delimited list of physical network
|
||||
# devices to create traditional bridges on
|
||||
#
|
||||
# Example: "eth0 eth1 eth2"
|
||||
#
|
||||
# The above example would create 3 traditional bridges
|
||||
# xenbr0 on eth0, xenbr1 on eth1 and xenbr2 on eth2
|
||||
#
|
||||
BRIDGE_NETDEV_LIST="eth0"
|
||||
|
||||
## Type: list()
|
||||
## Default: ""
|
||||
## Config:
|
||||
#
|
||||
# Space delimited list of virtual network devices,mac addresses
|
||||
# and IP addresses to create local bridges on using the following format:
|
||||
#
|
||||
# <virtual network device>,<mac address>,<IP address/CIDR NetMask>,<nat|hostonly|route>
|
||||
#
|
||||
# Example: "veth2,00:16:3E:01:00:02,172.22.0.1/16,nat veth3,00:16:3E:01:00:03,172.23.0.1/16,hostonly"
|
||||
#
|
||||
# The above example would create 2 local bridged the first being a NATed network
|
||||
# and the second being a host only network
|
||||
#
|
||||
LOCAL_BRIDGE_LIST="veth2,00:16:3E:01:00:02,172.22.0.1/16,nat veth3,00:16:3E:01:00:03,172.23.0.1/16,hostonly"
|
||||
|
||||
## Type: list()
|
||||
## Default: ""
|
||||
## Config:
|
||||
#
|
||||
# Space delimited list of bridge numbers to
|
||||
# create empty bridges on.
|
||||
#
|
||||
EMPTY_BRIDGE_LIST=""
|
||||
# Example: "4 5"
|
||||
#
|
||||
# The above example would create two empty bridges named xenbr4 and xenbr5
|
||||
#
|
||||
EMPTY_BRIDGE_LIST="4"
|
||||
|
||||
## Type: string(xenbr)
|
||||
## Default: "xenbr"
|
||||
## Config:
|
||||
#
|
||||
# Name of bridge to create (example: xenbr)
|
||||
#
|
||||
BRIDGE_NAME="xenbr"
|
||||
|
||||
## Type: list(veth2,00:16:3E:01:00:02,172.22.0.1/16,nat veth3,00:16:3E:01:00:03,172.23.0.1/16,hostonly)
|
||||
## Default: ""
|
||||
## Config:
|
||||
#
|
||||
# Space delimited list of virtual network devices,mac addresses
|
||||
# and IP addresses to create host bridges on using the
|
||||
# following format:
|
||||
#
|
||||
# <virtual network device>,<mac address>,<IP address/CIDR NetMask>,<nat|hostonly|route>
|
||||
#
|
||||
HOST_BRIDGE_LIST=""
|
||||
|
||||
## Type: string(eth0)
|
||||
## Type: string(eth0,eth1,eth2,eth3)
|
||||
## Default: "eth0"
|
||||
## Config:
|
||||
#
|
||||
# Network interface to use as the external interface for NATed
|
||||
# and Routed networks
|
||||
#
|
||||
NAT_EXTIF="eth0"
|
||||
NAT_EXTERNAL_INTERFACE="eth0"
|
||||
|
||||
## Type: list(10.0.0.1 10.0.0.2)
|
||||
## 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:
|
||||
#
|
||||
@ -55,21 +77,25 @@ NAT_EXTIF="eth0"
|
||||
# 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: string(no)
|
||||
## Default: "no"
|
||||
## Type: boolean
|
||||
## Default: "false"
|
||||
## Config:
|
||||
#
|
||||
# If set to yes the xend-relocation script will attempt to
|
||||
# enable/disable vm migration on all relocation nodes.
|
||||
# If set to true the xend-relocation script will attempt to
|
||||
# enable/disable vm migration on all relocation nodes listed
|
||||
# in the RELOCATION_LIST variable.
|
||||
#
|
||||
# Note: Communication with the nodes is done via ssh so
|
||||
# pre-distributed ssh keys is recommended.
|
||||
#
|
||||
MANAGE_ALL_RELOCATION_NODES="no"
|
||||
MANAGE_ALL_RELOCATION_NODES="false"
|
||||
|
||||
## Type: string(8002)
|
||||
## Type: integer
|
||||
## Default: "8002"
|
||||
## Config:
|
||||
#
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: xen-unstable/tools/python/xen/xm/create.py
|
||||
Index: xen-3.1-testing/tools/python/xen/xm/create.py
|
||||
===================================================================
|
||||
--- xen-unstable.orig/tools/python/xen/xm/create.py
|
||||
+++ xen-unstable/tools/python/xen/xm/create.py
|
||||
--- xen-3.1-testing.orig/tools/python/xen/xm/create.py
|
||||
+++ xen-3.1-testing/tools/python/xen/xm/create.py
|
||||
@@ -67,7 +67,7 @@ gopts.opt('quiet', short='q',
|
||||
use="Quiet.")
|
||||
|
||||
@ -11,20 +11,20 @@ Index: xen-unstable/tools/python/xen/xm/create.py
|
||||
use="Search path for configuration scripts. "
|
||||
"The value of PATH is a colon-separated directory list.")
|
||||
|
||||
Index: xen-unstable/docs/man/xm.pod.1
|
||||
Index: xen-3.1-testing/docs/man/xm.pod.1
|
||||
===================================================================
|
||||
--- xen-unstable.orig/docs/man/xm.pod.1
|
||||
+++ xen-unstable/docs/man/xm.pod.1
|
||||
@@ -72,7 +72,7 @@ format, and possible options used in eit
|
||||
Name=Value combinations.
|
||||
--- xen-3.1-testing.orig/docs/man/xm.pod.1
|
||||
+++ xen-3.1-testing/docs/man/xm.pod.1
|
||||
@@ -76,7 +76,7 @@ format, and possible options used in eit
|
||||
I<name>=I<value> combinations.
|
||||
|
||||
Configfile can either be an absolute path to a file, or a relative
|
||||
I<configfile> can either be an absolute path to a file, or a relative
|
||||
-path to a file located in /etc/xen.
|
||||
+path to a file located in /etc/xen/vm.
|
||||
|
||||
Create will return B<as soon> as the domain is started. This B<does
|
||||
not> mean the guest OS in the domain has actually booted, or is
|
||||
@@ -97,7 +97,7 @@ B<EXAMPLES>
|
||||
@@ -101,7 +101,7 @@ B<EXAMPLES>
|
||||
|
||||
xm create Fedora4
|
||||
|
||||
@ -33,10 +33,10 @@ Index: xen-unstable/docs/man/xm.pod.1
|
||||
soon as it is run.
|
||||
|
||||
=item I<without config file>
|
||||
Index: xen-unstable/docs/man/xmdomain.cfg.pod.5
|
||||
Index: xen-3.1-testing/docs/man/xmdomain.cfg.pod.5
|
||||
===================================================================
|
||||
--- xen-unstable.orig/docs/man/xmdomain.cfg.pod.5
|
||||
+++ xen-unstable/docs/man/xmdomain.cfg.pod.5
|
||||
--- xen-3.1-testing.orig/docs/man/xmdomain.cfg.pod.5
|
||||
+++ xen-3.1-testing/docs/man/xmdomain.cfg.pod.5
|
||||
@@ -4,9 +4,9 @@ xmdomain.cfg - xm domain config file for
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
@ -1,12 +0,0 @@
|
||||
Index: xen-unstable/tools/Makefile
|
||||
===================================================================
|
||||
--- xen-unstable.orig/tools/Makefile
|
||||
+++ xen-unstable/tools/Makefile
|
||||
@@ -25,6 +25,7 @@ SUBDIRS-$(LIBXENAPI_BINDINGS) += libxen
|
||||
# These don't cross-compile
|
||||
ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
|
||||
SUBDIRS-$(PYTHON_TOOLS) += python
|
||||
+SUBDIRS-y += xen-vm-install
|
||||
endif
|
||||
|
||||
.PHONY: all
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e5f43dfaf099df2502edd0175866f74c86cda6de3aafbaaae695f957cf4d9227
|
||||
size 188098
|
15
xen.changes
15
xen.changes
@ -1,3 +1,18 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 20 17:48:18 MDT 2007 - jfehlig@novell.com
|
||||
|
||||
- Added upstream changesets 15273, 15274, and 15275.
|
||||
- Removed the modified 15157 patch. This patch was actually a
|
||||
consolidation of changesets 15157 and 15250. These changesets
|
||||
are now discrete patches to ease subsequent updates of Xen.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 20 15:41:21 MDT 2007 - ccoffing@novell.com
|
||||
|
||||
- Split vm-install off as a separate package.
|
||||
- Update man page.
|
||||
- Update Ron Terry's network-multi script.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 18 14:23:38 MDT 2007 - ccoffing@novell.com
|
||||
|
||||
|
60
xen.spec
60
xen.spec
@ -15,14 +15,13 @@ Name: xen
|
||||
%define xvermaj 3
|
||||
%define changeset 15042
|
||||
%define xen_build_dir xen-3.1-testing
|
||||
%define with_install 1
|
||||
%if %sles_version
|
||||
%define with_kmp 1
|
||||
%else
|
||||
# openSUSE 10.3 kernel is not yet ready...
|
||||
%define with_kmp 0
|
||||
%endif
|
||||
BuildRequires: LibVNCServer SDL-devel autoconf automake bin86 curl-devel dev86 graphviz latex2html libjpeg-devel libxml2-devel openssl openssl-devel python-devel transfig update-desktop-files
|
||||
BuildRequires: LibVNCServer SDL-devel autoconf automake bin86 curl-devel dev86 graphviz latex2html libjpeg-devel libxml2-devel openssl openssl-devel python-devel transfig
|
||||
%if %suse_version >= 1030
|
||||
BuildRequires: texlive texlive-latex
|
||||
%else
|
||||
@ -35,14 +34,13 @@ BuildRequires: glibc-32bit glibc-devel-32bit
|
||||
BuildRequires: kernel-source kernel-syms xorg-x11
|
||||
%endif
|
||||
Version: 3.1.0_15042
|
||||
Release: 4
|
||||
Release: 5
|
||||
License: GNU General Public License (GPL)
|
||||
Group: System/Kernel
|
||||
Autoreqprov: on
|
||||
PreReq: %insserv_prereq %fillup_prereq
|
||||
Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel)
|
||||
Source0: xen-3.1-testing-src.tar.bz2
|
||||
Source1: xen-vm-install.tar.bz2
|
||||
Source2: README.SuSE
|
||||
Source3: boot.xen
|
||||
Source4: boot.local.xenU
|
||||
@ -60,13 +58,17 @@ Source17: sysconfig.xend
|
||||
Source18: network-multi
|
||||
# Upstream patches
|
||||
Patch0: 15048-localtime.diff
|
||||
Patch1: 15157_modified.patch
|
||||
Patch2: 00-domain-restore.patch
|
||||
Patch1: 15157_xend_device_destroy.patch
|
||||
Patch2: 15250_xend_device_destroy.patch
|
||||
Patch3: 15273_libxenapi.patch
|
||||
Patch4: 15274_xenapi.patch
|
||||
Patch5: 15275_xenapi.patch
|
||||
Patch6: 15410-domain-restore.patch
|
||||
Patch7: man-page.diff
|
||||
# Our patches
|
||||
Patch100: xen-config.diff
|
||||
Patch101: xend-config.diff
|
||||
Patch102: xen-destdir.diff
|
||||
Patch103: xen-vm-install.diff
|
||||
Patch104: xen-rpmoptflags.diff
|
||||
Patch105: xen-warnings.diff
|
||||
Patch106: xen-changeset.diff
|
||||
@ -139,6 +141,7 @@ Patch196: x86-extra-trap-info.patch
|
||||
Patch197: x86-machine-check.patch
|
||||
Patch198: x86-emul-rf.patch
|
||||
Patch199: vmx-check-descr.patch
|
||||
Patch200: clear_DF_for_kernel.patch
|
||||
Patch300: xen-enable-hvm-debug.diff
|
||||
URL: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
@ -256,9 +259,6 @@ Summary: Xen Virtualization: Control tools for domain 0
|
||||
Group: System/Kernel
|
||||
Requires: xen-libs >= 3.1.0_15000
|
||||
Requires: bridge-utils multipath-tools python python-xml pyxml
|
||||
%if %{?with_install}0
|
||||
Requires: python-urlgrabber libxml2-python
|
||||
%endif
|
||||
AutoReqProv: on
|
||||
|
||||
%description tools
|
||||
@ -515,17 +515,17 @@ Authors:
|
||||
|
||||
%prep
|
||||
%setup -q -n %xen_build_dir
|
||||
%setup -q -c -n %xen_build_dir/tools -D -T -a 1
|
||||
cd ..
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch100 -p1
|
||||
%patch101 -p1
|
||||
%patch102 -p1
|
||||
%if %{?with_install}0
|
||||
%patch103 -p1
|
||||
%endif
|
||||
%patch104 -p1
|
||||
%patch105 -p1
|
||||
%patch106 -p1
|
||||
@ -597,13 +597,13 @@ cd ..
|
||||
%patch197 -p1
|
||||
%patch198 -p1
|
||||
%patch199 -p1
|
||||
%patch200 -p1
|
||||
XEN_EXTRAVERSION=%version-%release
|
||||
XEN_EXTRAVERSION=${XEN_EXTRAVERSION#%{xvers}}
|
||||
sed -i "s/XEN_EXTRAVERSION[\t ]*.=.*\$/XEN_EXTRAVERSION = $XEN_EXTRAVERSION/" xen/Makefile
|
||||
sed -i "s/XEN_CHANGESET[\t ]*=.*\$/XEN_CHANGESET = %{changeset}/" xen/Makefile
|
||||
|
||||
%build
|
||||
cd ..
|
||||
RPM_OPT_FLAGS=${RPM_OPT_FLAGS//-fstack-protector/}
|
||||
export CFLAGS="${RPM_OPT_FLAGS}"
|
||||
export RPM_OPT_FLAGS
|
||||
@ -623,7 +623,6 @@ done
|
||||
|
||||
%install
|
||||
test ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT
|
||||
cd ..
|
||||
export CFLAGS="$RPM_OPT_FLAGS"
|
||||
export RPM_OPT_FLAGS
|
||||
install_xen()
|
||||
@ -719,9 +718,6 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/xen/save
|
||||
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/domain
|
||||
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/migrate
|
||||
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/vnet
|
||||
%if %{?with_install}0
|
||||
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/vm-install
|
||||
%endif
|
||||
mkdir -p $RPM_BUILD_ROOT/var/log/xen
|
||||
mkdir -p $RPM_BUILD_ROOT/var/run/xenstored
|
||||
ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images
|
||||
@ -729,10 +725,7 @@ ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images
|
||||
install -m755 %SOURCE8 $RPM_BUILD_ROOT/usr/lib/xen/boot/
|
||||
# udev support
|
||||
mv $RPM_BUILD_ROOT/etc/udev/rules.d/xen-backend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xen.rules
|
||||
%if %{?with_install}0
|
||||
%find_lang xen-vm-install xen.lang
|
||||
%endif
|
||||
#%find_lang xen-xm xen.lang # po files are misnamed upstream
|
||||
#%find_lang xen-vm # po files are misnamed upstream
|
||||
# Clean up unpackaged files
|
||||
rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/qemu/
|
||||
rm -rf $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/ps
|
||||
@ -740,7 +733,6 @@ rm $RPM_BUILD_ROOT/%{_mandir}/man1/qemu.*
|
||||
rm $RPM_BUILD_ROOT/usr/sbin/netfix
|
||||
rm $RPM_BUILD_ROOT/usr/lib*/xen/bin/qemu-dm.debug
|
||||
rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
|
||||
%suse_update_desktop_file xen-vm-install X-SuSE-YaST-Virtualization
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
@ -778,7 +770,7 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
|
||||
%{_libdir}/libfsimage.so.*
|
||||
%{_libdir}/libxen*.so.*
|
||||
|
||||
%files tools -f ../xen.lang
|
||||
%files tools
|
||||
%defattr(-,root,root)
|
||||
/usr/bin/lomount
|
||||
/usr/bin/xen-detect
|
||||
@ -794,13 +786,6 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
|
||||
/usr/sbin/tapdisk
|
||||
/usr/sbin/xen*
|
||||
/usr/sbin/xm
|
||||
%if %{?with_install}0
|
||||
/usr/bin/vm-install*
|
||||
%{_datadir}/xen/install
|
||||
%dir /var/lib/xen/vm-install
|
||||
%dir %{_datadir}/applications/YaST2
|
||||
%{_datadir}/applications/YaST2/xen-vm-install.desktop
|
||||
%endif
|
||||
%dir %{_libdir}/xen
|
||||
%dir %{_libdir}/xen/bin
|
||||
%ifarch x86_64
|
||||
@ -924,6 +909,15 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
|
||||
/sbin/ldconfig
|
||||
|
||||
%changelog
|
||||
* Wed Jun 20 2007 - jfehlig@novell.com
|
||||
- Added upstream changesets 15273, 15274, and 15275.
|
||||
- Removed the modified 15157 patch. This patch was actually a
|
||||
consolidation of changesets 15157 and 15250. These changesets
|
||||
are now discrete patches to ease subsequent updates of Xen.
|
||||
* Wed Jun 20 2007 - ccoffing@novell.com
|
||||
- Split vm-install off as a separate package.
|
||||
- Update man page.
|
||||
- Update Ron Terry's network-multi script.
|
||||
* Mon Jun 18 2007 - ccoffing@novell.com
|
||||
- Fix compiler warnings.
|
||||
- Update block-npiv.
|
||||
|
Loading…
x
Reference in New Issue
Block a user