* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
a device from two guests, or from dom 0 and a guest, can destroy the filesystem,
and this check prevents that. This should ensure that the xm tests
11_block_attach_shared_dom0 and 12_block_attach_shared_domU should pass.
Closes bug #331.
Devices may be shared only if all uses are read-only. If anyone has read-write
access to a device, then no sharing is allowed.
The mode in the config file may now have an exclamation mark appended, to
indicate that devices may be shared (i.e. that this new check should be
bypassed). This supports some network block devices, but is clearly dangerous
and should only be used when you know what you are doing.
The mode specified in the config file is now written explicitly to the store,
To implement this, the blkback driver has been changed to create two entries
in /sys describing each device in use. This means that we can determine which
devices are in use without crawling through the store.
The physical-device node has been changed to give the major and minor of the
device, separated by a colon. This means that we do not need to pack these
numbers into one, removing the restriction to 8 bit minors that we had in place
before.
The mode specified in the config file is now written explicitly to the store,
rather than using the presence or absence of a read-only node. This supports
the write-sharing override above.
If the device is in use, a new hotplug status of "busy" is written to the
store, and a message is written to a new hotplug-error node. Xend uses these
things for diagnosis.
The block scripts do not need to handle online or offline events, so this
support has been removed. These scripts can be called twice, depending upon
the hotplug config, so they now identify the second run and do not attempt to
set up the device again.
The device directories in the store are cleaned out before new details are
written there. This prevents stale information from messing up block device
hotplugging. This will be one cause of "blkback: changing physical device
not supported" messages.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
splicing the strings together manually.
Replace the word "bogus" with the command in question where it appears, as this
shows up in the Usage statements.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
again. Closes bug #397.
To perform this check in the same transaction as the writing of the device
entries has required a little bit of rejigging.
Signed-off-by: Ewan Mellor <ewan@xensource.com>