SHA256
1
0
forked from pool/xen
OBS User unknown 2007-08-03 00:38:01 +00:00 committed by Git OBS Bridge
parent 451287a11c
commit e8f318b476
7 changed files with 311 additions and 28 deletions

73
15642_uuid_unique.patch Normal file
View File

@ -0,0 +1,73 @@
# HG changeset patch
# User kfraser@localhost.localdomain
# Date 1185296704 -3600
# Node ID 207582c8d88b532783da5c6f5839336187556f0a
# Parent d9836851a2a4cf6e506f6a8e162a4c90c9f87d82
Add domain name check and UUID check to 'xm new' command.
Add a domain name check and a UUID check to xm new command. The check
logic is as follows:
- If the UUID is not specified
- If a VM with same name exists
=> Update the config for that existing VM
- Else no vm with same name exists
=> Define a brand new VM with auto-generated UUID
- Else UUID is specified
- If a VM with same UUID exists
- If name is different
=> Error
- Else if name is same
=> Update the config for that existing VM
- Else no VM with same UUID exists
- If name is different
=> Define a branch new VM with that name
- Else if name is same
=> Error
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Index: xen-3.1-testing/tools/python/xen/xend/XendDomain.py
===================================================================
--- xen-3.1-testing.orig/tools/python/xen/xend/XendDomain.py
+++ xen-3.1-testing/tools/python/xen/xend/XendDomain.py
@@ -51,6 +51,7 @@ from xen.xend.xenstore.xstransact import
from xen.xend.xenstore.xswatch import xswatch
from xen.util import mkdir, security
from xen.xend import uuid
+from xen.xend import sxp
xc = xen.lowlevel.xc.xc()
xoptions = XendOptions.instance()
@@ -946,6 +947,31 @@ class XendDomain:
try:
try:
domconfig = XendConfig.XendConfig(sxp_obj = config)
+
+ domains = self.list('all')
+ domains = map(lambda dom: dom.sxpr(), domains)
+ for dom in domains:
+ if sxp.child_value(config, 'uuid', None):
+ if domconfig['uuid'] == sxp.child_value(dom, 'uuid'):
+ if domconfig['name_label'] != sxp.child_value(dom, 'name'):
+ raise XendError("Domain UUID '%s' is already used." % \
+ domconfig['uuid'])
+ else:
+ # Update the config for that existing domain
+ # because it is same name and same UUID.
+ break
+ else:
+ if domconfig['name_label'] == sxp.child_value(dom, 'name'):
+ raise XendError("Domain name '%s' is already used." % \
+ domconfig['name_label'])
+ else:
+ if domconfig['name_label'] == sxp.child_value(dom, 'name'):
+ # Overwrite the auto-generated UUID by the UUID
+ # of the existing domain. And update the config
+ # for that existing domain.
+ domconfig['uuid'] = sxp.child_value(dom, 'uuid')
+ break
+
dominfo = XendDomainInfo.createDormant(domconfig)
log.debug("Creating new managed domain: %s" %
dominfo.getName())

25
15649_xenapi.patch Normal file
View File

@ -0,0 +1,25 @@
# HG changeset patch
# User kfraser@localhost.localdomain
# Date 1185523570 -3600
# Node ID e63b331d869892fed2c6f582642a6771c1bda613
# Parent f035c4d9880a453d8c309fdf0e06dedefd96684c
Fix Xen API console methods that use undefined variables.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
diff -r f035c4d9880a -r e63b331d8698 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py Fri Jul 27 09:04:35 2007 +0100
+++ b/tools/python/xen/xend/XendAPI.py Fri Jul 27 09:06:10 2007 +0100
@@ -2378,11 +2378,13 @@ class XendAPI(object):
return xen_api_success(cons)
def console_get_location(self, session, console_ref):
+ xendom = XendDomain.instance()
return xen_api_success(xendom.get_dev_property_by_uuid('console',
console_ref,
'location'))
def console_get_protocol(self, session, console_ref):
+ xendom = XendDomain.instance()
return xen_api_success(xendom.get_dev_property_by_uuid('console',
console_ref,
'protocol'))

24
15650_xenapi.patch Normal file
View File

@ -0,0 +1,24 @@
# HG changeset patch
# User kfraser@localhost.localdomain
# Date 1185523590 -3600
# Node ID 2450743f51b2b2a41d4cd112c1cc635c81d912e4
# Parent e63b331d869892fed2c6f582642a6771c1bda613
Implement missing Xen API method Console.get_other_config.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
diff -r e63b331d8698 -r 2450743f51b2 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py Fri Jul 27 09:06:10 2007 +0100
+++ b/tools/python/xen/xend/XendAPI.py Fri Jul 27 09:06:30 2007 +0100
@@ -2394,6 +2394,12 @@ class XendAPI(object):
vm = xendom.get_vm_with_dev_uuid('console', console_ref)
return xen_api_success(vm.get_uuid())
+ def console_get_other_config(self, session, console_ref):
+ xendom = XendDomain.instance()
+ return xen_api_success(xendom.get_dev_property_by_uuid('console',
+ console_ref,
+ 'other_config'))
+
# object methods
def console_get_record(self, session, console_ref):
xendom = XendDomain.instance()

78
15651_xenapi.patch Normal file
View File

@ -0,0 +1,78 @@
# HG changeset patch
# User kfraser@localhost.localdomain
# Date 1185523618 -3600
# Node ID 5682f899c7ae7fa945085aaded75cd1220fd8d17
# Parent 2450743f51b2b2a41d4cd112c1cc635c81d912e4
Implement Xen API method Console.set_other_config.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
diff -r 2450743f51b2 -r 5682f899c7ae tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py Fri Jul 27 09:06:30 2007 +0100
+++ b/tools/python/xen/xend/XendAPI.py Fri Jul 27 09:06:58 2007 +0100
@@ -2438,6 +2438,13 @@ class XendAPI(object):
except XendError, exn:
return xen_api_error(['INTERNAL_ERROR', str(exn)])
+ def console_set_other_config(self, session, console_ref, other_config):
+ xd = XendDomain.instance()
+ vm = xd.get_vm_with_dev_uuid('console', console_ref)
+ vm.set_console_other_config(console_ref, other_config)
+ xd.managed_config_save(vm)
+ return xen_api_success_void()
+
# Xen API: Class SR
# ----------------------------------------------------------------
SR_attr_ro = ['VDIs',
diff -r 2450743f51b2 -r 5682f899c7ae tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py Fri Jul 27 09:06:30 2007 +0100
+++ b/tools/python/xen/xend/XendConfig.py Fri Jul 27 09:06:58 2007 +0100
@@ -128,6 +128,11 @@ XENAPI_PLATFORM_CFG = [ 'acpi', 'apic',
'soundhw','stdvga', 'usb', 'usbdevice', 'vnc',
'vncconsole', 'vncdisplay', 'vnclisten',
'vncpasswd', 'vncunused', 'xauthority']
+
+# Xen API console 'other_config' keys.
+XENAPI_CONSOLE_OTHER_CFG = ['vncunused', 'vncdisplay', 'vnclisten',
+ 'vncpasswd', 'type', 'display', 'xauthority',
+ 'keymap']
# List of XendConfig configuration keys that have no direct equivalent
# in the old world.
@@ -1121,9 +1126,7 @@ class XendConfig(dict):
# with vfb
other_config = {}
- for key in ['vncunused', 'vncdisplay', 'vnclisten',
- 'vncpasswd', 'type', 'display', 'xauthority',
- 'keymap']:
+ for key in XENAPI_CONSOLE_OTHER_CFG:
if key in dev_info:
other_config[key] = dev_info[key]
target['devices'][dev_uuid][1]['other_config'] = other_config
@@ -1311,6 +1314,13 @@ class XendConfig(dict):
for dev_uuid, (dev_type, dev_info) in self['devices'].items():
if dev_uuid == console_uuid:
dev_info[key] = value
+ # collapse other_config into dev_info for things
+ # such as vncpasswd, vncunused, etc.
+ if key == 'other_config':
+ for k in XENAPI_CONSOLE_OTHER_CFG:
+ if k in dev_info and k not in value:
+ del dev_info[k]
+ dev_info.update(value)
break
def console_get_all(self, protocol):
diff -r 2450743f51b2 -r 5682f899c7ae tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Fri Jul 27 09:06:30 2007 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py Fri Jul 27 09:06:58 2007 +0100
@@ -2633,6 +2633,9 @@ class XendDomainInfo:
return dev_uuid
+ def set_console_other_config(self, console_uuid, other_config):
+ self.info.console_update(console_uuid, 'other_config', other_config)
+
def destroy_device_by_uuid(self, dev_type, dev_uuid):
if dev_uuid not in self.info['devices']:
raise XendError('Device does not exist')

View File

@ -2,11 +2,10 @@
#============================================================================ #============================================================================
# network-multi_net # network-multi_net
# #
# Version = 1.1.0 # Version = 1.1.2
# Date = 2007-06-08 # Date = 2007-07-11
# #
# Maintainer(s) = Ron Terry - ron (at) pronetworkconsulting (dot) com # Maintainer(s) = Ron Terry - ron (at) pronetworkconsulting (dot) com
# Charles Coffing -
# #
# The latest version can be found at: # The latest version can be found at:
# #
@ -154,7 +153,7 @@ IPTABLES_SAVE_FILE="$NETWORK_SAVE_PATH/iptables-save"
#### Script Functions ##################################################### #### Script Functions #####################################################
help() { usage() {
# Gives hlep about usage parameters # Gives hlep about usage parameters
echo "Usage: $0 {start|stop|restart|status}" echo "Usage: $0 {start|stop|restart|status}"
exit 1 exit 1
@ -167,7 +166,7 @@ get_option() {
CMD_OPT="$1" CMD_OPT="$1"
;; ;;
*) *)
help usage
;; ;;
esac esac
} }
@ -269,6 +268,39 @@ manage_routing() {
esac esac
} }
manage_susefirewall2() {
case $CMD_OPT in
start)
if [ -e /etc/init.d/SuSEfirewall2_setup ] && /etc/init.d/SuSEfirewall2_setup status | grep -iwq "running"
then
echo ""
echo "============================================================"
echo "Stopping SuSEfirewall2"
echo "============================================================"
/etc/init.d/SuSEfirewall2_setup stop > /dev/null
echo "0" > $NETWORK_SAVE_PATH/sf2
return 0
else
return 1
fi
;;
stop)
if [ -e $NETWORK_SAVE_PATH/sf2 ] && grep "0" $NETWORK_SAVE_PATH/sf2
then
echo ""
echo "============================================================"
echo "Starting SuSEfirewall2"
echo "============================================================"
/etc/init.d/SuSEfirewall2_setup start > /dev/null
rm -rf $NETWORK_SAVE_PATH/sf2
return 0
else
return 1
fi
;;
esac
}
manage_iptables() { manage_iptables() {
# Saves and restores the iptables rules that exist before the script runs # Saves and restores the iptables rules that exist before the script runs
# #
@ -281,7 +313,10 @@ manage_iptables() {
echo "============================================================" echo "============================================================"
echo "Saving iptables rules" echo "Saving iptables rules"
echo "============================================================" echo "============================================================"
#iptables-save > $IPTABLES_SAVE_FILE
#----------------------------------------------------------------
# Saving iptables rules for $TABLE to a file
#----------------------------------------------------------------
for TABLE in `iptables-save |grep '*'|cut -d '*' -f 2` for TABLE in `iptables-save |grep '*'|cut -d '*' -f 2`
do do
echo "Saving table: $TABLE" echo "Saving table: $TABLE"
@ -290,12 +325,32 @@ manage_iptables() {
iptables -F -t $TABLE iptables -F -t $TABLE
echo "-----------------------" echo "-----------------------"
done done
#----------------------------------------------------------------
# Deleting any custom chain
#----------------------------------------------------------------
for CHAIN in `iptables-save |grep ^:|cut -d ":" -f 2|cut -d " " -f 1`
do
case $CHAIN in
INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING)
#do nothing
;;
*)
echo "Deteting chain: $CHAIN"
iptables -X $CHAIN
;;
esac
done
;; ;;
stop) stop)
echo "" echo ""
echo "============================================================" echo "============================================================"
echo "Restoring iptables rules" echo "Restoring iptables rules"
echo "============================================================" echo "============================================================"
#----------------------------------------------------------------
# Restoring iptables rules for $TABLE
#----------------------------------------------------------------
for TABLE in `ls $IPTABLES_SAVE_FILE*|cut -d "@" -f 2` for TABLE in `ls $IPTABLES_SAVE_FILE*|cut -d "@" -f 2`
do do
echo "Restoring table: $TABLE" echo "Restoring table: $TABLE"
@ -303,8 +358,6 @@ manage_iptables() {
rm $IPTABLES_SAVE_FILE@$TABLE rm $IPTABLES_SAVE_FILE@$TABLE
echo "-----------------------" echo "-----------------------"
done done
#iptables-restore < $IPTABLES_SAVE_FILE
#rm $IPTABLES_SAVE_FILE
;; ;;
esac esac
} }
@ -390,7 +443,8 @@ create_local_bridges() {
local BRIDGE_TYPE=`echo $IFACE|cut -d "," -f 4` 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_GW_IP=`echo $IFACE|cut -d "," -f 3|cut -d "/" -f 1`
local NAT_INTIF=`echo $IFACE|cut -d "," -f 1` local NAT_INTIF=$DEV
local ROUTE_INTIF=$DEV
local BRIDGE_NUM=${NAT_INTIF##${NAT_INTIF%%[0-9]*}} local BRIDGE_NUM=${NAT_INTIF##${NAT_INTIF%%[0-9]*}}
local BR_NAME=$BRIDGE_NAME$BRIDGE_NUM local BR_NAME=$BRIDGE_NAME$BRIDGE_NUM
@ -423,16 +477,13 @@ create_local_bridges() {
NAT|nat) # Set up the bridge as NATed network NAT|nat) # Set up the bridge as NATed network
echo " Gateway: $NAT_GW_IP" echo " Gateway: $NAT_GW_IP"
echo " External Interface: $NAT_EXTERNAL_INTERFACE" 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 ROUTE|route) # Set up the bridge as Routed network
echo " Gateway: $NAT_GW_IP" echo " Gateway: $NAT_GW_IP"
echo " External Interface: $NAT_EXTERNAL_INTERFACE" echo " External Interface: $NAT_EXTERNAL_INTERFACE"
iptables -t nat -A PREROUTING -i $ROUTE_INTIF -j ACCEPT
#iptables -t filter -A FORWARD -i $NAT_INTIF -j ACCEPT
#iptables -t filter -A FORWARD -i $NAT_INTIF -j ACCEPT
;; ;;
HOSTONLY|hostonly) # Set up the bridge as hostonly network HOSTONLY|hostonly) # Set up the bridge as hostonly network
if [ "$IP_FWD" = "on" ] if [ "$IP_FWD" = "on" ]
@ -467,18 +518,18 @@ create_local_bridges() {
#------------------------------------------------------------------ #------------------------------------------------------------------
case $BRIDGE_TYPE in case $BRIDGE_TYPE in
NAT|nat) NAT|nat)
## 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" ROUTE|route)
# Clean out the bridge specific routing iptables rule
iptables -t nat -D PREROUTING -i $ROUTE_INTIF -j ACCEPT
#iptables -t filter -D FORWARD -i $DEV -j ACCEPT
#iptables -t filter -D FORWARD -i $NAT_INTIF -j ACCEPT
;; ;;
HOSTONLY|hostonly) HOSTONLY|hostonly)
# Clean out the bridge specific nat iptables rule # Clean out the bridge specific nat iptables rule
iptables -t nat -D PREROUTING -i $NAT_INTIF -j DROP iptables -t nat -D PREROUTING -i $NAT_INTIF -j DROP
;; ;;
ROUTE|route)
# Turn off routing
#echo 0 > /proc/sys/net/ipv4/ip_forward
;;
esac esac
echo "============================================================" echo "============================================================"
@ -575,7 +626,7 @@ start_xend_network() {
echo " Starting the xend network environment" echo " Starting the xend network environment"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
make_save_dir make_save_dir
manage_iptables manage_susefirewall2 || manage_iptables
create_traditional_bridges create_traditional_bridges
manage_routing manage_routing
create_local_bridges create_local_bridges
@ -591,7 +642,7 @@ stop_xend_network() {
create_local_bridges create_local_bridges
create_empty_bridges create_empty_bridges
manage_routing manage_routing
manage_iptables manage_susefirewall2 || manage_iptables
} }
show_xend_network_status() { show_xend_network_status() {

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Tue Jul 31 13:12:40 MDT 2007 - ccoffing@novell.com
- Update Ron Terry's network-multi script
- Fix insserv
-------------------------------------------------------------------
Tue Jul 31 11:41:13 MDT 2007 - jfehlig@novell.com
- Added following upstream patches:
+ 15642 - Fixes bug 289421 found in SLES10 SP1 but applies to
Xen 3.1.0 as well.
+ 15649, 15650, 15651 - Fixes/enhancements to Xen API required
by Xen CIM providers
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jul 27 10:50:58 MDT 2007 - ccoffing@novell.com Fri Jul 27 10:50:58 MDT 2007 - ccoffing@novell.com

View File

@ -34,7 +34,7 @@ BuildRequires: glibc-32bit glibc-devel-32bit
BuildRequires: kernel-source kernel-syms xorg-x11 BuildRequires: kernel-source kernel-syms xorg-x11
%endif %endif
Version: 3.1.0_15042 Version: 3.1.0_15042
Release: 19 Release: 22
License: GPL v2 or later License: GPL v2 or later
Group: System/Kernel Group: System/Kernel
Autoreqprov: on Autoreqprov: on
@ -55,7 +55,7 @@ Source12: block-iscsi
Source13: block-npiv Source13: block-npiv
Source16: xmclone.sh Source16: xmclone.sh
Source17: sysconfig.xend Source17: sysconfig.xend
Source18: network-multi Source18: network-multinet
# Upstream patches # Upstream patches
Patch0: 15048-localtime.diff Patch0: 15048-localtime.diff
Patch1: 15059-check-libvncserver.patch Patch1: 15059-check-libvncserver.patch
@ -82,6 +82,10 @@ Patch21: rtl8139-data-corruption.patch
Patch22: 15168-check-dup-domians.patch Patch22: 15168-check-dup-domians.patch
Patch23: 15587-domid-reset.patch Patch23: 15587-domid-reset.patch
Patch24: 15609-save-mem-values.patch Patch24: 15609-save-mem-values.patch
Patch25: 15642_uuid_unique.patch
Patch26: 15649_xenapi.patch
Patch27: 15650_xenapi.patch
Patch28: 15651_xenapi.patch
# Our patches # Our patches
Patch100: xen-config.diff Patch100: xen-config.diff
Patch101: xend-config.diff Patch101: xend-config.diff
@ -553,6 +557,10 @@ Authors:
%patch22 -p1 %patch22 -p1
%patch23 -p1 %patch23 -p1
%patch24 -p1 %patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch100 -p1 %patch100 -p1
%patch101 -p1 %patch101 -p1
%patch102 -p1 %patch102 -p1
@ -919,8 +927,8 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
#rm -rf $RPM_BUILD_DIR/%xen_build_dir #rm -rf $RPM_BUILD_DIR/%xen_build_dir
%post tools %post tools
%{fillup_and_insserv -n xend xend} %{fillup_and_insserv -y -n xend xend}
%{fillup_and_insserv -n xendomains xendomains} %{fillup_and_insserv -y -n xendomains xendomains}
%preun tools %preun tools
%{stop_on_removal xendomains xend} %{stop_on_removal xendomains xend}
@ -936,6 +944,15 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
/sbin/ldconfig /sbin/ldconfig
%changelog %changelog
* Tue Jul 31 2007 - ccoffing@novell.com
- Update Ron Terry's network-multi script
- Fix insserv
* Tue Jul 31 2007 - jfehlig@novell.com
- Added following upstream patches:
+ 15642 - Fixes bug 289421 found in SLES10 SP1 but applies to
Xen 3.1.0 as well.
+ 15649, 15650, 15651 - Fixes/enhancements to Xen API required
by Xen CIM providers
* Fri Jul 27 2007 - ccoffing@novell.com * Fri Jul 27 2007 - ccoffing@novell.com
- #242953: Allow HVM to use blktap - #242953: Allow HVM to use blktap
- #239173: block-attach as RW for domUloader to avoid failures with - #239173: block-attach as RW for domUloader to avoid failures with