aboutsummaryrefslogtreecommitdiffstats
path: root/tools/python/scripts
diff options
context:
space:
mode:
authorAlastair Tse <atse@xensource.com>2007-01-31 13:20:36 +0000
committerAlastair Tse <atse@xensource.com>2007-01-31 13:20:36 +0000
commitf492dd97fb674fbf6fe86f3052a50098ed169201 (patch)
treea7e0bbbb8f359b27caca2b5532d76a2c7cf93701 /tools/python/scripts
parent6501ac6994ade911cc15bd64325dab4a3fffbcfc (diff)
downloadxen-f492dd97fb674fbf6fe86f3052a50098ed169201.tar.gz
xen-f492dd97fb674fbf6fe86f3052a50098ed169201.tar.bz2
xen-f492dd97fb674fbf6fe86f3052a50098ed169201.zip
[XEND] Merge VFB support for PV and HVM guests.
This patch merges the way VFB are represented inside Xend by making HVM VNC consoles use the VFB as its configuration object. It preserves the way options are specified through xm but will create a new VFB device that is used by image.py to put vnc config into qemu-dm's command line. The parsing is moved into image.py's parseDeviceModel() rather than in configVNC(). Through the Xen API, you can create a 'console' of protocol 'rfb' and end up with a VNC console, on both HVM and PV guests. The location of the connecting port is stored in the location attribute of the console object. This is updated on each XendDomainInfo.update() if it changes. Also fixes missing read of the vnclisten and HVM_boot from the config when initialised via xm. Makes sure bootable attribute for VBD is store as an int when making SXP config. Signed-off-by: Alastair Tse <atse@xensource.com>
Diffstat (limited to 'tools/python/scripts')
-rw-r--r--tools/python/scripts/test_hvm_create.py12
-rw-r--r--tools/python/scripts/test_vm_create.py13
-rw-r--r--tools/python/scripts/xapi.py4
3 files changed, 26 insertions, 3 deletions
diff --git a/tools/python/scripts/test_hvm_create.py b/tools/python/scripts/test_hvm_create.py
index 5d2aca5944..8effd42db9 100644
--- a/tools/python/scripts/test_hvm_create.py
+++ b/tools/python/scripts/test_hvm_create.py
@@ -72,6 +72,12 @@ vif_cfg = {
'MTU': 1500,
}
+console_cfg = {
+ 'protocol': 'rfb',
+ 'other_config': {'vncunused': 1, 'vncpasswd': 'testing'},
+}
+
+
import sys
import time
sys.path.append('/usr/lib/python')
@@ -125,6 +131,12 @@ def test_vm_create():
vif_cfg['VM'] = vm_uuid
vif_uuid = execute(server, 'VIF.create', (session, vif_cfg))
+ # Create a console
+ console_cfg['VM'] = vm_uuid
+ console_uuid = execute(server, 'console.create',
+ (session, console_cfg))
+ print console_uuid
+
# Start the VM
execute(server, 'VM.start', (session, vm_uuid, False))
diff --git a/tools/python/scripts/test_vm_create.py b/tools/python/scripts/test_vm_create.py
index 19a5135153..0d702aae69 100644
--- a/tools/python/scripts/test_vm_create.py
+++ b/tools/python/scripts/test_vm_create.py
@@ -91,6 +91,11 @@ vif_cfg = {
'network': '',
'MAC': '',
'MTU': 1500,
+}
+
+console_cfg = {
+ 'protocol': 'rfb',
+ 'other_config': {'vncunused': 1, 'vncpasswd': 'testing'},
}
import sys
@@ -157,12 +162,18 @@ def test_vm_create():
vif_cfg['VM'] = vm_uuid
vif_uuid = execute(server, 'VIF.create', (session, vif_cfg))
+ # Create a console
+ console_cfg['VM'] = vm_uuid
+ console_uuid = execute(server, 'console.create',
+ (session, console_cfg))
+ print console_uuid
+
# Start the VM
execute(server, 'VM.start', (session, vm_uuid, False))
time.sleep(30)
- test_suspend = True
+ test_suspend = False
if test_suspend:
print 'Suspending VM..'
execute(server, 'VM.suspend', (session, vm_uuid))
diff --git a/tools/python/scripts/xapi.py b/tools/python/scripts/xapi.py
index ab0938f111..b5fe8b3682 100644
--- a/tools/python/scripts/xapi.py
+++ b/tools/python/scripts/xapi.py
@@ -45,7 +45,7 @@ VDI_LIST_FORMAT = '%(name_label)-18s %(uuid)-36s %(virtual_size)-8s '\
VBD_LIST_FORMAT = '%(device)-6s %(uuid)-36s %(VDI)-8s'
TASK_LIST_FORMAT = '%(name_label)-18s %(uuid)-36s %(status)-8s %(progress)-4s'
VIF_LIST_FORMAT = '%(name)-8s %(device)-7s %(uuid)-36s %(MAC)-10s'
-CONSOLE_LIST_FORMAT = '%(uuid)-36s %(protocol)-8s %(uri)-32s'
+CONSOLE_LIST_FORMAT = '%(uuid)-36s %(protocol)-8s %(location)-32s'
COMMANDS = {
'host-info': ('', 'Get Xen Host Info'),
@@ -545,7 +545,7 @@ def xapi_console_list(args, async = False):
if not is_long:
print CONSOLE_LIST_FORMAT % {'protocol': 'Protocol',
- 'uri': 'URI',
+ 'location': 'Location',
'uuid': 'UUID'}
for console in consoles: