]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
8 years agoqemu: update tests to not assume dmi-to-pci-bridge is always added
Laine Stump [Fri, 11 Nov 2016 17:14:02 +0000 (12:14 -0500)]
qemu: update tests to not assume dmi-to-pci-bridge is always added

A few of the qemu test cases assume that a dmi-to-pci-bridge will
always be added at index 1, and so they omit it from the input data
even though a pci-bridge is present at index 2, e.g.:

   <controller type='pci' index='0' model='pcie-root'/>
   <controller type='pci' index='2' model='pci-bridge'/>

Support for this odd practice was discussed on libvir-list and we
decided that the complex code required to make this continue was not
worth the headache of maintaining. So instead, this patch modifies the
test cases to manually add a dmi-to-pci-bridge at index 1 (since an
upcoming patch is going to eliminate the unconditional adding of
dmi-to-pci-bridge).

Because the auto-add was placing the dmi-to-pci-bridge later in the
list (even though it has a lower index) the test output is also
updated to take account for the new order (which puts the pci
controllers in index-order)

8 years agoqemu: auto-add pcie-root-port/dmi-to-pci-bridge controllers as needed
Laine Stump [Mon, 19 Sep 2016 18:38:47 +0000 (14:38 -0400)]
qemu: auto-add pcie-root-port/dmi-to-pci-bridge controllers as needed

Previously libvirt would only add pci-bridge devices automatically
when an address was requested for a device that required a legacy PCI
slot and none was available. This patch expands that support to
dmi-to-pci-bridge (which is needed in order to add a pci-bridge on a
machine with a pcie-root), and pcie-root-port (which is needed to add
a hotpluggable PCIe device). It does *not* automatically add
pcie-switch-upstream-ports or pcie-switch-downstream-ports (and
currently there are no plans for that).

Given the existing code to auto-add pci-bridge devices, automatically
adding pcie-root-ports is fairly straightforward. The
dmi-to-pci-bridge support is a bit tricky though, for a few reasons:

1) Although the only reason to add a dmi-to-pci-bridge is so that
   there is a reasonable place to plug in a pci-bridge controller,
   most of the time it's not the presence of a pci-bridge *in the
   config* that triggers the requirement to add a dmi-to-pci-bridge.
   Rather, it is the presence of a legacy-PCI device in the config,
   which triggers auto-add of a pci-bridge, which triggers auto-add of
   a dmi-to-pci-bridge (this is handled in
   virDomainPCIAddressSetGrow() - if there's a request to add a
   pci-bridge we'll check if there is a suitable bus to plug it into;
   if not, we first add a dmi-to-pci-bridge).

2) Once there is already a single dmi-to-pci-bridge on the system,
   there won't be a need for any more, even if it's full, as long as
   there is a pci-bridge with an open slot - you can also plug
   pci-bridges into existing pci-bridges. So we have to make sure we
   don't add a dmi-to-pci-bridge unless there aren't any
   dmi-to-pci-bridges *or* any pci-bridges.

3) Although it is strongly discouraged, it is legal for a pci-bridge
   to be directly plugged into pcie-root, and we don't want to
   auto-add a dmi-to-pci-bridge if there is already a pci-bridge
   that's been forced directly into pcie-root.

Although libvirt will now automatically create a dmi-to-pci-bridge
when it's needed, the code still remains for now that forces a
dmi-to-pci-bridge on all domains with pcie-root (in
qemuDomainDefAddDefaultDevices()). That will be removed in a future
patch.

For now, the pcie-root-ports are added one to a slot, which is a bit
wasteful and means it will fail after 31 total PCIe devices (30 if
there are also some PCI devices), but helps keep the changeset down
for this patch. A future patch will have 8 pcie-root-ports sharing the
functions on a single slot.

8 years agoqemu: only force an available legacy-PCI slot on domains with pci-root
Laine Stump [Mon, 19 Sep 2016 18:17:59 +0000 (14:17 -0400)]
qemu: only force an available legacy-PCI slot on domains with pci-root

Andrea had the right idea when he disabled the "reserve an extra
unused slot" bit for aarch64/virt. For *any* PCI Express-based
machine, it is pointless since 1) an extra legacy-PCI slot can't be
used for hotplug, since hotplug into legacy PCI slots doesn't work on
PCI Express machinetypes, and 2) even for "coldplug" expansion,
everybody will want to expand using Express controllers, not legacy
PCI.

This patch eliminates the extra slot reserve unless the system has a
pci-root (i.e. legacy PCI)

8 years agoqemu: assign nec-xhci (USB3) controller to a PCIe address when appropriate
Laine Stump [Sun, 14 Aug 2016 05:58:11 +0000 (01:58 -0400)]
qemu: assign nec-xhci (USB3) controller to a PCIe address when appropriate

The nec-usb-xhci device (which is a USB3 controller) has always
presented itself as a PCI device when plugged into a legacy PCI slot,
and a PCIe device when plugged into a PCIe slot, but libvirt has
always auto-assigned it to a legacy PCI slot.

This patch changes that behavior to auto-assign to a PCIe slot on
systems that have pcie-root (e.g. Q35 and aarch64/virt).

Since we don't yet auto-create pcie-*-port controllers on demand, this
means a config with an nec-xhci USB controller that has no PCI address
assigned will also need to have an otherwise-unused pcie-*-port
controller specified:

   <controller type='pci' model='pcie-root-port'/>
   <controller type='usb' model='nec-xhci'/>

(this assumes there is an otherwise-unused slot on pcie-root to accept
the pcie-root-port)

8 years agoqemu: assign e1000e network devices to PCIe slots when appropriate
Laine Stump [Mon, 8 Aug 2016 09:23:57 +0000 (05:23 -0400)]
qemu: assign e1000e network devices to PCIe slots when appropriate

The e1000e is an emulated network device based on the Intel 82574,
present in qemu 2.7.0 and later. Among other differences from the
e1000, it presents itself as a PCIe device rather than legacy PCI. In
order to get it assigned to a PCIe controller, this patch updates the
flags setting for network devices when the model name is "e1000e".

(Note that for some reason libvirt has never validated the network
device model names other than to check that there are no dangerous
characters in them. That should probably change, but is the subject of
another patch.)

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

8 years agoqemu: assign virtio devices to PCIe slot when appropriate
Laine Stump [Sat, 13 Aug 2016 22:10:41 +0000 (18:10 -0400)]
qemu: assign virtio devices to PCIe slot when appropriate

libvirt previously assigned nearly all devices to a "hotpluggable"
legacy PCI slot even on machines with a PCIe root bus (and even though
most such machines don't even support hotplug on legacy PCI slots!)
Forcing all devices onto legacy PCI slots means that the domain will
need a dmi-to-pci-bridge (to convert from PCIe to legacy PCI) and a
pci-bridge (to provide hotpluggable legacy PCI slots which, again,
usually aren't hotpluggable anyway).

To help reduce the need for these legacy controllers, this patch tries
to assign virtio-1.0-capable devices to PCIe slots whenever possible,
by setting appropriate connectFlags in
virDomainCalculateDevicePCIConnectFlags(). Happily, when that function
was written (just a few commits ago) it was created with a
"virtioFlags" argument, set by both of its callers, which is the
proper connectFlags to set for any virtio-*-pci device - depending on
the arch/machinetype of the domain, and whether or not the qemu binary
supports virtio-1.0, that flag will have either been set to PCI or
PCIe. This patch merely enables the functionality by setting the flags
for the device to whatever is in virtioFlags if the device is a
virtio-*-pci device.

NB: the first virtio video device will be placed directly on bus 0
slot 1 rather than on a pcie-root-port due to the override for primary
video devices in qemuDomainValidateDevicePCISlotsQ35(). Whether or not
to change that is a topic of discussion, but this patch doesn't change
that particular behavior.

NB2: since the slot must be hotpluggable, and pcie-root (the PCIe root
complex) does *not* support hotplug, this means that suitable
controllers must also be in the config (i.e. either pcie-root-port, or
pcie-downstream-port). For now, libvirt doesn't add those
automatically, so if you put virtio devices in a config for a qemu
that has PCIe-capable virtio devices, you'll need to add extra
pcie-root-ports yourself. That requirement will be eliminated in a
future patch, but for now, it's simple to do this:

   <controller type='pci' model='pcie-root-port'/>
   <controller type='pci' model='pcie-root-port'/>
   <controller type='pci' model='pcie-root-port'/>
   ...

Partially Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1330024

8 years agoqemu: set pciConnectFlags to 0 instead of PCI|HOTPLUGGABLE if device isn't PCI
Laine Stump [Fri, 7 Oct 2016 22:08:13 +0000 (18:08 -0400)]
qemu: set pciConnectFlags to 0 instead of PCI|HOTPLUGGABLE if device isn't PCI

This patch cleans up the connect flags for certain types/models of
devices that aren't PCI to return 0. In the future that may be used as
an indicator to the caller about whether or not a device needs a PCI
address. For now it's just ignored, except for in
virDomainPCIAddressEnsureAddr() - called during device hotplug - (and
in some cases actually needs to be re-set to PCI|HOTPLUGGABLE just in
case someone (in some old config) has manually set a PCI address for a
device that isn't PCI.

8 years agoqemu: set/use proper pciConnectFlags during hotplug
Laine Stump [Wed, 7 Sep 2016 16:29:30 +0000 (12:29 -0400)]
qemu: set/use proper pciConnectFlags during hotplug

Before now, all the qemu hotplug functions assumed that all devices to
be hotplugged were legacy PCI endpoint devices
(VIR_PCI_CONNECT_TYPE_PCI_DEVICE). This worked out "okay", because all
devices *are* legacy PCI endpoint devices on x86/440fx machinetypes,
and hotplug didn't work properly on machinetypes using PCIe anyway
(hotplugging onto a legacy PCI slot doesn't work, and until commit
b87703cf any attempt to manually specify a PCIe address for a
hotplugged device would be erroneously rejected).

This patch makes all qemu hotplug operations honor the pciConnectFlags
set by the single all-knowing function
qemuDomainDeviceCalculatePCIConnectFlags(). This is done in 3 steps,
but in a single commit since we would have to touch the other points
at each step anyway:

1) add a flags argument to the hypervisor-agnostic
virDomainPCIAddressEnsureAddr() (previously it hardcoded
..._PCI_DEVICE)

2) add a new qemu-specific function qemuDomainEnsurePCIAddress() which
gets the correct pciConnectFlags for the device from
qemuDomainDeviceConnectFlags(), then calls
virDomainPCIAddressEnsureAddr().

3) in qemu_hotplug.c replace all calls to
virDomainPCIAddressEnsureAddr() with calls to
qemuDomainEnsurePCIAddress()

So in effect, we're putting a "shim" on top of all calls to
virDomainPCIAddressEnsureAddr() that sets the right pciConnectFlags.

8 years agoqemu: set/use info->pciConnectFlags when validating/assigning PCI addresses
Laine Stump [Mon, 5 Sep 2016 02:14:40 +0000 (22:14 -0400)]
qemu: set/use info->pciConnectFlags when validating/assigning PCI addresses

Set pciConnectFlags in each device's DeviceInfo and then use those
flags later when validating existing addresses in
qemuDomainCollectPCIAddress() and when assigning new addresses with
qemuDomainPCIAddressReserveNextAddr() (rather than scattering the
logic about which devices need which type of slot all over the place).

Note that the exact flags set by
qemuDomainDeviceCalculatePCIConnectFlags() are different from the
flags previously set manually in qemuDomainCollectPCIAddress(), but
this doesn't matter because all validation of addresses in that case
ignores the setting of the HOTPLUGGABLE flag, and treats PCIE_DEVICE
and PCI_DEVICE the same (this lax checking was done on purpose,
because there are some things that we want to allow the user to
specify manually, e.g. assigning a PCIe device to a PCI slot, that we
*don't* ever want libvirt to do automatically. The flag settings that
we *really* want to match are 1) the old flag settings in
qemuDomainAssignDevicePCISlots() (which is HOTPLUGGABLE | PCI_DEVICE
for everything except PCI controllers) and 2) the new flag settings
done by qemuDomainDeviceCalculatePCIConnectFlags() (which are
currently exactly that - HOTPLUGGABLE | PCI_DEVICE for everything
except PCI controllers).

8 years agoqemu: new functions to calculate/set device pciConnectFlags
Laine Stump [Sun, 4 Sep 2016 20:03:57 +0000 (16:03 -0400)]
qemu: new functions to calculate/set device pciConnectFlags

The lowest level function of this trio
(qemuDomainDeviceCalculatePCIConnectFlags()) aims to be the single
authority for the virDomainPCIConnectFlags to use for any given device
using a particular arch/machinetype/qemu-binary.

qemuDomainFillDevicePCIConnectFlags() sets info->pciConnectFlags in a
single device (unless it has no virDomainDeviceInfo, in which case
it's a NOP).

qemuDomainFillAllPCIConnectFlags() sets info->pciConnectFlags in all
devices that have a virDomainDeviceInfo

The latter two functions aren't called anywhere yet. This commit is
just making them available. Later patches will replace all the current
hodge-podge of flag settings with calls to this single authority.

8 years agoqemu: new functions qemuDomainMachineHasPCI[e]Root()
Laine Stump [Sat, 3 Sep 2016 01:41:43 +0000 (21:41 -0400)]
qemu: new functions qemuDomainMachineHasPCI[e]Root()

These functions provide a simple one line method of learning if the
current domain has a pci-root or pcie-root bus.

8 years agovz: fixed migration in p2p mode
Pavel Glushchak [Mon, 14 Nov 2016 15:20:30 +0000 (18:20 +0300)]
vz: fixed migration in p2p mode

dom xml generated on begin step should be passed
to perform step in VIR_MIGRATE_PARAM_DEST_XML parameter.
Otherwise 'XML error: failed to parse xml document' is
raised on destination host as dom xml is NULL.

Signed-off-by: Pavel Glushchak <pglushchak@virtuozzo.com>
8 years agotools: Replace vshPrint with vshPrintExtra on places we forgot about
Erik Skultety [Fri, 4 Nov 2016 14:22:26 +0000 (15:22 +0100)]
tools: Replace vshPrint with vshPrintExtra on places we forgot about

Although there already was an effort (b620bdee) to replace vshPrint occurrences
with vshPrintExtra due to '--quiet' flag, there were still some leftovers. So
this patch fixes them, hopefully for good.

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

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agotools: use vshError rather than vshPrint on failure
Erik Skultety [Fri, 4 Nov 2016 14:21:31 +0000 (15:21 +0100)]
tools: use vshError rather than vshPrint on failure

There were a few places in our virsh* code where instead of calling vshError
on failure we called vshPrint.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agostorage.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
storage.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agomigration.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
migration.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agologging.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
logging.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agolocking-sanlock.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
locking-sanlock.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agolocking-lockd.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
locking-lockd.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agorpc.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
rpc.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agolocking.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
locking.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agocommand.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
command.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoformatstorageencryption.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
formatstorageencryption.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoformatstorage.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
formatstorage.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoformatsecret.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
formatsecret.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoformatnwfilter.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
formatnwfilter.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoformatnetwork.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
formatnetwork.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoformatdomain.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
formatdomain.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoformatcaps.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
formatcaps.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoformat.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
format.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agodrvlxc.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
drvlxc.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agodrvesx.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
drvesx.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agodrvbhyve.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
drvbhyve.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agodownloads.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
downloads.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agodevguide.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
devguide.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agocompiling.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
compiling.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agocgroups.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
cgroups.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoaclpolkit.html.in: Kill useless spaces in <pre/>
Michal Privoznik [Fri, 11 Nov 2016 22:40:27 +0000 (23:40 +0100)]
aclpolkit.html.in: Kill useless spaces in <pre/>

The <pre/> section is rendered as-is on the page. That is, if all
the lines are prefixed with 4 spaces the rendered page will also
have them. Problem is if we put a box around such <pre/> because
the content might not fix into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemuDomainAttachNetDevice: Avoid @originalError leak
Michal Privoznik [Fri, 11 Nov 2016 15:30:51 +0000 (16:30 +0100)]
qemuDomainAttachNetDevice: Avoid @originalError leak

Coverity identified that this variable might be leaked. And it's
right. If an error occurred and we have to roll back the control
jumps to try_remove label where we save the current error (see
0e82fa4c34 for more info). However, inside the code a jump onto
other label is possible thus leaking the error object.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoadmin: Use the newly introduced close callback handling helpers
Erik Skultety [Thu, 10 Nov 2016 12:21:29 +0000 (13:21 +0100)]
admin: Use the newly introduced close callback handling helpers

Use the newly introduced close callback helpers to make the code look just a
bit cleaner and more importantly, to fix the following memleak regarding a
dangling virAdmConnect object reference caused by assigning NULL to the close
callback data once the catch-disconnect routine used the callback followed
by a comparison of NULL to the originally defined close callback (which at that
moment had already been NULL'd by remoteAdminClientCloseFunc) in
virAdmConnectCloseCallbackUnregister.

717 (88 direct, 629 indirect) bytes in 1 blocks are definitely lost record
 110 of 141
    at 0x4C2A988: calloc (vg_replace_malloc.c:711)
    by 0x530696F: virAllocVar (viralloc.c:560)
    by 0x53689E6: virObjectNew (virobject.c:193)
    by 0x5368B5E: virObjectLockableNew (virobject.c:219)
    by 0x4E3E7EE: virAdmConnectNew (datatypes.c:900)
    by 0x4E398BB: virAdmConnectOpen (libvirt-admin.c:220)
    by 0x10D3E3: vshAdmConnect (virt-admin.c:161)
    by 0x10D624: vshAdmReconnect (virt-admin.c:215)
    by 0x10DB0A: cmdConnect (virt-admin.c:353)
    by 0x11288F: vshCommandRun (vsh.c:1313)
    by 0x10FDB6: main (virt-admin.c:1439)

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

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agodatatypes: Introduce some admin-related close callback handling helpers
Erik Skultety [Thu, 10 Nov 2016 12:20:26 +0000 (13:20 +0100)]
datatypes: Introduce some admin-related close callback handling helpers

Well, there were three different spots where closeCallback->freeCallback was
called, not looking the same --> potential for bugs - and there indeed is a bug
with refcounting of the @conn object. So this patch partially follows the path
set by commit 24dbb69f by introducing some close callback helpers both to
replace all the spots where we call clean the close callback data with a
dedicated function and to be able to fix the refcounting bug causing a memleak.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agoadmin: Remove unnecessary @conn object locking
Erik Skultety [Thu, 10 Nov 2016 12:32:41 +0000 (13:32 +0100)]
admin: Remove unnecessary @conn object locking

The only place we change the @conn object is actually virAdmConnectOpen
routine, thus at the moment we don't really need to lock it, given the fact that
what we're trying to do here is to change the closeCallback object which is a
lockable object itself, so that should be enough to avoid races.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agovsh: Drop conditional error reporting in vshErrorHandler
Erik Skultety [Wed, 9 Nov 2016 11:20:46 +0000 (12:20 +0100)]
vsh: Drop conditional error reporting in vshErrorHandler

First, since commit 834c5720 the error reporting within the vshErrorHandler
doesn't work because there was a lot of renaming going on (dull mechanical
renaming without much thinking about it, yep - shame on me) and so the original
env variable VIRSH_DEBUG got renamed to VSH_DEBUG which we don't support nor
document anywhere. Second, by specifying this env variable, the last libvirt
error gets reported twice despite the fact we say the error reporting should be
deferred until the command finishes, and last but not least the vintage code's
logic is a bit 'odd', since the error would get reported iff the env variable
is set, even if the value should be equal to our DEFAULT value in which case it
doesn't make sense that we behave differently when an env variable is set to
some value and when there's no env variable at all but we use the same value
automatically as default.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agobuild: update to latest gnulib
Eric Blake [Thu, 15 Sep 2016 20:12:52 +0000 (15:12 -0500)]
build: update to latest gnulib

In particular, pull in gnulib's fix for the broken SIZE_MAX on s390.

* .gnulib: Update to latest.
* bootstrap: Resync to upstream.

Signed-off-by: Eric Blake <eblake@redhat.com>
8 years agoCleanup switch statements on the hostdev subsystem type
Eric Farman [Tue, 8 Nov 2016 18:26:23 +0000 (13:26 -0500)]
Cleanup switch statements on the hostdev subsystem type

As was suggested in an earlier review comment[1], we can
catch some additional code points by cleaning up how we use the
hostdev subsystem type in some switch statements.

[1] End of https://www.redhat.com/archives/libvir-list/2016-September/msg00399.html

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
Signed-off-by: John Ferlan <jferlan@redhat.com>
8 years agovsh: Fix the incorrect environment variable prefix in error message
Erik Skultety [Fri, 11 Nov 2016 12:39:45 +0000 (13:39 +0100)]
vsh: Fix the incorrect environment variable prefix in error message

Unlike the other error messages in vshInitDebug, this one relied on a hardcoded
name of a variable instead of using the prefix of the tool calling the init
routine.

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

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agodocs: remove bogus line-height override
Daniel P. Berrange [Tue, 8 Nov 2016 16:50:13 +0000 (16:50 +0000)]
docs: remove bogus line-height override

The default browser line height is fine. Overriding it
causes <pre> blocks inside a <dl> to have enourmous
spacing.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: add some content to the XML format main page
Daniel P. Berrange [Tue, 8 Nov 2016 11:35:20 +0000 (11:35 +0000)]
docs: add some content to the XML format main page

The XML format main page has never had any content in it,
relying on the left navbar to provide links to the XML
schema pages. Since the navbar is gone, the page needs
to have some content created, otherwise it is useless.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: remove outdated or duplicated content
Daniel P. Berrange [Mon, 31 Oct 2016 11:23:50 +0000 (11:23 +0000)]
docs: remove outdated or duplicated content

Remove a bunch of pages which are either outdated, have no
content, or duplicate content better described elsewhere
in the site or wiki.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: remove navigation sidebar from pages
Daniel P. Berrange [Mon, 31 Oct 2016 11:25:26 +0000 (11:25 +0000)]
docs: remove navigation sidebar from pages

A combination of the index page, top nav bar and docs.html page
provide links to all pages on the site. The left hand nav bar
is thus redundant and can be removed to provide a simpler style
for the site.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: fill out docs page with useful links
Daniel P. Berrange [Mon, 31 Oct 2016 11:29:21 +0000 (11:29 +0000)]
docs: fill out docs page with useful links

The docs page is currently completely empty. Fill it in with
links to the various documentation, categorized as to whether
it is targetting people deploying libvirt, application
developers using libvirt, or people working on libvirt
itself.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: add some improved styling to contact page
Daniel P. Berrange [Mon, 31 Oct 2016 11:36:20 +0000 (11:36 +0000)]
docs: add some improved styling to contact page

Change the contact page styling to better distinguish the
various mailing lists.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: expand downloads page to cover all modules
Daniel P. Berrange [Mon, 31 Oct 2016 11:27:27 +0000 (11:27 +0000)]
docs: expand downloads page to cover all modules

Previously the download page only covered the main libvirt
module and the app dev guide. Expand it to provide direct
links to all artifacts published by the project, whether
the main library, language bindings, docs, or testing.

Tweak the top table styling to better fit in with new
branding.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: rewrite content on front page to be more useful
Daniel P. Berrange [Wed, 26 Oct 2016 08:37:06 +0000 (10:37 +0200)]
docs: rewrite content on front page to be more useful

The front page contains a bunch of content that is either
outdated (eg links to libvirt qpid) or not particularly
useful (links to vendor hypervisor sites).

This rewrites it to be more directly useful to visitors,
providing a updated intro to libvirt project, direct
links to key pieces of website content (new contributors
guide, security process, bug reporting, XML formats), and
feed showing recent 5 blog posts on the virt tools planet.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoRevert "syntax-check: Enforce <code> inside <dt> elements"
Daniel P. Berrange [Mon, 31 Oct 2016 12:04:54 +0000 (12:04 +0000)]
Revert "syntax-check: Enforce <code> inside <dt> elements"

This reverts commit 1f29f3da065ef12d3ec39c3c673186f8ea6d764e.

Assuming <dt> is always used to document symbols is way too
broad, requiring far too many exemptions to be marked to
avoid syntax check rules.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: remove related links page
Daniel P. Berrange [Tue, 25 Oct 2016 15:32:37 +0000 (17:32 +0200)]
docs: remove related links page

The related links page is either horribly outdated, or duplicating
stuff already linked elsewhere.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: remove todo page
Daniel P. Berrange [Tue, 25 Oct 2016 15:31:32 +0000 (17:31 +0200)]
docs: remove todo page

The todo page used to be auto-generated from bugzilla but is
no longer used.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: add three core links in the header bar
Daniel P. Berrange [Tue, 25 Oct 2016 15:27:10 +0000 (17:27 +0200)]
docs: add three core links in the header bar

Add links to download, communicate and learn in the
header bar, as the main jumping off points for
navigation.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: add page describing contribution to libvirt
Daniel P. Berrange [Mon, 31 Oct 2016 11:48:12 +0000 (11:48 +0000)]
docs: add page describing contribution to libvirt

Add a page that describes what contributions libvirt is
looking for and how to get involved.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: simplify style for headers
Daniel P. Berrange [Tue, 25 Oct 2016 15:26:25 +0000 (17:26 +0200)]
docs: simplify style for headers

Remove the 1px border underneath all headers and make them
use black text to simplify visual appearance

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: add footer to all pages
Daniel P. Berrange [Tue, 25 Oct 2016 14:56:50 +0000 (16:56 +0200)]
docs: add footer to all pages

Add a footer to all pages containing a blurb about the
code of conduct, and links to various communication
channels / social media / user self-help sites.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: provide new style logos for the apps page
Daniel P. Berrange [Mon, 7 Nov 2016 16:41:23 +0000 (16:41 +0000)]
docs: provide new style logos for the apps page

Replace the old "Made with libvirt" logo with links to the
new "Libvirt powered" logos, providing various sizes.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: redo style of front page
Daniel P. Berrange [Tue, 25 Oct 2016 14:55:39 +0000 (16:55 +0200)]
docs: redo style of front page

Use a large logo banner across the front page. Tile the
three lists of links into three panels

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: switch to new website banner
Daniel P. Berrange [Tue, 25 Oct 2016 14:16:29 +0000 (16:16 +0200)]
docs: switch to new website banner

Use a dark banner whose color matches the dark green used in
the logo. Introduce a newly rendered version of the header
logo derived from new SVG file, instead of old one from
(now lost) Adobe Illustrator file.

The top banner logo now links to the front page as is common
practice for most websites.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: add master SVG for libvirt logo
Daniel P. Berrange [Mon, 31 Oct 2016 12:20:53 +0000 (12:20 +0000)]
docs: add master SVG for libvirt logo

Add the SVG files for the libvirt logo, along with corresponding
pre-rendered PNG bitmaps at key sizes. Also add a README file
describing how to modify the logos and their intended usages.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: use overpass font for website
Daniel P. Berrange [Tue, 25 Oct 2016 13:55:17 +0000 (15:55 +0200)]
docs: use overpass font for website

The original libvirt logo was built using what appears to be
either Overpass font, or one stylistically very similar (the
slanted top of letters like 'l', 't', etc). The newly recreated
libvirt logo will use Overpass. Use this font for the website
text too, to provide a consistent style.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoqemu: Generate memory device aliases according to slot number
Peter Krempa [Tue, 1 Nov 2016 05:21:36 +0000 (06:21 +0100)]
qemu: Generate memory device aliases according to slot number

The memory device alias needs to be treated as machine ABI as qemu is
using it in the migration stream for section labels. To simplify this
generate the alias from the slot number unless an existing broken
configuration is detected.

With this patch the aliases are predictable and even certain
configurations which would not be migratable previously are fixed.

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

8 years agoqemu: Assign slots to memory devices prior to usage
Peter Krempa [Tue, 1 Nov 2016 05:07:09 +0000 (06:07 +0100)]
qemu: Assign slots to memory devices prior to usage

As with other devices assign the slot number right away when adding the
device. This will make the slot numbers static as we do with other
addressing elements and it will ultimately simplify allocation of the
alias in a static way which does not break with qemu.

8 years agoqemu: process: detect if dimm aliases are broken on reconnect
Peter Krempa [Mon, 31 Oct 2016 15:49:49 +0000 (16:49 +0100)]
qemu: process: detect if dimm aliases are broken on reconnect

Detect on reconnect to a running qemu VM whether the alias of a
hotpluggable memory device (dimm) does not match the dimm slot number
where it's connected to. This is necessary as qemu is actually
considering the alias as machine ABI used to connect the backend object
to the dimm device.

This will require us to keep them consistent so that we can reliably
restore them on migration. In some situations it was currently possible
to create a mismatched configuration and qemu would refuse to restore
the migration stream.

To avoid breaking existing VMs we'll need to keep the old algorithm
though.

8 years agoconf: Allow specifying only the slot number for hotpluggable memory
Peter Krempa [Thu, 13 Oct 2016 12:55:47 +0000 (14:55 +0200)]
conf: Allow specifying only the slot number for hotpluggable memory

Simplify handling of the 'dimm' address element by allowing to specify
the slot number only. This will allow libvirt to allocate slot numbers
before starting qemu.

8 years agoconfigure: remove fallback check for parted
Daniel P. Berrange [Wed, 9 Nov 2016 17:29:20 +0000 (17:29 +0000)]
configure: remove fallback check for parted

Since we no longer support building on RHEL-5, we can
drop the non-pkg-config based check for parted.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoxen: remove legacy hack for RHEL-5 Xen
Daniel P. Berrange [Wed, 9 Nov 2016 17:27:50 +0000 (17:27 +0000)]
xen: remove legacy hack for RHEL-5 Xen

We dropped support for RHEL-5 vintage Xen a while ago,
but forgot to remove some of the hacks for it.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoqemu: Remove erroneously placed comments for numerical ordering
John Ferlan [Thu, 10 Nov 2016 14:47:50 +0000 (09:47 -0500)]
qemu: Remove erroneously placed comments for numerical ordering

Commit id '74bbb8c2ec' seems to have mismerged a bit - adding 240 comments
out of place.  Just clean that up.

8 years agoqemuDomainAttachNetDevice: Enable multiqueue for vhost-user
Michal Privoznik [Tue, 25 Oct 2016 10:18:23 +0000 (12:18 +0200)]
qemuDomainAttachNetDevice: Enable multiqueue for vhost-user

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

We have everything ready. Actually the only limitation was our
check that denied hotplug of vhost-user.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemuDomainAttachNetDevice: Don't overwrite error on rollback
Michal Privoznik [Tue, 25 Oct 2016 10:16:36 +0000 (12:16 +0200)]
qemuDomainAttachNetDevice: Don't overwrite error on rollback

If there is an error hotpluging a net device (for whatever
reason) a rollback operation is performed. However, whilst doing
so various helper functions that are called report errors on
their own. This results in the original error to be overwritten
and thus misleading the user.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemu: Make sure shmem memory is shared
Martin Kletzander [Thu, 10 Nov 2016 07:20:07 +0000 (08:20 +0100)]
qemu: Make sure shmem memory is shared

Even though using /dev/shm/asdf as the backend, we still need to make
the mapping shared.  The original patch forgot to add that parameter.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agolxc.conf: s/QEMU/LXC/
Michal Privoznik [Wed, 9 Nov 2016 17:13:45 +0000 (18:13 +0100)]
lxc.conf: s/QEMU/LXC/

There's one copy paste error where a comment mentions QEMU
instead of LXC driver.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemu_capabilities: fix build with for old gcc
Pavel Hrdina [Wed, 9 Nov 2016 17:40:14 +0000 (18:40 +0100)]
qemu_capabilities: fix build with for old gcc

../../src/qemu/qemu_capabilities.c:3757: error: declaration of
'basename' shadows a global declaration [-Wshadow]

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemu: Fix double free when live-attaching shmem
Martin Kletzander [Wed, 9 Nov 2016 16:40:17 +0000 (17:40 +0100)]
qemu: Fix double free when live-attaching shmem

Function qemuDomainAttachShmemDevice() steals the device data if the
hotplug was successful, but the condition checked for unsuccessful
execution otherwise.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoqemu: command: Add debug option for gluster volumes
Prasanna Kumar Kalever [Fri, 14 Oct 2016 03:37:45 +0000 (05:37 +0200)]
qemu: command: Add debug option for gluster volumes

Propagate the selected or default level to qemu if it's supported.

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

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
8 years agoqemu: conf: add option for tuning debug logging level
Prasanna Kumar Kalever [Wed, 21 Sep 2016 19:34:18 +0000 (01:04 +0530)]
qemu: conf: add option for tuning debug logging level

This helps in selecting log level of the gluster gfapi, output to stderr.
The option is 'gluster_debug_level', can be tuned by editing
'/etc/libvirt/qemu.conf'

Debug levels ranges 0-9, with 9 being the most verbose, and 0
representing no debugging output.  The default is the same as it was
before, which is a level of 4.  The current logging levels defined in
the gluster gfapi are:

    0 - None
    1 - Emergency
    2 - Alert
    3 - Critical
    4 - Error
    5 - Warning
    6 - Notice
    7 - Info
    8 - Debug
    9 - Trace

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
8 years agotests: qemucaps: Add QMP introspection data for qemu 2.6.0 on aarch64 gicv3
Andrea Bolognani [Wed, 19 Oct 2016 15:36:45 +0000 (11:36 -0400)]
tests: qemucaps: Add QMP introspection data for qemu 2.6.0 on aarch64 gicv3

Add QMP schema data query for aarch64. The gic capabilities are
unfortunately queried after the QMP schema and thus this patch needs to
undo the temporary removal of the declared support for query-qmp-schema.

Note that as a gicv3 machine was not available the schema data is taken
from the gicv2 case. It should be identical since qemu would be built
from the same source.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
8 years agotests: qemucaps: Add QMP introspection data for qemu 2.6.0 on aarch64 gicv2
Andrea Bolognani [Wed, 19 Oct 2016 15:36:45 +0000 (11:36 -0400)]
tests: qemucaps: Add QMP introspection data for qemu 2.6.0 on aarch64 gicv2

Add QMP schema data query for aarch64. The gic capabilities are
unfortunately queried after the QMP schema and thus this patch needs to
undo the temporary removal of the declared support for query-qmp-schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
8 years agoqemu: capabilities: Detect support for gluster debug setting
Prasanna Kumar Kalever [Wed, 21 Sep 2016 19:34:19 +0000 (01:04 +0530)]
qemu: capabilities: Detect support for gluster debug setting

Teach qemu driver to detect whether qemu supports specifying debug level
for gluster volumes.

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
8 years agoqemu: capabilities: Add support for QMP schema introspection
Peter Krempa [Wed, 19 Oct 2016 12:40:53 +0000 (14:40 +0200)]
qemu: capabilities: Add support for QMP schema introspection

Allow detecting capabilities according to the qemu QMP schema. This is
necessary as sometimes the availability of certain options depends on
the presence of a field in the schema.

This patch adds support for loading the QMP schema when detecting qemu
capabilities and adds a very simple query language to allow traversing
the schema and selecting a certain element from it.

The infrastructure in this patch uses a query path to set a specific
capability flag according to the availability of the given element in
the schema.

8 years agotests: qemucaps: Temporarily remove 'query-qmp-schema' from test data
Peter Krempa [Thu, 20 Oct 2016 08:11:05 +0000 (10:11 +0200)]
tests: qemucaps: Temporarily remove 'query-qmp-schema' from test data

Remove the command from the supported commands list temporarily so that
QMP introspection code can be added without breaking tests and having to
tweak the test data in the same commit.

This will be later reverted and test data will be added. The aarch64
code is special as it calls additional commands and thus the test data
can't be added upfront.

8 years agotests: qemucaps: Add QMP introspection data for qemu 2.6.0 on ppc64le
Andrea Bolognani [Wed, 19 Oct 2016 15:36:45 +0000 (11:36 -0400)]
tests: qemucaps: Add QMP introspection data for qemu 2.6.0 on ppc64le

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
8 years agotests: qemucaps: Add QMP introspection data for qemu 2.7.0 on x86
Pavel Hrdina [Wed, 19 Oct 2016 14:53:22 +0000 (16:53 +0200)]
tests: qemucaps: Add QMP introspection data for qemu 2.7.0 on x86

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
8 years agotests: qemucaps: Add QMP introspection data for qemu 2.6.0 on x86
Pavel Hrdina [Wed, 19 Oct 2016 14:53:13 +0000 (16:53 +0200)]
tests: qemucaps: Add QMP introspection data for qemu 2.6.0 on x86

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
8 years agotests: qemucaps: Add QMP introspection data for qemu 2.5.0 on x86
Pavel Hrdina [Wed, 19 Oct 2016 14:52:02 +0000 (16:52 +0200)]
tests: qemucaps: Add QMP introspection data for qemu 2.5.0 on x86

Add output of 'query-qmp-schema' to the capabilities test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
8 years agotests: qemucaps: Update aarch64 gicv2 replies for qemu 2.6.0 release
Andrea Bolognani [Wed, 19 Oct 2016 15:36:45 +0000 (11:36 -0400)]
tests: qemucaps: Update aarch64 gicv2 replies for qemu 2.6.0 release

Sync up to the released version of qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
8 years agotests: qemucaps: Update ppc64 replies for qemu 2.6.0 release
Andrea Bolognani [Wed, 19 Oct 2016 15:36:45 +0000 (11:36 -0400)]
tests: qemucaps: Update ppc64 replies for qemu 2.6.0 release

Sync up to the released version of qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
8 years agoqemu: monitor: Add code to retrieve and store QMP schema data
Peter Krempa [Mon, 17 Oct 2016 12:20:42 +0000 (14:20 +0200)]
qemu: monitor: Add code to retrieve and store QMP schema data

Call 'query-qmp-schema' and store the returned types in a hash table
keyed by the 'name' field so that the capabilities code can traverse it.

8 years agoutil: json: add helper to iterate and steal members of json array
Peter Krempa [Mon, 17 Oct 2016 11:44:16 +0000 (13:44 +0200)]
util: json: add helper to iterate and steal members of json array

Simplifies cases where JSON array members need to be transferred to a
different structure.

8 years agotest driver: Deny some operations on inactive domains
Michal Privoznik [Tue, 8 Nov 2016 08:49:22 +0000 (09:49 +0100)]
test driver: Deny some operations on inactive domains

Some operations like reboot, save, coreDump, blockStats,
ifaceStats make sense iff domain is running. While it is
technically possible for our test driver to return success
regardless of domain state, we should copy constraints from
other drivers and thus deny these operations over inactive
domains.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
8 years agoqemu: Only allow 'raw' format for scsi-block using virtio-scsi
John Ferlan [Mon, 31 Oct 2016 19:44:34 +0000 (15:44 -0400)]
qemu: Only allow 'raw' format for scsi-block using virtio-scsi

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

Add check in qemuCheckDiskConfig for an invalid combination
of using the 'scsi' bus for a block 'lun' device and any disk
source format other than 'raw'.

8 years agoAdd vbox 5.1 driver file
Daniel P. Berrange [Tue, 8 Nov 2016 11:19:02 +0000 (11:19 +0000)]
Add vbox 5.1 driver file

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agodocs: add note about when lxc: XML namespace was added
Daniel P. Berrange [Tue, 8 Nov 2016 09:59:41 +0000 (09:59 +0000)]
docs: add note about when lxc: XML namespace was added

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agovbox: hookup the 5.1 C API to the unified driver
Dawid Zamirski [Tue, 8 Nov 2016 09:56:33 +0000 (09:56 +0000)]
vbox: hookup the 5.1 C API to the unified driver

8 years agovbox: add vbox 5.1 C API header file.
Dawid Zamirski [Thu, 20 Oct 2016 20:13:45 +0000 (16:13 -0400)]
vbox: add vbox 5.1 C API header file.

extracted from VirutalBox SDK and reindented with cppi.