CA-49835: vm-import CLI error output keys wrong way around

Signed-off-by: Rok Strnisa <rok.strnisa@citrix.com>
[events]: remove the 'max_event_age': clients shouldn't be penalised for delays between event.next() calls

It should be possible for a single-threaded client to call event.next() round-robin on 1000s of pools.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[events]: remove dead code

The code to coalesce events in the queue was never turned on and is made redundant by the new events.from() behaviour

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[events]: have separate predicates for 'this exact event matches my filters' and 'events from this table may possibly match my filters'

The two predicates are:
  event_matches: subscription list -> event -> bool
  table_matches: subscription list -> string -> bool

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[events]: add object-level event registrations

The event registration syntax is now :=
 | *                   -- everything
 | Class               -- all events for all instances of Class
 | Class/Objref        -- only events for Objref

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[event]: add marshal/unmarshal helper functions and types to event_types for event.from() (there are already some for event.next())

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[events]: add quicktest tests for event.next() and event.from()

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
[events]: add an object-level event test, hook all new tests into quicktest

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
CA-48775: xe vm-pause and xe vm-unpause require uuid

This commit removed uuid from the required parameters of the two CLI
operations, which allows them to accept the standard VM selectors.

Signed-off-by: Rok Strnisa <rok.strnisa.com>
[WHITESPACE] Improve whitespace consistency.
CA-71770: More user friendly error message when enabling HA with an SR that does not exist.
CA-75710: check for more recent PV tools isos on-demand, rather than relying on the startup sequence

Unfortunately the startup-sequence was populating the cached version *after* all the running VMs were checked to see if they had up-to-date drivers.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Merge commit '2569305033d0f9505f7fb3ed34edf37d0ac37a4a'
networkd: implement Bridge.get_interfaces

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
networkd: extend Bridge.get_ports

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
networkd: add get ports from cache

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
networkd: listen on localhost TCP port (for debugging)

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
networkd: add Bridge.get_{all_}bonds

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
networkd: add Interface.exists

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
monitor: get stats/metrics for bond from underlying interface stats

...rather than from the linux bond interface. This is needed, because,
for the ovs, we want to get rid of the "fake" bond interface, which
was introduced only for compatility reasons (the interface is used only
for stats collection, and is no good for anything else).

This also gives us an opportunity to redefine the PIF_metrics for bonds
in xapi itself. The fields are now defined as follows:

* vendor_id, device_id: empty string
* speed: the sum of the speeds of the bonded interfaces
* duplex: the "minimum" duplex of the bonded interfaces
* carrier: logical OR of the carriers of the bonded interfaces
* pci_bus_path: empty string

The tx/rx metrics for the RRDs are the sums of these metrics of the
bonded interfaces.

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