]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
9 years agolibxl: support dom0
Jim Fehlig [Mon, 22 Jun 2015 17:36:59 +0000 (11:36 -0600)]
libxl: support dom0

In Xen, dom0 is really just another domain that supports ballooning,
adding/removing devices, changing vcpu configuration, etc. This patch
adds support to the libxl driver for managing dom0. Note that the
legacy xend driver has long supported managing dom0.

Operations that are not supported on dom0 are filtered in libvirt
where a sensible error is reported. Errors from libxl are not
always helpful. E.g., attempting a save on dom0 results in

2015-06-23 15:25:05 MDT libxl: debug: libxl_dom.c:1570:libxl__toolstack_save: domain=0 toolstack data size=8
2015-06-23 15:25:05 MDT libxl: debug: libxl.c:979:do_libxl_domain_suspend: ao 0x7f7e68000b70: inprogress: poller=0x7f7e68000930, flags=i
2015-06-23 15:25:05 MDT libxl-save-helper: debug: starting save: Success
2015-06-23 15:25:05 MDT xc: detail: xc_domain_save_suse: starting save of domid 0
2015-06-23 15:25:05 MDT xc: error: Couldn't map live_shinfo (3 = No such process): Internal error
2015-06-23 15:25:05 MDT xc: detail: Save exit of domid 0 with errno=3
2015-06-23 15:25:05 MDT libxl-save-helper: debug: complete r=1: No such process
2015-06-23 15:25:05 MDT libxl: error: libxl_dom.c:1876:libxl__xc_domain_save_done: saving domain: domain did not respond to suspend request: No such process
2015-06-23 15:25:05 MDT libxl: error: libxl_dom.c:2033:remus_teardown_done: Remus: failed to teardown device for guest with domid 0, rc -8

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
9 years agoqemu: Introduce qemuGetHostdevPath
John Ferlan [Tue, 16 Jun 2015 17:58:44 +0000 (13:58 -0400)]
qemu: Introduce qemuGetHostdevPath

Introduce a convenience function to handle formulating the hostdev path

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoqemu: Introduce qemuIsSharedHostdev
John Ferlan [Tue, 16 Jun 2015 17:33:37 +0000 (13:33 -0400)]
qemu: Introduce qemuIsSharedHostdev

Add a single boolean function to handle whether the hostdev is shared or not.

Use the new function for the qemu{Add|Remove}SharedHostdev calls as well
as qemuSetUnprivSGIO. NB: This third usage fixes a possible bug where
if this feature is enabled at some time in the future and the shareable flag
wasn't set, the sgio would have been erroneously set.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agodocs: Clarify unprivileged sgio feature
John Ferlan [Mon, 6 Jul 2015 13:22:27 +0000 (09:22 -0400)]
docs: Clarify unprivileged sgio feature

Update the descriptions for disk and hostdev sgio in order to indicate
not all hypervisors and OS's support this feature

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoqemu: report error when shmem has an invalid address
Luyao Huang [Wed, 17 Jun 2015 03:56:21 +0000 (11:56 +0800)]
qemu: report error when shmem has an invalid address

If user passes an invalid address for shared memory device to qemu,
neither libvirt nor qemu will report an error, but qemu will auto assign
a pci address to the shared memory device.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoconf: use virDomainChrSourceDef to save server path
Luyao Huang [Wed, 17 Jun 2015 03:56:15 +0000 (11:56 +0800)]
conf: use virDomainChrSourceDef to save server path

As the backend of shmem server is a unix type chr device, save it in
virDomainChrSourceDef, so we can reuse the existing code for chr device.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoqemu: Refactor creation of shared memory device commandline
Luyao Huang [Wed, 17 Jun 2015 03:56:14 +0000 (11:56 +0800)]
qemu: Refactor creation of shared memory device commandline

Rename qemuBuildShmemDevCmd to qemuBuildShmemDevStr and change the
return type so that it can be reused in the device hotplug code later.

And split the chardev creation part in a new function
qemuBuildShmemBackendStr for reuse in the device hotplug code later.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoqemu: Assign IDs for shared memory devices
Luyao Huang [Wed, 17 Jun 2015 03:56:13 +0000 (11:56 +0800)]
qemu: Assign IDs for shared memory devices

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoqemu: Auto assign pci addresses for shared memory devices
Luyao Huang [Wed, 17 Jun 2015 03:56:12 +0000 (11:56 +0800)]
qemu: Auto assign pci addresses for shared memory devices

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

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agovz: use PRL_USE_VNET_NAME_FOR_BRIDGE_NAME
Maxim Nestratov [Tue, 7 Jul 2015 01:49:00 +0000 (04:49 +0300)]
vz: use PRL_USE_VNET_NAME_FOR_BRIDGE_NAME

It is better not to assume that newly created network should be
connected to a bridge with same name, but specify it explicitly
by PRL_USE_VNET_NAME_FOR_BRIDGE_NAME flag.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
9 years agoExplicitly format the isa-fdc controller for newer q35 machines
Ján Tomko [Mon, 22 Jun 2015 13:20:55 +0000 (15:20 +0200)]
Explicitly format the isa-fdc controller for newer q35 machines

Since QEMU commit ea96bc6 [1]:
i386: drop FDC in pc-q35-2.4+ if neither it nor floppy drives are wanted
the floppy controller is no longer implicit.

Specify it explicitly on the command line if the machine type version
is 2.4 or later.

Note that libvirt's floppy drives do not result in QEMU implying the
controller, because libvirt uses if=none instead of if=floppy.

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

[1] http://git.qemu.org/?p=qemu.git;a=commitdiff;h=ea96bc6

9 years agoSeparate isa-fdc options generation
Ján Tomko [Mon, 22 Jun 2015 13:20:34 +0000 (15:20 +0200)]
Separate isa-fdc options generation

For the implicit controller, we set them via -global.
Separating them will allow reuse for explicit fdc controller as well.

No functional impact apart from one extra allocation.

9 years agoAdd support for portable-rpcgen from portablexdr library
Pavel Fedin [Wed, 8 Jul 2015 11:29:23 +0000 (14:29 +0300)]
Add support for portable-rpcgen from portablexdr library

This allows to build libvirt under MinGW

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
9 years agoRemove explicit enum from protocol structures
Pavel Fedin [Wed, 8 Jul 2015 11:29:22 +0000 (14:29 +0300)]
Remove explicit enum from protocol structures

Explicit 'enum' keyword does not work with portablexdr-rpcgeb, causing its
parser to fail. Fix method is borrowed from virnetprotocol.x

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
9 years agovirt-aa-helper: add unix channels for nserials as well
Serge Hallyn [Fri, 3 Jul 2015 19:01:34 +0000 (19:01 +0000)]
virt-aa-helper: add unix channels for nserials as well

Commit 03d7462d added it for channels, but it is also needed for serials.  Add
it for serials, parallels, and consoles as well.

This solves https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1015154

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agostorage: Fix regression in storagePoolUpdateAllState
Erik Skultety [Thu, 2 Jul 2015 12:41:37 +0000 (14:41 +0200)]
storage: Fix regression in storagePoolUpdateAllState

Commit 2a31c5f0 introduced support for storage pool state XMLs, however
it also introduced a regression:

if (!virstoragePoolObjIsActive(pool)) {
    virStoragePoolObjUnlock(pool);
    continue;
}

The idea behind this was that since we've got state XMLs and the pool
wasn't marked as active by autostart routine (if the autostart flag had been
set earlier), the pool is inactive and we can leave it be and continue with
other pools. However, filesystem type pools like fs,dir, possibly netfs are
supposed to be active if the filesystem is mounted on the host. And this is
exactly where the regression occurs, e.g. pool type 'dir' which has been
previously destroyed and marked as !autostart gets filtered out
by the condition above.
The resolution should be simply to remove the condition completely,
all pools will get their 'active' flag updated by check callback and if
they do not support such callback, the logic doesn't change and such
pools will be inactive by default (e.g. RBD, even if a state XML exists).

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

9 years agoutil: bitmap: Don't alloc overly large binary bitmaps
Peter Krempa [Thu, 2 Jul 2015 14:46:46 +0000 (16:46 +0200)]
util: bitmap: Don't alloc overly large binary bitmaps

Optimize the virBitmap to array-of-char bitmap conversion by skipping
trailing zero bytes.

This also fixes a regression when requesting iothread information from a
live VM since after commit 825df8c3158cfaf5f398418471f10f4ff3c3515a the
bitmap returned from virProcessGetAffinity is too big to be formatted
properly via RPC. A user would get the following error:

error: Unable to get domain IOThreads information
error: Unable to encode message payload

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

9 years agovz: Use virBitmapToDataBuf instead of virBitmapToData in vzDomainGetVcpus
Peter Krempa [Thu, 2 Jul 2015 14:26:59 +0000 (16:26 +0200)]
vz: Use virBitmapToDataBuf instead of virBitmapToData in vzDomainGetVcpus

9 years agovz: Remove dead code from vzDomainGetVcpus
Peter Krempa [Thu, 2 Jul 2015 14:11:35 +0000 (16:11 +0200)]
vz: Remove dead code from vzDomainGetVcpus

'maxcpu' and 'vcpus' are set but not used after that

9 years agoqemu: move the guest status check before agent config and status check
Luyao Huang [Fri, 3 Jul 2015 06:58:05 +0000 (14:58 +0800)]
qemu: move the guest status check before agent config and status check

When use setvcpus command with --guest option to a offline vm,
we will get error:

 # virsh setvcpus test3 1 --guest
 error: Guest agent is not responding: QEMU guest agent is not connected

However guest is not running, agent status could not be connected.
In this case, report domain is not running will be better than agent is
not connected. Move the guest status check more early to output error to
point out guest status is not right.

Also from the logic, a running vm is a basic requirement to use
agent, we cannot use agent if vm is not running.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemu: remove deadcode in qemuDomain{HelperGetVcpus|GetIOThreadsLive}
Luyao Huang [Fri, 3 Jul 2015 01:57:53 +0000 (09:57 +0800)]
qemu: remove deadcode in qemuDomain{HelperGetVcpus|GetIOThreadsLive}

We set @hostcpus variable but not use it.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agovz: assign static IPs and default gateways for network adapter
Mikhail Feoktistov [Tue, 7 Jul 2015 13:38:00 +0000 (16:38 +0300)]
vz: assign static IPs and default gateways for network adapter

We support only one IPv4 and one IPv6 default gateway.
If static IPs are not present in instance config,
then we switch on DHCP for this adapter.
PrlVmDevNet_SetAutoApply to makes necessary settings within guest OS
In linux case it creates network startup scripts
/etc/sysconfig/network-scripts/ifcfg-ethN and fills it with necessary
parameters.

9 years agovz: fix building capabilities
Dmitry Guryanov [Fri, 3 Jul 2015 17:26:00 +0000 (20:26 +0300)]
vz: fix building capabilities

There should be at least one domain for each guest
in cababilities. And in current code we don't add
domain for this guest for example.

    if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
                                         VIR_ARCH_X86_64,
                                         "vz",
                                         NULL, 0, NULL)) == NULL)

Anyway, with two virt types it looks a litte messy, so let's
move adding guest and domain to a separate function.

Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
9 years agoqemu_driver: live/config checks cleanup
Pavel Hrdina [Wed, 1 Jul 2015 09:58:04 +0000 (11:58 +0200)]
qemu_driver: live/config checks cleanup

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agobetter patch for the XSS search issue
Daniel Veillard [Fri, 3 Jul 2015 13:04:24 +0000 (21:04 +0800)]
better patch for the XSS search issue

Since the query string could be output when displaying the results too

9 years agoAvoid XSS vulnerability on the search engine
Daniel Veillard [Fri, 3 Jul 2015 12:47:08 +0000 (20:47 +0800)]
Avoid XSS vulnerability on the search engine

Raised by https://www.xssposed.org/incidents/69566/
Need to escape the user provided query before displaying it back

9 years agovz: fix SDK event dispatching
Nikolay Shirokovskiy [Thu, 25 Jun 2015 08:56:00 +0000 (11:56 +0300)]
vz: fix SDK event dispatching

Current version of SDK event dispatcing is incorrect. For most VM events (add,
delete etc) issuer type is PIE_DISPATCHER. Actually analyzing issuer type
doesn't have any benifints so this patch get rid of it. All dispatching is done
only on event type.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
9 years agoutil: Avoid Coverity FORWARD_NULL
John Ferlan [Wed, 1 Jul 2015 13:35:43 +0000 (09:35 -0400)]
util: Avoid Coverity FORWARD_NULL

Avoid a false positive since Coverity find a path in virResizeN which
could return 0 prior to the allocation of memory and thus flags a
possible NULL dereference. Instead allocate the output buffer based
on 'nparams' and only fill it partially if need be - shouldn't be too
much a waste of space. Quicker than multiple VIR_RESIZE_N calls or
two loops of STREQ's sandwiched around a single VIR_ALLOC_N using
'n' matches from a first loop to generate the 'n' addresses to return

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agovirsh: report error if vcpu number exceed the guest maxvcpu number
Luyao Huang [Mon, 29 Jun 2015 02:10:15 +0000 (10:10 +0800)]
virsh: report error if vcpu number exceed the guest maxvcpu number

Commit id '81dd81e' caused a regression when attempting to print a
specific vcpuid that is out of the range of the maximum vcpus for
the guest, such as:

 $ virsh vcpupin $dom 1000
 VCPU: CPU Affinity
 ----------------------------------

 $

Rather than just recover the old message, let's adjust the message based
on what would be displayed for a similar failure in the set path, such as:

 $ virsh vcpupin $dom 1000
 error: vcpu 1000 is out of range of persistent cpu count 2

 $ virsh vcpupin $dom 1000 --live
 error: vcpu 1000 is out of range of live cpu count 2

 $

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agovirt-aa-helper: Fix permissions for vhost-user socket files
Michal Dubiel [Wed, 1 Jul 2015 08:15:29 +0000 (10:15 +0200)]
virt-aa-helper: Fix permissions for vhost-user socket files

QEMU working in vhost-user mode communicates with the other end (i.e.
some virtual router application) via unix domain sockets. This requires
that permissions for the socket files are correctly written into
/etc/apparmor.d/libvirt/libvirt-UUID.files.

Signed-off-by: Michal Dubiel <md@semihalf.com>
9 years agoPost-release version bump to 1.2.18
Michal Privoznik [Thu, 2 Jul 2015 08:41:27 +0000 (10:41 +0200)]
Post-release version bump to 1.2.18

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agocpu_map.xml: Expand Opteron_G4 CPU model
Jiri Denemark [Tue, 23 Jun 2015 13:14:22 +0000 (15:14 +0200)]
cpu_map.xml: Expand Opteron_G4 CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand Opteron_G2 CPU model
Jiri Denemark [Tue, 23 Jun 2015 13:12:27 +0000 (15:12 +0200)]
cpu_map.xml: Expand Opteron_G2 CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand Opteron_G1 CPU model
Jiri Denemark [Tue, 23 Jun 2015 13:11:53 +0000 (15:11 +0200)]
cpu_map.xml: Expand Opteron_G1 CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand Broadwell-noTSX CPU model
Jiri Denemark [Tue, 23 Jun 2015 13:10:28 +0000 (15:10 +0200)]
cpu_map.xml: Expand Broadwell-noTSX CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand Haswell-noTSX CPU model
Jiri Denemark [Tue, 23 Jun 2015 13:10:28 +0000 (15:10 +0200)]
cpu_map.xml: Expand Haswell-noTSX CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand SandyBridge CPU model
Jiri Denemark [Tue, 23 Jun 2015 13:08:40 +0000 (15:08 +0200)]
cpu_map.xml: Expand SandyBridge CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand Westmere CPU model
Jiri Denemark [Tue, 23 Jun 2015 13:06:32 +0000 (15:06 +0200)]
cpu_map.xml: Expand Westmere CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand Nehalem CPU model
Jiri Denemark [Tue, 23 Jun 2015 13:05:47 +0000 (15:05 +0200)]
cpu_map.xml: Expand Nehalem CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand Penryn CPU model
Jiri Denemark [Tue, 23 Jun 2015 13:04:24 +0000 (15:04 +0200)]
cpu_map.xml: Expand Penryn CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand Conroe CPU model
Jiri Denemark [Tue, 23 Jun 2015 13:03:07 +0000 (15:03 +0200)]
cpu_map.xml: Expand Conroe CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand kvm64 CPU model
Jiri Denemark [Tue, 23 Jun 2015 12:47:08 +0000 (14:47 +0200)]
cpu_map.xml: Expand kvm64 CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand cpu64-rhel5 CPU model
Jiri Denemark [Tue, 23 Jun 2015 12:45:51 +0000 (14:45 +0200)]
cpu_map.xml: Expand cpu64-rhel5 CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand kvm32 CPU model
Jiri Denemark [Tue, 23 Jun 2015 12:43:52 +0000 (14:43 +0200)]
cpu_map.xml: Expand kvm32 CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand qemu32 CPU model
Jiri Denemark [Tue, 23 Jun 2015 12:42:43 +0000 (14:42 +0200)]
cpu_map.xml: Expand qemu32 CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand n270 CPU model
Jiri Denemark [Tue, 23 Jun 2015 12:40:28 +0000 (14:40 +0200)]
cpu_map.xml: Expand n270 CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand coreduo CPU model
Jiri Denemark [Tue, 23 Jun 2015 12:39:27 +0000 (14:39 +0200)]
cpu_map.xml: Expand coreduo CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand pentiumpro CPU model
Jiri Denemark [Tue, 23 Jun 2015 12:38:06 +0000 (14:38 +0200)]
cpu_map.xml: Expand pentiumpro CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand pentium2 CPU model
Jiri Denemark [Tue, 23 Jun 2015 12:36:15 +0000 (14:36 +0200)]
cpu_map.xml: Expand pentium2 CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand pentium CPU model
Jiri Denemark [Tue, 23 Jun 2015 12:34:41 +0000 (14:34 +0200)]
cpu_map.xml: Expand pentium CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Expand 486 CPU model
Jiri Denemark [Tue, 23 Jun 2015 12:33:39 +0000 (14:33 +0200)]
cpu_map.xml: Expand 486 CPU model

Inheritance among CPU model is cool but it makes reviewing CPU model
definitions and comparing them to CPU models from QEMU rather hard and
unpleasant. Let's define all CPU models from scratch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu_map.xml: Sort features in x86 CPU models
Jiri Denemark [Tue, 23 Jun 2015 06:55:08 +0000 (08:55 +0200)]
cpu_map.xml: Sort features in x86 CPU models

Sorted feature list is easier to review or compare.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoRelease of libvirt-1.2.17
Daniel Veillard [Thu, 2 Jul 2015 05:22:30 +0000 (13:22 +0800)]
Release of libvirt-1.2.17

* docs/news.html.in libvirt.spec.in: updated for the release
* po/*po*: regenerated

9 years agophyp: Resolve Coverity FORWARD_NULL
John Ferlan [Wed, 1 Jul 2015 10:32:34 +0000 (06:32 -0400)]
phyp: Resolve Coverity FORWARD_NULL

Commit id 'cd490086' added a VIR_FORCE_CLOSE of the 'sock', but it
was after the VIR_FREE() of phyp_driver, resulting in a possible/likely
NULL dereference.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoutil: Resolve Coverity FORWARD_NULL
John Ferlan [Tue, 30 Jun 2015 19:53:53 +0000 (15:53 -0400)]
util: Resolve Coverity FORWARD_NULL

Convert virPCIDriverDir to return the buffer allocated (or not) and make the
appropriate check in the caller.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoutil: Resolve Coverity FORWARD_NULL
John Ferlan [Tue, 30 Jun 2015 19:49:05 +0000 (15:49 -0400)]
util: Resolve Coverity FORWARD_NULL

Convert virPCIDriverFile to return the buffer allocated (or not) and make the
appropriate check in the caller.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoutil: Resolve Coverity FORWARD_NULL
John Ferlan [Tue, 30 Jun 2015 19:23:31 +0000 (15:23 -0400)]
util: Resolve Coverity FORWARD_NULL

Convert virPCIFile to return the buffer allocated (or not) and make the
appropriate check in the caller.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agolxc: Don't pass a local variable address randomly
Michal Privoznik [Wed, 1 Jul 2015 15:21:28 +0000 (17:21 +0200)]
lxc: Don't pass a local variable address randomly

So, recently I was testing the LXC driver. You know, startup some
domains. But to my surprise, I was not able to start a single one:

  virsh # start --console test
  error: Reconnected to the hypervisor
  error: Failed to start domain test
  error: internal error: guest failed to start: unexpected exit status 125

So I've start digging. It turns out, that in virExec(), when I printed
out the @cmd, I got strange values: *(cmd->outfdptr) was certainly not
valid FD number: it has random value of several millions. This
obviously made prepareStdFd(childout, STDOUT_FILENO) fail (line 611).
But outfdptr is set in virCommandSetOutputFD(). The only place within
LXC driver where the function is called is in
virLXCProcessBuildControllerCmd(). If you take a closer look at the
function it looks like this:

static virCommandPtr
virLXCProcessBuildControllerCmd(virLXCDriverPtr driver,
                                ..
                                int logfd,
                                const char *pidfile)
{
    ...
    virCommandSetOutputFD(cmd, &logfd);
    virCommandSetErrorFD(cmd, &logfd);
    ...
}

Yes, you guessed it. @logfd is passed into the function by value.
However, in the function we try to get its address (an address of a
local variable) which is no longer valid once function is finished and
stack is cleaned. Therefore when cmd->outfdptr is evaluated at any
point after this function, we may get a random number, depending on
what's currently on the stack. Of course, this may work sometimes too
- it depends on the compiler how it arranges the code, when the stack
is wiped out.

In order to fix this, lets pass a pointer to @logfd instead of
figuring out (wrong) its value in a function.

The bug was introduced in e1de5521.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemu: Resolve Coverity DEADCODE
John Ferlan [Wed, 1 Jul 2015 10:28:12 +0000 (06:28 -0400)]
qemu: Resolve Coverity DEADCODE

Commit id 'f967e7a6' didn't place the closing parentheses quite right
causing DEADCODE errors since the rc setting/comparison was wrong.

9 years agoconf: qemu: Taint VMs using custom device tree blob
Peter Krempa [Fri, 26 Jun 2015 08:59:33 +0000 (10:59 +0200)]
conf: qemu: Taint VMs using custom device tree blob

Using a custom device tree image may cause unexpected behavior in
architectures that use this approach to detect platform devices. Since
usually the device tree is generated by qemu and thus it's not normally
used let's taint VMs using it to make it obvious as a possible source of
problems.

9 years agoqemu: Audit memory size with memory hotplug operations
Peter Krempa [Fri, 26 Jun 2015 15:14:33 +0000 (17:14 +0200)]
qemu: Audit memory size with memory hotplug operations

The memory device hot(un)plug was missing calls to the auditing code.

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

9 years agoconf: audit: Audit physical memory size rather than balloon request
Peter Krempa [Fri, 26 Jun 2015 15:12:39 +0000 (17:12 +0200)]
conf: audit: Audit physical memory size rather than balloon request

Since the balloon driver does not guarantee that it returns memory to
the host, using the value in the audit message is not a good idea.

This patch removes auditing from updating the balloon size and reports
the total physical size at startup.

9 years agoqemu: Avoid using ".(null)" in UNIX socket path
Jiri Denemark [Tue, 30 Jun 2015 11:34:20 +0000 (13:34 +0200)]
qemu: Avoid using ".(null)" in UNIX socket path

The code which generates paths for UNIX socket blindly used target name
without checking if it was set. Thus for the following device XML

    <channel type='unix'>
      <source mode='bind'/>
      <target type='virtio'/>
    </channel>

we would generate "/var/lib/libvirt/qemu/channel/target/NAME.(null)"
path which works but is not really correct. Let's not use the
".target_name" suffix at all if target name is not set.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: agent: Don't automatically disable CPU0 via guest agent
Peter Krempa [Fri, 26 Jun 2015 11:58:20 +0000 (13:58 +0200)]
qemu: agent: Don't automatically disable CPU0 via guest agent

While CPU0 was made unpluggable in Linux a while ago it's not desirable
to unplug it since some parts of the kernel (suspend-to-ram) still
depend on it.

This patch fixes the vCPU selection code in libvirt so that it will not
be disabled.

9 years agoqemu: End job even if exiting monitor after OpenGraphics(FD) fails
Luyao Huang [Tue, 30 Jun 2015 03:35:13 +0000 (11:35 +0800)]
qemu: End job even if exiting monitor after OpenGraphics(FD) fails

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoqemu: properly free addresses on non-serial chardev unplug
Ján Tomko [Tue, 30 Jun 2015 13:48:20 +0000 (15:48 +0200)]
qemu: properly free addresses on non-serial chardev unplug

The target type comparison in qemuDomainDetachChrDevice
used the VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE enum, so virtio-serial
addresses were not freed properly for channel devices.

Call qemuDomainReleaseDeviceAddress uncoditionally and decide
based on the address type instead of the target/device types.

9 years agoqemu: fix address allocation on chardev attach
Luyao Huang [Wed, 10 Jun 2015 14:49:37 +0000 (22:49 +0800)]
qemu: fix address allocation on chardev attach

Also check the device type when deciding what type the address should
be. Commit 9807c47 (aiming to fix another error in address allocation)
only checked the target type, but its value is different for different
device types. This resulted in an error when trying to attach
a channel with target type 'virtio':

error: Failed to attach device from channel-file.xml
error: internal error: virtio serial device has invalid address type

Make the logic for releasing the address dependent only on
* the address type
* whether it was allocated earlier
to avoid copying the device and target type checks.

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

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
9 years agolibxl: Set def->vcpus after successfully modifying live vcpu count
Jim Fehlig [Mon, 29 Jun 2015 16:46:36 +0000 (10:46 -0600)]
libxl: Set def->vcpus after successfully modifying live vcpu count

def->vcpus was never updated after successfully changing the live
vcpu count of a domain. Subsequent queries for vcpu info would
return incorrect results.  E.g.:

virsh vcpucount test
maximum      config         4
maximum      live           4
current      config         4
current      live           4

virsh setvcpus test 2

virsh vcpucount test
maximum      config         4
maximum      live           4
current      config         4
current      live           4

After patch, live current config is reported correctly:

virsh vcpucount test
maximum      config         4
maximum      live           4
current      config         4
current      live           2

While fixing this, noticed that the live config was not saved
to cfg->stateDir via virDomainSaveStatus. Save the live config
and change error handling of virDomainSave{Config,Status} to
log a message via VIR_WARN, instead of failing the entire
DomainSetVcpusFlags operation.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
9 years agolibxl: honor domainGetXMLDesc() --inactive flag
Jim Fehlig [Wed, 24 Jun 2015 22:15:22 +0000 (16:15 -0600)]
libxl: honor domainGetXMLDesc() --inactive flag

The libxl driver always uses virDomainObj->def when formatting
the domain XML description.  Use virDomainObj->newDef when
--inactive flag is set.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
9 years agolibxl: don't remove persistent domain on start failure
Jim Fehlig [Wed, 24 Jun 2015 21:14:41 +0000 (15:14 -0600)]
libxl: don't remove persistent domain on start failure

libxlDomainCreateXML() would remove a persistent domain if
libxlDomainStart() failed.  Check if domain is persistent
before removing.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
9 years agolibxl: don't overwrite domain state from statedir config
Jim Fehlig [Wed, 24 Jun 2015 21:02:15 +0000 (15:02 -0600)]
libxl: don't overwrite domain state from statedir config

When restarting libvirtd and reconnecting to running domains,
libxlReconnectDomain() would unconditionally set the domain state
to VIR_DOMAIN_RUNNING, overwriting the state maintained in
$statedir/<domname>.xml.  A domain in a paused state would have
the state changed to running, even though it was actually in a
paused state.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
9 years agoqemu: Add missing on_crash lifecycle type
John Ferlan [Mon, 29 Jun 2015 19:22:49 +0000 (15:22 -0400)]
qemu: Add missing on_crash lifecycle type

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

When the domain "<on_crash>coredump-destroy</on_crash>" is set, the
domain wasn't being destroyed, rather it was being rebooted.

Add VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_DESTROY to the list of
on_crash types that cause "-no-reboot" to be added to the qemu
command line.

9 years agoUse the correct symbol for 'onCrash'
John Ferlan [Mon, 29 Jun 2015 19:22:28 +0000 (15:22 -0400)]
Use the correct symbol for 'onCrash'

Although defined the same way, fortunately there hadn't been any deviation.
Ensure any assignments to onCrash use VIR_DOMAIN_LIFECYCLE_CRASH_* defs and
not VIR_DOMAIN_LIFECYCLE_* defs

9 years agompath: Don't allow more than one mpath pool at a time
John Ferlan [Wed, 24 Jun 2015 12:45:24 +0000 (08:45 -0400)]
mpath: Don't allow more than one mpath pool at a time

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

Since an mpath pool contains all the Multipath devices on a host, allowing
more than one defined on a host at a time should be disallowed under the
policy of disallowing duplicate source pools for the host.

Adjust to docs to clarify the Multipath target path value usage for both
the storage driver (only 1 pool per host) and formatstorage references
(ignore the target element in favor of the default target mapping of
/dev/mapper).

9 years agompath: Update path in CheckPool function
John Ferlan [Wed, 24 Jun 2015 11:46:47 +0000 (07:46 -0400)]
mpath: Update path in CheckPool function

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

Per the devmapper docs, use "/dev/mapper" or "/dev/dm-n" in order to
determine if a device is under control of DM Multipath.

So add "/dev/mapper" to the virFileExists, leaving the "/dev/mpath"
as a "legacy" option since it appears for a while it was the preferred
mechanism, but is no longer maintained

9 years agoconf: Validate disk lun using correct types
John Ferlan [Fri, 26 Jun 2015 17:48:06 +0000 (13:48 -0400)]
conf: Validate disk lun using correct types

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

The formatdomain.html description for <disk> device 'lun' indicates that
it must be either a type 'block' or type 'network' with protocol 'iscsi';
however, we did not make that check until domain startup.

This caused issues for virt-manager which had an unexpected failure at
run time rather config time.

This patch adds a check in post part disk device checking for the specific
and supported lun types as well as adjusting the test failure to be for
parse config rather than run time.

9 years agoStorage: Introduce shadow vol for refresh while the main vol builds.
Prerna Saxena [Fri, 26 Jun 2015 11:35:11 +0000 (17:05 +0530)]
Storage: Introduce shadow vol for refresh while the main vol builds.

Libvirt periodically refreshes all volumes in a storage pool, including
the volumes being cloned.
While cloning a storage volume from parent, we drop pool locks. Subsequent
volume refresh sometimes changes allocation for an ongoing copy, and leads
to corrupt images.
Fix: Introduce a shadow volume that isolates the volume object under refresh
from the base which has a copy ongoing.

Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
9 years agoconf: storage: Fix duplicate check for gluster pools
Peter Krempa [Tue, 30 Jun 2015 08:14:17 +0000 (10:14 +0200)]
conf: storage: Fix duplicate check for gluster pools

The pool name has to be the same too to warrant rejecting a pool
definition as duplicate. This regression was introduced in commit
2184ade3a0546b915252cb3b6a5dc88e9a8d2ccf.

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

9 years agoqemu: event: Clean up VNC monitor handling
Peter Krempa [Mon, 29 Jun 2015 15:03:14 +0000 (17:03 +0200)]
qemu: event: Clean up VNC monitor handling

Get rid of spice specific stuff from the handler func and save a few
lines by reflowing the conditions.

9 years agoqemu: event: Properly handle spice events
Peter Krempa [Mon, 29 Jun 2015 14:10:51 +0000 (16:10 +0200)]
qemu: event: Properly handle spice events

Spice events have mostly similar information present in the event JSON
but they differ in the name of the element containing the port.

The JSON event also provides connection ID which might be useful in the
future.

This patch splits up the event parser code into two functions and the
SPICE reimplements the event parsing with correct names and drops the
VNC only stuff.

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

9 years agoRevert "Introduce QEMU_CAPS_ARM_VIRT_PCI"
Peter Krempa [Mon, 29 Jun 2015 07:44:35 +0000 (09:44 +0200)]
Revert "Introduce QEMU_CAPS_ARM_VIRT_PCI"

The capability was not used up to the feature freeze.

This reverts commit 7f3515b4bb677d0ead1887547efc844e4761268a.

9 years agoqemu: Close the agent connection only on agent channel events
Peter Krempa [Tue, 30 Jun 2015 08:46:50 +0000 (10:46 +0200)]
qemu: Close the agent connection only on agent channel events

processSerialChangedEvent processes events for all channels. Commit
2af51483 broke all agent interaction if a channel other than the agent
closes since it did not check that the event actually originated from
the guest agent channel.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1236924
Fixes up: https://bugzilla.redhat.com/show_bug.cgi?id=890648

9 years agostorage: Set correct vol->type at VolCreate
John Ferlan [Mon, 29 Jun 2015 18:18:49 +0000 (14:18 -0400)]
storage: Set correct vol->type at VolCreate

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

If the requested format type for the new entry in the file system pool
is a 'dir', then be sure to set the vol->type correctly as would be done
when the pool is refreshed.

9 years agoFix typo incomaptible -> incompatible
Andrea Bolognani [Tue, 30 Jun 2015 08:53:55 +0000 (10:53 +0200)]
Fix typo incomaptible -> incompatible

9 years agoqemu: Fix assignment of the default spicevmc channel name
Jiri Denemark [Tue, 30 Jun 2015 08:21:21 +0000 (10:21 +0200)]
qemu: Fix assignment of the default spicevmc channel name

Make sure we only assign the default spicevmc channel name to spicevmc
virtio channels. Caused by commits 3269ee65 and 1133ee2b, which moved
the assignment from XML parsing code to QEMU but failed to keep the
logic.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemuxml2argv: Remove Haswell CPU from unrelated tests
Jiri Denemark [Mon, 29 Jun 2015 11:19:21 +0000 (13:19 +0200)]
qemuxml2argv: Remove Haswell CPU from unrelated tests

Proper Haswell CPU model handling is tested in several
qemuxml2argv-cpu-* which are run in a special environment. Let's remove
the CPU model from other tests to make them less fragile.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoRevert "Change livbirt version to 1.3.0 for the next release"
Martin Kletzander [Fri, 26 Jun 2015 15:26:30 +0000 (17:26 +0200)]
Revert "Change livbirt version to 1.3.0 for the next release"

This reverts commit 9a8d916e89173890d7f7ce538b1ab781192b8440.

Also some changes that were introduced after that commit are fixed to
use 1.2.17 instead of 1.3.0

9 years agoTemporarily disable admin API
Martin Kletzander [Fri, 26 Jun 2015 15:26:29 +0000 (17:26 +0200)]
Temporarily disable admin API

Don't listen on the admin socket in the daemon and comment out the
admin devel files out of specfile.

Library is still being compiled and installed in order to link easily
without any disturbing modifications to the daemon code.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agospec: Remove admin package specification
Martin Kletzander [Fri, 26 Jun 2015 15:26:28 +0000 (17:26 +0200)]
spec: Remove admin package specification

Its only file must be included in the daemon package anyway, since the
daemon is linked with the admin library and so then it's just an empty
package until we have virt-admin binary which we can decide later on
whether to just move it to clients or create a new package for it.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoqemu: Resolve Coverity RESOURCE_LEAK
John Ferlan [Sat, 27 Jun 2015 10:41:59 +0000 (06:41 -0400)]
qemu: Resolve Coverity RESOURCE_LEAK

Commit id '15fa84acb' added the alias fetch, but forgot to free it.

9 years agodocs: Clarification for when allowed to use 'lun' for "volume"
John Ferlan [Fri, 26 Jun 2015 18:09:59 +0000 (14:09 -0400)]
docs: Clarification for when allowed to use 'lun' for "volume"

While re-reading what I wrote for commit id '785a8940e', I realized
I needed to clarify that being able to present as a 'lun', the mode
property for the pool source element needed to be "host" (or empty)
and not "direct".

It was described correctly later in the mode host description, but
this just ensures it's not missed here as well.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agodocs: document when pcie-root/dmi-to-pci-bridge support was added
Laine Stump [Fri, 12 Jun 2015 18:54:23 +0000 (14:54 -0400)]
docs: document when pcie-root/dmi-to-pci-bridge support was added

Also move the mention of version numbers for the various PCI
controller models up to the end of the sentence where they are first
given, to avoid confusion.

9 years agoqemu: ignore assumptions about hotplug requirement when address is from config
Laine Stump [Wed, 10 Jun 2015 18:15:25 +0000 (14:15 -0400)]
qemu: ignore assumptions about hotplug requirement when address is from config

Certain PCI buses don't support hotplug, and when automatically
assigning PCI addresses for devices, libvirt is very conservative in
its assumptions about whether or not a device will need to be
hotplugged/unplugged in the future. But if the user manually assigns
an address, they likely are aware of any hotplug requirements of the
device (or at least they should be).

In short, after this patch, automatically PCI address assignment will
assume that the device must be plugged in to a hot-pluggable slot, but
manually assignment can place the device in any bus that is
compatible, regardless of whether or not it supports hotplug. If the
user makes a mistake and plugs the device into a bus that doesn't
support hotplug, then later tries to do a hot-unplug, qemu will give
an appropriate error.

(in the future we may want to add a "hotpluggable" attribute to all
devices, with default being "yes" for autoassign, and "no" for manual
assign).

9 years agoqemu: always permit PCI devices to be manually assigned to a PCIe bus
Laine Stump [Tue, 9 Jun 2015 17:33:36 +0000 (13:33 -0400)]
qemu: always permit PCI devices to be manually assigned to a PCIe bus

When support for the pcie-root and dmi-to-pci-bridge buses on a Q35
machinetype was added, I was concerned that even though qemu at the
time allowed plugging a PCI device into a PCIe port, that it might not
be supported in the future. To prevent painful backtracking in the
possible future where this happened, I disallowed such connections
except in a few specific cases requested by qemu developers (indicated
in the code with the flag VIR_PCI_CONNECT_TYPE_EITHER_IF_CONFIG).

Now that a couple years have passed, there is a clear message from
qemu that there is no danger in allowing PCI devices to be plugged
into PCIe ports. This patch eliminates
VIR_PCI_CONNECT_TYPE_EITHER_IF_CONFIG and changes the code to always
allow PCI->PCIe or PCIe->PCI connection *when the PCI address is
specified in the config. (For newly added devices that haven't yet
been given a PCI address, the auto-placement still prefers using the
correct type of bus).

9 years agoqemu: refactor qemuBuildControllerDevStr to eliminate future duplicate code
Laine Stump [Tue, 16 Jun 2015 19:22:57 +0000 (15:22 -0400)]
qemu: refactor qemuBuildControllerDevStr to eliminate future duplicate code

The PCI case of the switch statement in this function contains another
switch statement with a case for each model. Currently every model
except pci-root and pcie-root has a check for index > 0 (since only
those two can have index==0), and the function should never be called
for those two anyway. If we move the check for !pci[e]-root to the top
of the pci case, then we can move the check for index > 0 out of the
individual model cases. This will save repeating that check for the
three new controller models about to be added.

9 years agotest: qemu: Make sure that wr_highest_offset_valid gets set properly
Peter Krempa [Fri, 26 Jun 2015 14:40:29 +0000 (16:40 +0200)]
test: qemu: Make sure that wr_highest_offset_valid gets set properly

Remove one instance of the field being present so that the code that
sets that flag can be tested.

9 years agoqemu: monitor: Remove qemuMonitorGetBlockExtent
Peter Krempa [Tue, 23 Jun 2015 12:43:00 +0000 (14:43 +0200)]
qemu: monitor: Remove qemuMonitorGetBlockExtent

Now that qemuMonitorGetAllBlockStatsInfo collects also wr_highest_offset
the whole function can be killed.

9 years agoqemu: Refactor qemuDomainGetBlockInfo
Peter Krempa [Tue, 23 Jun 2015 16:22:54 +0000 (18:22 +0200)]
qemu: Refactor qemuDomainGetBlockInfo

Change the code so that it queries the monitor when the VM is alive.

9 years agoqemu: monitor: Open-code retrieval of wr_highest_offset
Peter Krempa [Tue, 23 Jun 2015 14:58:07 +0000 (16:58 +0200)]
qemu: monitor: Open-code retrieval of wr_highest_offset

Instead of using qemuMonitorJSONDevGetBlockExtent (which I plan to
remove later) extract the data in place.

Additionally add a flag that will be set when the wr_highest_offset was
extracted correctly so that callers can act according to that.

The test case addition should help make sure that everything works.

9 years agoqemu: monitor: Fix indentation in qemuMonitorJSONGetOneBlockStatsInfo
Peter Krempa [Tue, 23 Jun 2015 13:11:17 +0000 (15:11 +0200)]
qemu: monitor: Fix indentation in qemuMonitorJSONGetOneBlockStatsInfo