Commit Graph
1173 Commits
Author SHA1 Message Date
emellor@leeni.uk.xensource.com 464379d285 Resurrect vifname xm create vif option support. This was present in earlier
versions of Xen, and allows one to name a vif when it is created.  This is
useful for integration with IP accounting packages, for example.

Closes bug #439.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-13 18:06:03 +00:00
emellor@leeni.uk.xensource.com dc3c184731 Fix reference to HttpXendClientProtocol. This was previously referring to the
abstract base class, which was never going to work.  (This is debugging code
only, so I presume that no-one has used it for a long time, but it's doing no
harm hanging around.)

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-13 17:31:35 +00:00
emellor@leeni.uk.xensource.com a9b9f0585c Merged. 2005-12-13 10:57:18 +00:00
Xiaofeng Ling e697c7e8ef change the NIC configuration accordingly after remove "nics=n"
otherwise, nics=-1 will be passed to device model and cause device
model exiting.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
2005-12-13 10:57:04 +00:00
emellor@leeni.uk.xensource.com b57b530e0a Match previous changeset removing nics option.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-13 00:56:50 +00:00
emellor@leeni.uk.xensource.com bc8ed50e6c Deprecate the nics option from the xm create configuration. Instead, we use the
entries in vif to guide the configuration.  This is much less confusing.

Closes bug #440.

Change the example configuration files to match.  Also change them to use the
XenSource OUI in the MAC addresses.  Also change xm-test to match.

Remove the obsolete ipaddr configuration entry, and the backend_mac vif config
option.

Remove the preprocess_vifs function, folding it into the configure_vifs
function, and creating a simple comma_sep_kv_to_dict helper.

Remove the configure_vfr method, as it is unused.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-13 00:15:53 +00:00
emellor@leeni.uk.xensource.com 296749cb10 Don't try and close the pipe to the grandparent if it has already been closed
(i.e. we have restarted Xend).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-13 00:10:19 +00:00
emellor@leeni.uk.xensource.com 03bbc8cec6 Added a hosts-allow facility to TCP connections, which allows us to restrict
the acceptable connections based upon a regular expression comparison with the
FQDN or the IP address.

Use the hosts-allow facility to restrict access to the relocation socket.  This
adds the configuration option xend-relocation-hosts-allow, which takes a
space-separated sequence of regular expressions.

Pass the protocol class instance through to SocketServerConnection, rather than
a new instance of that class.  This means that the new instance need not be
passed through SocketListener.acceptConnection.

Make the SocketServerConnection and SocketListener classes start their
corresponding threads and open their sockets (in the case of SocketListener)
automatically.  This means that callers do not need to save an instance locally,
just to call run() or listen() on it.  This also means that listenTCP and
listenUnix can go -- simply creating a TCPListener or UnixListener instance is
sufficient.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-12 16:43:48 +00:00
emellor@leeni.uk.xensource.com 91da6b2f1c Minor tidy.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-12 16:32:50 +00:00
emellor@leeni.uk.xensource.com 6efef1afab Make from_string('') return []. This means that it is not necessary for our
callers to special-case this value -- the [] is a valid sxp.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-12 16:32:19 +00:00
emellor@leeni.uk.xensource.com 3b7940ffef Minor import tidy.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-12 16:24:32 +00:00
kaf24@firebug.cl.cam.ac.uk e53027149f Fix indentation in a few places.
Signed-off-by: Xin Li <xin.b.li@intel.com>
2005-12-11 00:16:26 +01:00
emellor@leeni.uk.xensource.com 53dcf75ccb Merged. 2005-12-09 10:51:35 +00:00
emellor@leeni.uk.xensource.com 9ab74b250b Add one more fork to the Xend start-up process, this time with the parent
staying alive to watch the child.  If the child crashes, then the parent
starts another one in its place.  This provides robustness in the face of
crashes like one currently tracked as bug #411.

Tidy up chunks of SrvDaemon.py on the way past.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-09 10:49:29 +00:00
emellor@leeni.uk.xensource.com ced2f6408d The attached patch uncouples the device id used inside XenD from the
instance number of the vTPM.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2005-12-08 18:19:24 +00:00
emellor@leeni.uk.xensource.com 028268e9bc Looks like someone merged and moved the pincpu operation to after the
memory reservation and didn't read the comments I left in the code:

# repin domain vcpus if a restricted cpus list is provided
# this is done prior to memory allocation to aide in memory
# distribution for NUMA systems.

This patch moves the pincpu op back to where it was.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
2005-12-08 18:17:59 +00:00
emellor@leeni.uk.xensource.com d2b3b7424b Detach Xend from terminal, courtesy of Horms <horms@verge.net.au>.
* For setsid to effectively detach a process from the terminal,
  the following needs to occur:

    fork ()   Return control to the shell
    setsid () New session with no controlling terminal
    fork ()   The session leader (parent) exits and thus
              the resulting child process can never regain the terminal

  This patch adds the second fork

* The call to self.daemonize(), which now forks, is moved to
  run before self.tracing(), as now that it actually disconnects
  from the terminal, and thus the prevailing process, the trace
  loses the processes created in self.run().

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-08 16:17:53 +00:00
emellor@leeni.uk.xensource.com ae0212521e Strip huge piles of cruft from the connection infrastructure. We now actually
block inside accept rather than using select to poll and then calling accept
regardless of the outcome of the select call, and then failing because the
socket is non-blocking.

SocketClientConnection, SocketConnector, TCPClientConnection, TCPConnector,
connectTCP, UnixClientConnection, UnixConnector, connectUnix have gone.

loseConnection and stopListening and closeSocket (where they are needed) are
now called close.  startListening is now called listen.

Closes bug #379.

Relieves a weight from the shoulders of the universe.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-08 15:04:31 +00:00
emellor@leeni.uk.xensource.com 5ea39e7063 Move xm destroy handling out of crufty destroy.py and into main.py, where it
can share the better argument parsing.

Closes bug #443.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-08 14:30:15 +00:00
emellor@leeni.uk.xensource.com 6a6999e3fb Fix start_time parsing on restart -- it's a float, not an int.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-08 14:28:53 +00:00
emellor@leeni.uk.xensource.com 1c68755227 Merged. 2005-12-08 12:14:33 +00:00
emellor@leeni.uk.xensource.com 5c896ea1a5 Loop retrying when ballooning out, even when the dom0-min-mem setting means
that there is not sufficient memory available at the moment.  Memory may be
about to be freed up by the system after a domain destruction (i.e. the memory
is being scrubbed asynchronously, and will be released soon).

Closes bug #407, bug #429.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-08 12:13:06 +00:00
emellor@leeni.uk.xensource.com 83c3ceb178 Read start_time and image from the store on restart. Closes bugs #441 and
#442.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-08 12:10:22 +00:00
emellor@leeni.uk.xensource.com 7b4fe715a5 Refuse to save dom0, and move the check that refuses to migrate dom0 from
migrate.py into XendDomain.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-08 12:08:59 +00:00
vhanquez@kneesa.uk.xensource.com c2c982f908 allow a port to be specified for migration.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-12-08 07:11:09 +00:00
emellor@leeni.uk.xensource.com d96a859929 Don't try and print out the info returned by the server after a restore -- there
isn't any.  Don't try and unpause the restored domain either -- XendCheckpoint
does that.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-07 16:26:07 +00:00
emellor@leeni.uk.xensource.com 5e61562a32 Change configuration handling wrt to the vcpus entry, so that we only see a
vcpus entry in the image section when using VMX, only add VMX options at all
if the builder is vmx, and issue a warning when overriding the global vcpus
setting with the one from the image.

This removes the duplicated vcpus entries in the domain's sxpr.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-07 11:50:55 +00:00
emellor@leeni.uk.xensource.com df964c1d71 Remove one of the multiple occurrences of vcpus in the sxpr. This value is
in ROUNDTRIPPING_CONFIG_ENTRIES, so there is no need for it to be mentioned
explicitly in sxpr() too.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-07 10:51:55 +00:00
kaf24@firebug.cl.cam.ac.uk 32dc1c6ed9 Fix vtpm support in xend.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2005-12-06 12:45:30 +01:00
cl349@firebug.cl.cam.ac.uk abbe050874 Rename set-vcpus to vcpu-set (match docs) and update short help page.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-12-04 17:29:46 +01:00
kaf24@firebug.cl.cam.ac.uk e23e1a21a5 Image.py should send 2 new arguments to qemu-dm for setting QEMU window
Title. 1 is const string "-domain-name", the other is the string of
domain name. At present imagy.py combines these two strings to 1. So
Qemu will fail to recognize it and fail to start.

Signed-off-by: Yongkang You <yongkang.you@intel.com>
2005-12-04 11:57:32 +01:00
kaf24@firebug.cl.cam.ac.uk 5e6cf9a3f2 Enable multiple NICs for vmx domain by configuration file
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
2005-12-03 17:59:37 +01:00
kaf24@firebug.cl.cam.ac.uk f2e2149629 Set the device model windows title as the domain name
This helps when creating multile vmx domain.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@intel.com>
2005-12-03 17:58:31 +01:00
dan@guaranine.beaverton.ibm.com 60d99f7d06 Make "xm list --long" generate device configuration data from xenstore state
instead of internal xend state.
Signed-off-by: Dan Smith <danms@us.ibm.com>
2005-12-02 15:57:24 +00:00
emellor@leeni.uk.xensource.com 9b08b0371d This patch adds a new domain config option, 'cpus' which is a list of
CPUs a domains' vcpus can use.  The older 'cpu' config option is
prepended to the list of cpus to use and will keep the behavior of
pinning VCPU0.

The cpus option supports ranges and negation, so:

cpus = "0-3,5,^1" produces -> [0,2,3,5]

The list is circular, so in a domain with the following config:

vcpus = 4
cpus  = "0,3,7"  # Use any of 0, 3, 7 for this domain.

would see vcpus 0-3 pinned to cpus 0,3,7,0 respectively.

Also, the pin operation is moved before the memory reservation as vcpu
to cpu mapping will be helpful for future NUMA work when trying to
allocate pages close to the physical cpus being used.

An update to the display of cpumap was needed to normalize the cpumap
values to the range of possible cpus.

I've also included some text for the xmdomain.cfg(5) man page.

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
2005-12-02 15:52:47 +00:00
emellor@leeni.uk.xensource.com 13b9e071a3 Remove the watch on the /vm/<uuid> path when rebooting or migrating. We don't
want to end up with multiple watches on the same path, otherwise we get a
watch event storm after many such reboots or migrates.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-02 15:36:39 +00:00
emellor@leeni.uk.xensource.com 6d3895e243 Don't log every time around the big transaction writing the device details.
This transaction may be starved for a short while, and logging inside the while
loop won't help!

Use new xstransact.complete to tidy up one other transaction.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-02 15:35:22 +00:00
emellor@leeni.uk.xensource.com 73f56f3e9b Added xen-hotplug.log to the files to collect.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-02 15:33:38 +00:00
emellor@leeni.uk.xensource.com d3079e2611 Initialise the connection ID when a domain is introduced. This (re)enables
the permission checking in xenstored.

Default the store permissions to read/write nobody (apart from the privileged
domain).  Create a /local node with these permissions, ready for inheriting by
children.  In Xend, create a /vm node with these permissions too, for the same
reason, and set the permissions on /local/domain/<domid> and each device
backend path to allow the guest domain to access these paths appropriately.

Added xstransact.{set_permissions,SetPermissions,mkdir,Mkdir,complete} as
support facilities.

This closes bug #290.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-02 01:34:39 +00:00
emellor@leeni.uk.xensource.com 0172c7181e Use getopt.gnu_getopt rather than getopt.getopt, so that xm list VM --long is
parsed the same as xm list --long VM.  This is only in Python 2.3 -- for
Python 2.2 we keep the old getopt.getopt behaviour.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-02 01:04:09 +00:00
smh22@firebug.cl.cam.ac.uk f96418ce18 Fix migrate.
Signed-off-by: Steven Hand <steven@xensource.com>
2005-12-01 12:27:29 +01:00
emellor@leeni.uk.xensource.com e3d7747349 Move the dom0 ballooning-out code from the xm create handler and into the
server, where it can be used on reboot and migrate as well as create.
Ballooning bugs may still exist (it is unclear) but this is certainly a good
step in the right direction.

Ignore the memory and maxmem entries in the store for dom0 when restarting.
This means that the value in use at the time becomes the configured target.
This should fix the bug whereby dom0_mem settings on the command line are
being overridden by (older) entries in the store.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-01 03:39:23 +00:00
emellor@leeni.uk.xensource.com ccb75f7da6 Work around the fact that the physinfo dom0 call is not implemented for IA64.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-01 03:26:47 +00:00
emellor@leeni.uk.xensource.com 5bc6f1ef3d Added a pages_to_kib function, which converts a page count into a number of
KiB.  This allows us to compute the correct amount to balloon out to support
a migration.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-01 03:19:40 +00:00
emellor@leeni.uk.xensource.com bf5ca2a1fd Added xm rename command. Improve the argument checking and error reporting. 2005-11-30 19:54:28 +00:00
emellor@leeni.uk.xensource.com a0c858f6bf Miscellaneous tidying up, no semantic changes.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-30 19:48:54 +00:00
emellor@leeni.uk.xensource.com 3fba743862 Fix test following uuid format change in changeset 8089.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-30 19:48:21 +00:00
emellor@leeni.uk.xensource.com 57daa6655d Move the relocate.setupRelocation code into XendDomain, removing the mutual
dependency between those two classes.

Split the XendDomain constructor into two pieces so that XendDomainInfo can
call XendDomain.instance even during the initial startup of XendDomain.

These two together mean that there is no need for the horrendous hack using
XendRoot.get_component to pass the singleton instance of XendDomain around.
Both XendRoot.get_component and XendRoot.add_component can go.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-30 19:26:32 +00:00
emellor@leeni.uk.xensource.com fa45226f84 Move the translation from pages to MiB out of XendNode and into the xc layer.
xc has access to the page size for the platform and the Python layer does not,
so there was a hardcoded "/ 256" in there.

Rename the "memory" physinfo parameter to "total_memory", to match the usage
elsewhere.

Tidy the code generating the SXP for xm info.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-30 18:43:00 +00:00
emellor@leeni.uk.xensource.com 9d72feba41 Cope with longs being passed to xstransact.write.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-30 18:38:48 +00:00