Start SMAPIv1 proxies listening for requests via the message switch
Fix SMAPIv1 backwards compatibility on pool slaves

The two facts:
  Only the master should list the SM plugins directly.
  When the proxies are being started up on the master, the SM database
    records haven't been created.

Imply that we should query Sm.* when running on the master, but use
the SM database records on the slave.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
All SMAPI access is now routed through the xcp-idl client code

If we have message switch enabled then it will be used, otherwise
we still use unix domain sockets.

Note the special-case handling of SR.probe.

Signed-off-by: David Scott <dave.scott@citrix.com>
storage: create per-SR unix domain sockets in storage.d/<name>

This avoids clashing with the global unix domain socket 'storage'

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
message-switch: explicitly specify which xenopsd instance we want

Normally we use the 'default' one but this policy could be refined later.

Signed-off-by: David Scott <dave.scott@citrix.com>
lspci: look in both /sbin/lspci and /usr/bin/lspci

Ideally we should use $PATH-- forkexecd should do this if asked
to execute a relative filename. In the short-term, cope with both
CentOS and Ubuntu paths.

Signed-off-by: David Scott <dave.scott@citrix.com>
Add a test for event inject

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Fix a defect where event.from can go into a tight loop

This puts the subscription check into the inner loop
of the event.from rather than when gathering the
snapshots. This fixes a problem where xapi would go into
a tight loop when subscribed to a particular objects
events and a different object of the same class was
updated. This tight loop also wouldn't perform the
session check so logging out the session wouldn't cause
the call to return.

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
If we're not using the message switch, there can be only one xenopsd.

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Ignore new artifacts of OUnit2 test runs

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge pull request #1748 from jonludlam/event-problems

Event problems
Merge pull request #1749 from simonjbeaumont/ignore-ounit-cruft

Ignore new artifacts of OUnit2 test runs
Convert test suite to OUnit2 before running

This is needed since running an OUnit 1.x test suite using OUnit2 installed
does not return non-zero exit code even on failure or error.

Converting the suite at this point is desirable in favour of converting all the
tests because we can keep writing tests using OUnit 1.x style, making them
backportable to old build environments without OUnit2 (and without this patch).

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
arm: robustify the parsing of /proc/cpuinfo

We should not expect there to be x86-only keys. We should ignore any lines
which don't have the 'key: value' format.

Signed-off-by: David Scott <dave.scott@citrix.com>
arm: don't fail (float_of_string) if some /proc/cpuinfo keys are missing

Signed-off-by: David Scott <dave.scott@citrix.com>
Unit tests: Don't attempt to talk to squeezed

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Disable test case that uses API call

The mock API feature is not quite feature-full to fully mock API calls as this
test case attempts to make use of. There is a Helpers.call_api_functions
(indirectly) in the codepath which fails since the mock database created does
not persist as far as the server that handles the API call.

We'll disable this test for now which is error-ing (not failing) until we have
time to properly provide a mock API.

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
Merge pull request #1751 from simonjbeaumont/fix-ounit-tests

Convert test suite to OUnit2 before running
Remove last use of Re_str from xapi

Signed-off-by: Jon Ludlam <jonathan.ludlam@citrix.com>
Merge pull request #1766 from jonludlam/remove_re_str

Remove last use of Re_str from xapi