Fix commit 29c1e913e459058c12d02b3f4b767b3dd428a498

This patch fixes changes done in commit 29c1e913e459058c12d02b3f4b767b3
that was pushed without implementing review feedback.

The flag introduced by the patch is changed to VIR_DOMAIN_VCPU_GUEST and
documentation makes the difference between regular hotplug and this new
functionality more explicit.

The virsh options that enable the use of the new flag are changed to
"--guest" and the documentation is fixed too.
storage: fix description of versionOffset
virSocketAddrIsWildcard: Use IN6_IS_ADDR_UNSPECIFIED correctly

The IN6_IS_ADDR_UNSPECIFIED macro expects pointer to sin6_addr element
instead of s6_addr element.
storage_backend: Drop unused code

This has been disabled for years
selinux: assume 's0' if the range is empty

This fixes a crash:
https://bugzilla.redhat.com/show_bug.cgi?id=969878
qemu: Fix memory leak in Prepare phase

Avoid leaking virDomainDef if Prepare phase fails before it gets to
qemuMigrationPrepareAny.
qemu_migrate: Dispose listen address if set from config

https://bugzilla.redhat.com/show_bug.cgi?id=971485

As of d7f9d827531bc843b7c5aa9d3e8c08738a1de248 we copy the listen
address from the qemu.conf config file in case none has been provided
via XML. But later, when migrating, we should not include such listen
address in the migratable XML as it is something autogenerated, not
requested by user. Moreover, the binding to the listen address will
likely fail, unless the address is '0.0.0.0' or its IPv6 equivalent.
This patch introduces a new boolean attribute to virDomainGraphicsListenDef
to distinguish autofilled listen addresses. However, we must keep the
attribute over libvirtd restarts, so it must be kept within status XML.
qemu: Cancel migration if guest encoutners I/O error while migrating

During a live migration the guest may receive a disk access I/O error.
In this state the guest is unable to continue running on a remote host
after migration as some state may be present in the kernel and not
migrated.

With this patch, the migration is canceled in such case so it can either
continue on the source if the I/O issues are recovered or has to be
destroyed anyways.
qemu: Forbid migration of machines with I/O errors

Such machine can't be successuflly migrated unles the I/O error has
recovered and might lead to data corruption. Forbid this kind of
migration.
libvirt_private.syms: add virProcessGetStartTime

https://bugzilla.redhat.com/show_bug.cgi?id=973543
nodedev: fix vport detection for FC HBA

Use the host number as the host number when constructing the sysfs path
instead of the variable we are trying to fill.

https://bugzilla.redhat.com/show_bug.cgi?id=973543
schema: simplify RNG pattern, remove superfluous <optional>
libxl: Report connect type as Xen

Currently, the libxl driver reports a connection type of "xenlight".
To be compatible with the legacy Xen driver, it should return "Xen".

Note: I noticed this while testing the libxl driver on OpenStack.
After switching my Xen compute nodes to use the libxl stack, I
could no longer launch instances on those nodes since
hypervisor_type was reported as "xenlight" instead of "xen".
libxl: set bootloader for PV domains if not specified

The legacy xen toolstack will set pygrub as the bootloader if not
specified.  For compatibility, do the same in the libxl driver
iff not using direct kernel boot.
configure: Remove unused brctl check

brctl isn't used anywhere AFAICT
qemu: allow restore with non-migratable XML input

Convert input XML to migratable before using it in
qemuDomainSaveImageOpen.

XML in the save image is migratable, i.e. doesn't contain implicit
controllers. If these controllers were in a non-default order in the
input XML, the ABI check would fail. Removing and re-adding these
controllers fixes it.

https://bugzilla.redhat.com/show_bug.cgi?id=834196
libxl: allow only 'ethernet' and 'bridge' interfaces, allow script there

Actually only those interface types are handled correctly so reject
others instead of ignoring settings (i.e. treating as bridge/ethernet
anyway).
Also allow <script/> in 'ethernet' (which should be the only
script-allowing type). Keep <script/> allowed in bridge to be compatible
with legacy 'xen' driver.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Implement dispose method for libxlDomainObjPrivate

When creating a timer/event handler reference counting is used. So it could
be possible (in theory) that libxlDomainObjPrivateFree is called with
reference counting >1. The problem is that libxlDomainObjPrivateFree leave
the object in an invalid state with ctx freed (but still having dandling
pointer). This can lead timer/event handler to core.

This patch implements a dispose method for libxlDomainObjPrivate, and moves
freeing the libxl ctx to the dispose method, ensuring the ctx is valid while
the object's reference count is > 0.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
remote: Forbid default "/session" connections when using ssh transport

Without the socket path explicitly specified, the remote driver tried to
connect to the "/system" instance socket even if "/session" was
specified in the uri. With this patch this configuration now produces an
error.

It is still possible to initiate a session connection with specifying
the path to the socket manually and also manually starting the session
daemon. This was also possible prior to this patch,

This is a minimal fix. We may decide to support remote session
connections using ssh but this will require changes to the remote driver
code so this fix shouldn't cause regressions in the case we decide to do
that.
remote: Fix client crash when URI path is empty when using ssh

The parsed path in the URI may be NULL resulting into:

  $ virsh -c qemu+ssh:// list
  Segmentation fault (core dumped)

Introduced by 22d81ceb46ea4b83ad817c29b2b04df27a09c671