aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriap10@firebug.cl.cam.ac.uk <iap10@firebug.cl.cam.ac.uk>2005-08-16 01:04:32 +0000
committeriap10@firebug.cl.cam.ac.uk <iap10@firebug.cl.cam.ac.uk>2005-08-16 01:04:32 +0000
commit3168022e9e290d53de28b9e2d9fb3aa906c1ab92 (patch)
tree9c7dbbacab91f7b0d13f2271e7f0df72d858aea4
parent0a91775aaa199b1949f83f3b8c2d3fb533c50f29 (diff)
parentf04c4b32acf1d249113cc9e38606089000e22a55 (diff)
downloadxen-3168022e9e290d53de28b9e2d9fb3aa906c1ab92.tar.gz
xen-3168022e9e290d53de28b9e2d9fb3aa906c1ab92.tar.bz2
xen-3168022e9e290d53de28b9e2d9fb3aa906c1ab92.zip
merge
-rw-r--r--tools/examples/xmexample.vmx2
-rw-r--r--tools/ioemu/hw/ide.c3
-rw-r--r--tools/python/xen/xend/XendDomainInfo.py6
-rw-r--r--tools/python/xen/xend/image.py10
-rwxr-xr-xtools/python/xen/xend/server/blkif.py11
-rw-r--r--tools/python/xen/xm/create.py12
6 files changed, 34 insertions, 10 deletions
diff --git a/tools/examples/xmexample.vmx b/tools/examples/xmexample.vmx
index 95616cda61..77662fcca9 100644
--- a/tools/examples/xmexample.vmx
+++ b/tools/examples/xmexample.vmx
@@ -34,7 +34,7 @@ name = "ExampleVMXDomain"
# and MODE is r for read-only, w for read-write.
#disk = [ 'phy:hda1,hda1,r' ]
-disk = [ 'file:/var/images/min-el3-i386.img,hda,w' ]
+disk = [ 'file:/var/images/min-el3-i386.img,ioemu:hda,w' ]
#----------------------------------------------------------------------------
# Set according to whether you want the domain restarted when it exits.
diff --git a/tools/ioemu/hw/ide.c b/tools/ioemu/hw/ide.c
index 5e5610e136..c0228cbd9e 100644
--- a/tools/ioemu/hw/ide.c
+++ b/tools/ioemu/hw/ide.c
@@ -430,6 +430,7 @@ static void ide_identify(IDEState *s)
put_le16(p + 59, 0x100 | s->mult_sectors);
put_le16(p + 60, s->nb_sectors);
put_le16(p + 61, s->nb_sectors >> 16);
+ put_le16(p + 63, 0x07);
put_le16(p + 80, (1 << 1) | (1 << 2));
put_le16(p + 82, (1 << 14));
put_le16(p + 83, (1 << 14));
@@ -460,7 +461,7 @@ static void ide_atapi_identify(IDEState *s)
put_le16(p + 48, 1); /* dword I/O (XXX: should not be set on CDROM) */
put_le16(p + 49, 1 << 9); /* LBA supported, no DMA */
put_le16(p + 53, 3); /* words 64-70, 54-58 valid */
- put_le16(p + 63, 0x103); /* DMA modes XXX: may be incorrect */
+ put_le16(p + 63, 0x07); /* Multi-word DMA mode 2 */
put_le16(p + 64, 1); /* PIO modes */
put_le16(p + 65, 0xb4); /* minimum DMA multiword tx cycle time */
put_le16(p + 66, 0xb4); /* recommended DMA multiword tx cycle time */
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index 5fe20c499a..f11c622981 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -743,8 +743,7 @@ class XendDomainInfo:
for ctrl in self.getDeviceControllers():
ctrl.initController(reboot=True)
else:
- if self.image.ostype != 'vmx':
- self.create_configured_devices()
+ self.create_configured_devices()
if not self.device_model_pid:
self.device_model_pid = self.image.createDeviceModel()
@@ -916,8 +915,7 @@ class XendDomainInfo:
"""
self.configure_fields()
self.create_devices()
- if self.image.ostype != 'vmx':
- self.create_blkif()
+ self.create_blkif()
def create_blkif(self):
"""Create the block device interface (blkif) for the vm.
diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py
index afa6d1da99..ebf1b2009a 100644
--- a/tools/python/xen/xend/image.py
+++ b/tools/python/xen/xend/image.py
@@ -16,6 +16,7 @@
#============================================================================
import os, string
+import re
import xen.lowlevel.xc; xc = xen.lowlevel.xc.new()
from xen.xend import sxp
@@ -329,8 +330,15 @@ class VmxImageHandler(ImageHandler):
if name == 'vbd':
vbdinfo = sxp.child(device, 'vbd')
uname = sxp.child_value(vbdinfo, 'uname')
- vbddev = sxp.child_value(vbdinfo, 'dev')
+ typedev = sxp.child_value(vbdinfo, 'dev')
(vbdtype, vbdparam) = string.split(uname, ':', 1)
+ if re.match('^ioemu:', typedev):
+ (emtype, vbddev) = string.split(typedev, ':', 1)
+ else:
+ emtype = 'vbd'
+ vbddev = typedev
+ if emtype != 'ioemu':
+ continue;
vbddev_list = ['hda', 'hdb', 'hdc', 'hdd']
if vbddev not in vbddev_list:
raise VmError("vmx: for qemu vbd type=file&dev=hda~hdd")
diff --git a/tools/python/xen/xend/server/blkif.py b/tools/python/xen/xend/server/blkif.py
index 5bd89e8353..49d1fc5f9e 100755
--- a/tools/python/xen/xend/server/blkif.py
+++ b/tools/python/xen/xend/server/blkif.py
@@ -18,6 +18,7 @@
"""Support for virtual block devices.
"""
import string
+import re
from xen.util import blkif
from xen.xend.XendError import XendError, VmError
@@ -199,6 +200,7 @@ class BlkDev(Dev):
self.vdev = None
self.mode = None
self.type = None
+ self.emtype = None
self.params = None
self.node = None
self.device = None
@@ -237,7 +239,12 @@ class BlkDev(Dev):
# Split into type and type-specific params (which are passed to the
# type-specific control script).
(self.type, self.params) = string.split(self.uname, ':', 1)
- self.dev = sxp.child_value(config, 'dev')
+ typedev = sxp.child_value(config, 'dev')
+ if re.match( '^ioemu:', typedev):
+ (self.emtype, self.dev) = string.split(typedev, ':', 1)
+ else:
+ self.emtype = 'vbd'
+ self.dev = typedev
if not self.dev:
raise VmError('vbd: Missing dev')
self.mode = sxp.child_value(config, 'mode', 'r')
@@ -258,6 +265,8 @@ class BlkDev(Dev):
if recreate:
pass
else:
+ if self.emtype == 'ioemu':
+ return
node = Blkctl.block('bind', self.type, self.params)
self.setNode(node)
self.attachBackend()
diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
index d20e47352e..72aa2a3f63 100644
--- a/tools/python/xen/xm/create.py
+++ b/tools/python/xen/xm/create.py
@@ -592,9 +592,14 @@ def choose_vnc_display():
return d
return None
+vncpid = None
+
def spawn_vnc(display):
- os.system("vncviewer -log *:stdout:0 -listen %d &" %
- (VNC_BASE_PORT + display))
+ vncargs = (["vncviewer" + "-log", "*:stdout:0",
+ "-listen", "%d" % (VNC_BASE_PORT + display) ])
+ global vncpid
+ vncpid = os.spawnvp(os.P_NOWAIT, "vncviewer", vncargs)
+
return VNC_BASE_PORT + display
def preprocess_vnc(opts, vals):
@@ -639,6 +644,9 @@ def make_domain(opts, config):
else:
dominfo = server.xend_domain_create(config)
except XendError, ex:
+ import signal
+ if vncpid:
+ os.kill(vncpid, signal.SIGKILL)
opts.err(str(ex))
dom = sxp.child_value(dominfo, 'name')