libvirt/src
John Ferlan cf436a560d qemu: Fix GetBlockInfo setting allocation from wr_highest_offset
The libvirt-domain.h documentation indicates that for a qcow2 file
in a filesystem being used for a backing store should report the disk
space occupied by a file; however, commit id '15fa84ac' altered the
code to trust that the wr_highest_offset should be used whenever
wr_highest_offset_valid was set.

As it turns out this will lead to indeterminite results. For an active
domain when qemu hasn't yet had the need to find the wr_highest_offset
value, qemu will report 0 even though qemu-img will report the proper
disk size. This causes reporting of the following XML:

  <disk type='file' device='disk'>
    <driver name='qemu' type='qcow2'/>
    <source file='/path/to/test-1g.qcow2'/>

to be as follows:

Capacity:       1073741824
Allocation:     0
Physical:       1074139136

with qemu-img indicating:

image: /path/to/test-1g.qcow2
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 1.0G

Once the backing source file is opened on the guest, then wr_highest_offset
is updated, but only to the high water mark and not the size of the file.

This patch will adjust the logic to check for the file backed qcow2 image
and enforce setting the allocation to the returned 'physical' value, which
is the 'actual-size' value from a 'query-block' operation.

NB: The other consumer of the wr_highest_offset output (GetAllDomainStats)
has a contract that indicates 'allocation' is the offset of the highest
written sector, so it doesn't need adjustment.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2016-12-12 16:04:17 -05:00
..
access conf: Add new secret type "tls" 2016-09-09 08:20:05 -04:00
admin admin: Use the newly introduced close callback handling helpers 2016-11-14 10:18:56 +01:00
bhyve virstring: Unify string list function names 2016-11-25 13:54:05 +01:00
conf qemu: Fix xml dump of autogenerated websocket 2016-12-09 07:54:39 -05:00
cpu configure: remove check for CPUID 2016-12-07 16:21:31 +01:00
esx Forbid new-line char in name of new domain 2016-11-22 14:35:14 +01:00
hyperv hyperv: additional server 2008 wmi classes 2016-09-15 09:27:48 +02:00
interface Fix Multiple Typos 2016-09-22 13:55:09 -04:00
libxl Move virstat.c code to virnetdevtap.c 2016-12-09 10:28:07 +01:00
locking src: Treat PID as signed 2016-10-13 17:58:56 +08:00
logging daemon: Split filter parsing and filter defining 2016-10-10 08:27:25 +02:00
lxc Move virstat.c code to virnetdevtap.c 2016-12-09 10:28:07 +01:00
network network: Track MAC address map 2016-12-06 13:33:18 +01:00
node_device util: Alter return value of virReadFCHost and fix mem leak 2016-10-14 06:47:36 -04:00
nwfilter global: consistently use IP rather than Ip in identifiers 2016-06-26 19:33:07 -04:00
openvz Move virstat.c code to virnetdevtap.c 2016-12-09 10:28:07 +01:00
phyp conf: Extend virDomainDeviceDefPostParse for parseOpaque 2016-09-26 16:50:12 +02:00
qemu qemu: Fix GetBlockInfo setting allocation from wr_highest_offset 2016-12-12 16:04:17 -05:00
remote virstring: Unify string list function names 2016-11-25 13:54:05 +01:00
rpc genprotocol.pl: add darwin to fixup list 2016-11-24 17:17:43 +03:00
secret secret: Move virStorageSecretType and rename 2016-06-23 12:30:27 -04:00
security security: Drop virSecurityManagerSetHugepages 2016-12-08 15:45:52 +01:00
storage util: Introduce virStorageSourceUpdateCapacity 2016-12-12 16:04:17 -05:00
test test: fix screenshot API impl 2016-12-08 10:57:32 +00:00
uml Move virstat.c code to virnetdevtap.c 2016-12-09 10:28:07 +01:00
util util: Introduce virStorageSourceUpdateCapacity 2016-12-12 16:04:17 -05:00
vbox Fix minor typos 2016-12-02 09:25:13 +01:00
vmware Forbid new-line char in name of new domain 2016-11-22 14:35:14 +01:00
vmx Introduce virDomainChrSourceDefNew for virDomainChrDefPtr 2016-10-21 14:03:36 -04:00
vz vz: added VIR_MIGRATE_NON_SHARED_INC migration flag support 2016-12-09 17:21:53 +03:00
xen Move virstat.c code to virnetdevtap.c 2016-12-09 10:28:07 +01:00
xenapi Forbid new-line char in name of new domain 2016-11-22 14:35:14 +01:00
xenconfig xenFormatXLDisk: Unify commas pattern for arguments 2016-10-24 06:12:23 +02:00
admin_protocol-structs admin: Introduce virAdmServerSetClientLimits 2016-05-19 12:31:53 +02:00
check-aclperms.pl
check-aclrules.pl vz: add ACL checks to API calls 2016-08-23 19:48:01 +03:00
check-driverimpls.pl
check-drivername.pl
check-symfile.pl
check-symsorting.pl
datatypes.c admin: Use the newly introduced close callback handling helpers 2016-11-14 10:18:56 +01:00
datatypes.h datatypes: Introduce some admin-related close callback handling helpers 2016-11-14 10:18:56 +01:00
driver-hypervisor.h cpuGetModels: Switch to virArch 2016-09-22 15:40:08 +02:00
driver-interface.h
driver-network.h
driver-nodedev.h Introduce node device lifecycle event APIs 2016-08-02 09:52:00 -04:00
driver-nwfilter.h
driver-secret.h
driver-state.h
driver-storage.h Introduce storage lifecycle event APIs 2016-06-16 12:22:11 -04:00
driver-stream.h
driver.c driver.c:fix a typo 2016-09-21 16:17:22 -04:00
driver.h
dtrace2systemtap.pl
fdstream.c fdstream: don't raise error on SIGPIPE if abort requested 2016-05-02 10:13:05 -04:00
fdstream.h
internal.h internal: Introduce macro for stealing pointers 2016-08-05 08:38:20 +02:00
libvirt_admin_private.syms datatypes: Introduce some admin-related close callback handling helpers 2016-11-14 10:18:56 +01:00
libvirt_admin_public.syms admin: fix virt-admin startup crash by calling virAdmInitialize 2016-06-29 16:33:08 +02:00
libvirt_atomic.syms
libvirt_driver_modules.syms
libvirt_esx.syms
libvirt_gnutls.syms
libvirt_internal.h
libvirt_libssh2.syms
libvirt_libssh.syms libssh_transport: add new libssh-based transport 2016-11-15 15:50:51 +01:00
libvirt_linux.syms nodeinfo: move host CPU APIs out into virhostcpu.c file 2016-06-09 18:31:11 +01:00
libvirt_lxc.syms Bump release to 2.0.0 and document release schedule & versioning 2016-06-14 10:59:07 +02:00
libvirt_openvz.syms
libvirt_private.syms util: Introduce virStorageSourceUpdateCapacity 2016-12-12 16:04:17 -05:00
libvirt_probes.d
libvirt_public.syms Introduce node device lifecycle event APIs 2016-08-02 09:52:00 -04:00
libvirt_qemu_probes.d
libvirt_qemu.syms
libvirt_remote.syms Rename virNetClient*AddrString 2016-06-23 22:31:20 +02:00
libvirt_sasl.syms virneserverclient: Introduce virNetServerClientHasSASLSession 2016-05-03 15:52:50 +02:00
libvirt_vmware.syms
libvirt_vmx.syms
libvirt_xenconfig.syms
libvirt_xenxlconfig.syms
libvirt-admin.c admin: Use the newly introduced close callback handling helpers 2016-11-14 10:18:56 +01:00
libvirt-admin.conf
libvirt-domain-snapshot.c
libvirt-domain.c docs: Replace missing description for perf.cpu_cycles 2016-12-11 07:56:53 -05:00
libvirt-host.c cpu: Special case models == NULL in cpuGetModels 2016-09-22 15:40:08 +02:00
libvirt-interface.c
libvirt-lxc.c Don't error when attaching security label of model "none" 2016-08-03 10:58:31 +01:00
libvirt-lxc.pc.in
libvirt-network.c
libvirt-nodedev.c Fix various code comment typos 2016-09-26 08:06:30 -04:00
libvirt-nwfilter.c
libvirt-qemu.c
libvirt-qemu.pc.in
libvirt-secret.c
libvirt-storage.c storage: Document wiping formatted volume types 2016-08-02 07:01:57 +02:00
libvirt-stream.c virStream{Recv,Send}All: Increase client buffer 2016-05-02 07:56:38 +02:00
libvirt.c virconf: Fix config file path construction 2016-07-27 12:13:13 +02:00
libvirt.conf
libvirt.pc.in
lock_protocol-structs
lxc_monitor_protocol-structs
lxc_protocol-structs
Makefile.am Move virstat.c code to virnetdevtap.c 2016-12-09 10:28:07 +01:00
nodeinfo.c Remove separator argument from virBitmapParse 2016-06-20 12:09:52 +02:00
nodeinfo.h nodeinfo: move host memory APIs out into virhostmem file 2016-06-09 18:43:18 +01:00
qemu_protocol-structs
README
remote_protocol-structs Fix remote_protocol-structs after recent commit 2016-08-23 15:47:10 -04:00
virkeepaliveprotocol-structs
virnetprotocol-structs

       libvirt library code README
       ===========================

The directory provides the bulk of the libvirt codebase. Everything
except for the libvirtd daemon and client tools. The build uses a
large number of libtool convenience libraries - one for each child
directory, and then links them together for the final libvirt.so,
although some bits get linked directly to libvirtd daemon instead.

The files directly in this directory are supporting the public API
entry points & data structures.

There are two core shared modules to be aware of:

 * util/  - a collection of shared APIs that can be used by any
            code. This directory is always in the include path
            for all things built

 * conf/  - APIs for parsing / manipulating all the official XML
            files used by the public API. This directory is only
            in the include path for driver implementation modules

 * vmx/   - VMware VMX config handling (used by esx/ and vmware/)


Then there are the hypervisor implementations:

 * bhyve         - bhyve - The BSD Hypervisor
 * esx/          - VMware ESX and GSX support using vSphere API over SOAP
 * hyperv/       - Microsoft Hyper-V support using WinRM
 * lxc/          - Linux Native Containers
 * openvz/       - OpenVZ containers using cli tools
 * phyp/         - IBM Power Hypervisor using CLI tools over SSH
 * qemu/         - QEMU / KVM using qemu CLI/monitor
 * remote/       - Generic libvirt native RPC client
 * test/         - A "mock" driver for testing
 * uml/          - User Mode Linux
 * vbox/         - Virtual Box using native API
 * vmware/       - VMware Workstation and Player using the vmrun tool
 * xen/          - Xen using hypercalls, XenD SEXPR & XenStore
 * xenapi/       - Xen using libxenserver


Finally some secondary drivers that are shared for several HVs.
Currently these are used by LXC, OpenVZ, QEMU, UML and Xen drivers.
The ESX, Hyper-V, Power Hypervisor, Remote, Test & VirtualBox drivers all
implement the secondary drivers directly

 * cpu/          - CPU feature management
 * interface/    - Host network interface management
 * network/      - Virtual NAT networking
 * nwfilter/     - Network traffic filtering rules
 * node_device/  - Host device enumeration
 * secret/       - Secret management
 * security/     - Mandatory access control drivers
 * storage/      - Storage management drivers


Since both the hypervisor and secondary drivers can be built as
dlopen()able modules, it is *FORBIDDEN* to have build dependencies
between these directories. Drivers are only allowed to depend on
the public API, and the internal APIs in the util/ and conf/
directories