CA-94335: Dom0 should be managed in xenopsd before the record is created.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
Make sure that stunnel listens on the right addresses

This may be "all IP addresses" or only localhost, and IPv4 or IPv6.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Simplify management interface management

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
XOP-261: Make the himn_address persistent across reboot.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
XOP-261: Restart stunnel only if conf file changed.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
Open the log file as append rather than write. This saves truncating it in the case of a localhost migrate, loosing the save half of the log.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Remove use of syslog from the C bindings, replacing them with writes to stdout and stderr. The parent of the xenguest fork is already capturing stdout and stderr from libxc, and will pass them on to syslog. This way, the syslog()'d messages will also find their way into xenguest.$DOMID.log.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Implement the save/restore framework for propagaing the Windows Generation ID.

Xenguest being linked directly agianst libxc, the changes are confined to
suitable #ifdefs to allow compilation against multiple versions of Xen.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Don't call VM.stat every time we receive a xapi event on a VM.

VM.stat is expensive as it does lots of xenstore reads - just check that
the VM exists in xenopsd's database instead.

Signed-off-by: John Else <john.else@citrix.com>
Dump xenopsd updates every time we push an update.

Signed-off-by: John Else <john.else@citrix.com>
Sort events properly.

Signed-off-by: John Else <john.else@citrix.com>
CA-87377: Snapshot updates state in inject_barrier

Xapi then receives updates including barrier information from the
updates.get API call. Xapi processes the barriers first, as these
have threads waiting on them.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
CA-87377: Add barriers info to xn diagnostics

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Merge pull request #1062 from vbmithr/CA-87377

CA-87377
Merge pull request #1063 from andyhhp/xenguest-genid

Xenguest Generation ID support for save/restore
Merge pull request #1006 from jeromemaloberti/CA-94335-bis

CA-94335: Dom0 should be managed in xenopsd before the record is created.
XOP-261: Fix xapissl to initially start stunnel.

Signed-off-by: Jerome Maloberti <jerome.maloberti@citrix.com>
CA-100704: Fix xenguest

From http://ocamlunix.forge.ocamlcore.org/ocamlunix.html

The flag list must contain exactly one of the following flags:
O_RDONLY	Open in read-only mode.
O_WRONLY	Open in write-only mode.
O_RDWR		Open in read and write mode.

So I've added exactly one of those flags!

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Merge pull request #1065 from jonludlam/CA-100704

CA-100704: Fix xenguest
Merge pull request #1064 from jeromemaloberti/XOP-261-dev

CA-96936/XOP-261: Reinstate the server on 127.0.0.1 when no management interface is defined