[libvirt] ANNOUNCE: virt-manager 1.2.0 released
by Cole Robinson
I'm happy to announce the release of virt-manager 1.2.0!
virt-manager is a desktop application for managing KVM, Xen, and LXC
virtualization via libvirt.
The release can be downloaded from:
http://virt-manager.org/download/
The direct download links are:
http://virt-manager.org/download/sources/virt-manager/virt-manager-1.2.0....
This release includes:
- OVMF/AAVMF Support (Laszlo Ersek, Giuseppe Scrivano, Cole Robinson)
- Improved support for AArch64 qemu/kvm
- virt-install: Support --disk type=network parameters
- virt-install: Make --disk just work
- virt-install: Add --disk sgio= option (Giuseppe Scrivano)
- addhardware: default to an existing bus when adding a new disk
(Giuseppe Scrivano)
- virt-install: Add --input device option
- virt-manager: Unify storagebrowser and storage details functionality
- virt-manager: allow setting a custom connection row name
- virt-install: Support --hostdev scsi passthrough
- virt-install: Fill in a bunch of --graphics spice options
- Disable spice image compression for new local VMs
- virt-manager: big reworking of the migration dialog
Thanks to everyone who has contributed to this release through testing,
bug reporting, submitting patches, and otherwise sending in feedback!
Thanks,
Cole
9 years, 7 months
[libvirt] [PATCH] Allow PCI virtio on ARM "virt" machine
by Pavel Fedin
Virt machine in qemu has PCI generic host controller, and can use PCI devices. This
provides performance improvement as well as vhost-net with irqfd support for virtio-net.
However libvirt still insists on virtio devices attached to Virt machine to have MMIO
bindings.
This patch allows to use both. If the user doesn't specify <address type='virtio-mmio'>,
PCI will be used by default.
"virt-" prefix is intentionally ignored in third chunk because it is a temporary thing
and qemu developers agreed to use "gic version" option, for which there is already support
in libvirt.
---
src/qemu/qemu_command.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 81e89fc..0580a37 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -457,7 +457,7 @@ qemuDomainSupportsNicdev(virDomainDefPtr def,
/* non-virtio ARM nics require legacy -net nic */
if (((def->os.arch == VIR_ARCH_ARMV7L) ||
(def->os.arch == VIR_ARCH_AARCH64)) &&
- net->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO)
+ strcmp(net->model, "virtio"))
return false;
return true;
@@ -1374,9 +1374,7 @@ qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
{
if (((def->os.arch == VIR_ARCH_ARMV7L) ||
(def->os.arch == VIR_ARCH_AARCH64)) &&
- (STRPREFIX(def->os.machine, "vexpress-") ||
- STREQ(def->os.machine, "virt") ||
- STRPREFIX(def->os.machine, "virt-")) &&
+ STRPREFIX(def->os.machine, "vexpress-") &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) {
qemuDomainPrimeVirtioDeviceAddresses(
def, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO);
@@ -2501,6 +2499,12 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
continue;
+ if (((def->os.arch == VIR_ARCH_ARMV7L) ||
+ (def->os.arch == VIR_ARCH_AARCH64)) &&
+ STREQ(def->os.machine, "virt") &&
+ def->disks[i]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO)
+ continue;
+
if (def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("virtio disk cannot have an address of type '%s'"),
--
1.9.5.msysgit.0
9 years, 7 months
[libvirt] [PATCH 0/2] Adjust refresh capabilities cache algorithm
by John Ferlan
Based on RFC posted and discussion therein:
http://www.redhat.com/archives/libvir-list/2015-May/msg00655.html
Threw away 1/2 from the RFC, but kept 2/2 since that seemed to be
generally acceptible - even if it's still not clear the exact steps
taken in order to create the problem. So 2/2 becomes 1/2 here.
Added in a new 2/2 which adds LIBVIR_VERSION_NUMBER as a variable
in the decision process for whether to refresh the cache. The theory
behind this is if there's any oddities with time algorithms and
time changes perhaps affecting 'ctime' - at least if the version
is different in the cache file than determined for the running
libvirtd, then we'll refresh that cache file.
John Ferlan (2):
qemu: Force capabilities cache refresh if libvirtd date is different
qemu: Add libvirt version check to refresh capabilities algorithm
src/qemu/qemu_capabilities.c | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
--
2.1.0
9 years, 7 months
[libvirt] [PATCH 0/8 v2] parallels: add vz driver
by Maxim Nestratov
v1-v2 change:
* Only "parallels: accept vz as a driver uri and name" patch
is changed. Fixed ability to connect to 'parallels' driver
and deal with 'Paralells' domain virt type.
Maxim Nestratov (8):
parallels: introduce vz driver constant and string
parallels: use newly introduced VIR_DOMAIN_VIRT_VZ
parallels: add new guest capabilities assigned to vz driver
parallels: accept vz as a driver uri and name
parallels: add a new vz connection driver and hypervisor structures
parallels: increment the number of connection drivers
parallels: recommend to connect to vz:///system when connection fails
parallels: set VIR_DOMAIN_VIRT_VZ virtType for new domains
src/conf/domain_conf.c | 19 ++++++++----
src/conf/domain_conf.h | 1 +
src/libvirt.c | 2 +-
src/parallels/parallels_driver.c | 61 +++++++++++++++++++++++++++++++++++----
src/parallels/parallels_network.c | 3 +-
src/parallels/parallels_sdk.c | 2 +-
src/parallels/parallels_storage.c | 3 +-
7 files changed, 75 insertions(+), 16 deletions(-)
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] po: fix translation error for "caller" in zh_CN.po
by zhang bo
IME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
caller should be translated to "璋冪敤绋嬪簭" rather than "璋冨害绋嬪簭", which in fact
refers to "scheduler" in English.
---
po/zh_CN.po | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/po/zh_CN.po b/po/zh_CN.po
index f5c7cf1..38cf6a9 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -20800,12 +20800,12 @@ msgstr "瀹夊叏 doi 瓒呰繃鏈€澶ч暱搴︼細%zu"
#: src/remote/remote_driver.c:2639
msgid "caller ignores cookie or cookielen"
-msgstr "璋冨害绋嬪簭蹇界暐 cookie 鎴栬€?cookielen"
+msgstr "璋冪敤绋嬪簭蹇界暐 cookie 鎴栬€?cookielen"
#: src/remote/remote_driver.c:2648 src/remote/remote_driver.c:6106
#: src/remote/remote_driver.c:7136
msgid "caller ignores uri_out"
-msgstr "璋冨害绋嬪簭蹇界暐 uri_out"
+msgstr "璋冪敤绋嬪簭蹇界暐 uri_out"
#: src/remote/remote_driver.c:2781
#, c-format
@@ -20892,7 +20892,7 @@ msgstr "鏃?internalFlags 鏀寔"
#: src/remote/remote_driver.c:7127 src/remote/remote_driver.c:7225
#: src/remote/remote_driver.c:7297 src/remote/remote_driver.c:7370
msgid "caller ignores cookieout or cookieoutlen"
-msgstr "鍡茬敤绋嬪簭蹇界暐 cookieout 鎴栬€?cookieoutlen"
+msgstr "璋冪敤绋嬪簭蹇界暐 cookieout 鎴栬€?cookieoutlen"
#: src/remote/remote_driver.c:6386
#, c-format
@@ -25090,7 +25090,7 @@ msgstr "鍦?Win32 骞冲彴涓儴鏀寔鎵ц鏂拌繘绋?
#: src/util/vircommand.c:2224
msgid "cannot mix caller fds with blocking execution"
-msgstr "鏃犳硶灏嗚皟搴︾▼搴?fd 涓庨樆姝㈡墽琛屾贩鍚?
+msgstr "鏃犳硶灏嗚皟鐢ㄧ▼搴?fd 涓庨樆姝㈡墽琛屾贩鍚?
#: src/util/vircommand.c:2230
msgid "cannot mix string I/O with daemon"
--
1.7.12.4
9 years, 7 months
[libvirt] [RFC PATCH] threshold: new API virDomainBlockSetWriteThreshold
by Eric Blake
qemu 2.3 added a new QMP command block-set-write-threshold,
which allows callers to get an interrupt when a file hits a
write threshold, rather than the current approach of repeatedly
polling for file allocation. This patch prepares the API for
callers to register to receive the event, as well as a way
to query the threshold.
The event is one-shot in qemu - a guest must re-register a new
threshold after each time it triggers. However, the
virConnectDomainEventRegisterAny() call does not allow
parameterization, so callers must use a pair of APIs - one
to register the callback (one-time call), and another to
repeatedly set the desired threshold (repeated each time a
threshold changes).
Note that the threshold is registered as a double, but reported
as an unsigned long long. This is intentional, as it allows
the use of a flag for registering a threshold via a percentage,
but once registered, the threshold is normalized according to
the current size of the disk.
To make the patch series more digestible, this patch
intentionally omits remote support, by using a couple of
placeholders at a point where the compiler forces the addition
of a case within a switch statement.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Posting now to get feedback on the proposed API, before the actual
implementation is complete.
daemon/remote.c | 2 +
include/libvirt/libvirt-domain.h | 48 +++++++++++++++++++
src/conf/domain_event.c | 4 +-
src/driver-hypervisor.h | 7 +++
src/libvirt-domain.c | 101 +++++++++++++++++++++++++++++++++++++++
src/libvirt_public.syms | 1 +
tools/virsh-domain.c | 23 +++++++++
tools/virsh.pod | 1 +
8 files changed, 186 insertions(+), 1 deletion(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index e259a76..51d7de5 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -1102,6 +1102,8 @@ static virConnectDomainEventGenericCallback domainEventCallbacks[] = {
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventTunable),
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventAgentLifecycle),
VIR_DOMAIN_EVENT_CALLBACK(remoteRelayDomainEventDeviceAdded),
+ /* TODO: Implement RPC support for this */
+ VIR_DOMAIN_EVENT_CALLBACK(NULL),
};
verify(ARRAY_CARDINALITY(domainEventCallbacks) == VIR_DOMAIN_EVENT_ID_LAST);
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index d851225..0c4fd62 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -515,6 +515,15 @@ typedef virDomainBlockStatsStruct *virDomainBlockStatsPtr;
# define VIR_DOMAIN_BLOCK_STATS_ERRS "errs"
/**
+ * VIR_DOMAIN_BLOCK_STATS_WRITE_THRESHOLD:
+ *
+ * Macro represents the typed parameter, as an llong, that reports
+ * the threshold in bytes at which the block device will trigger a
+ * VIR_DOMAIN_EVENT_ID_WRITE_THRESHOLD, or 0 if no threshold is registered.
+ */
+# define VIR_DOMAIN_BLOCK_STATS_WRITE_THRESHOLD "write-threshold"
+
+/**
* virDomainInterfaceStats:
*
* Network interface stats for virDomainInterfaceStats.
@@ -1297,6 +1306,16 @@ int virDomainBlockStatsFlags (virDomainPtr dom,
virTypedParameterPtr params,
int *nparams,
unsigned int flags);
+
+typedef enum {
+ /* threshold is a percentage rather than byte limit */
+ VIR_DOMAIN_BLOCK_SET_WRITE_THRESHOLD_PERCENTAGE = (1 << 0),
+} virDomainBlockSetWriteThresholdFlags;
+int virDomainBlockSetWriteThreshold(virDomainPtr dom,
+ const char *disk,
+ double threshold,
+ unsigned int flags);
+
int virDomainInterfaceStats (virDomainPtr dom,
const char *path,
virDomainInterfaceStatsPtr stats,
@@ -3246,6 +3265,34 @@ typedef void (*virConnectDomainEventDeviceAddedCallback)(virConnectPtr conn,
void *opaque);
/**
+ * virConnectDomainEventWriteThresholdCallback:
+ * @conn: connection object
+ * @dom: domain on which the event occurred
+ * @devAlias: device alias
+ * @threshold: threshold that was exceeded, in bytes
+ * @length: length beyond @threshold that was involved in the triggering write
+ * @opaque: application specified data
+ *
+ * The callback signature to use when registering for an event of type
+ * VIR_DOMAIN_EVENT_ID_WRITE_THRESHOLD with virConnectDomainEventRegisterAny()
+ *
+ * This callback occurs when a block device detects a write event that
+ * exceeds a non-zero threshold set by
+ * virDomainBlockSetWriteThreshold(). When this event occurs, the
+ * threshold is reset to 0, and a new limit must be installed to see
+ * the event again on the same device. The intent of this event is to
+ * allow time for the underlying storage to be resized dynamically
+ * prior to the point where the guest would be paused due to running
+ * out of space, without having to poll for allocation values.
+ */
+typedef void (*virConnectDomainEventWriteThresholdCallback)(virConnectPtr conn,
+ virDomainPtr dom,
+ const char *devAlias,
+ unsigned long long threshold,
+ unsigned long long length,
+ void *opaque);
+
+/**
* VIR_DOMAIN_TUNABLE_CPU_VCPUPIN:
*
* Macro represents formatted pinning for one vcpu specified by id which is
@@ -3528,6 +3575,7 @@ typedef enum {
VIR_DOMAIN_EVENT_ID_TUNABLE = 17, /* virConnectDomainEventTunableCallback */
VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE = 18,/* virConnectDomainEventAgentLifecycleCallback */
VIR_DOMAIN_EVENT_ID_DEVICE_ADDED = 19, /* virConnectDomainEventDeviceAddedCallback */
+ VIR_DOMAIN_EVENT_ID_WRITE_THRESHOLD = 20, /* virConnectDomainEventWriteThreshold */
# ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_EVENT_ID_LAST
diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
index 20d66e1..c43799f 100644
--- a/src/conf/domain_event.c
+++ b/src/conf/domain_event.c
@@ -1,7 +1,7 @@
/*
* domain_event.c: domain event queue processing helpers
*
- * Copyright (C) 2010-2014 Red Hat, Inc.
+ * Copyright (C) 2010-2015 Red Hat, Inc.
* Copyright (C) 2008 VirtualIron
* Copyright (C) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
*
@@ -1614,6 +1614,8 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn,
goto cleanup;
}
+ case VIR_DOMAIN_EVENT_ID_WRITE_THRESHOLD:
+ /* TODO: Implement RPC support for this */
case VIR_DOMAIN_EVENT_ID_LAST:
break;
}
diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h
index 3275343..81b80d3 100644
--- a/src/driver-hypervisor.h
+++ b/src/driver-hypervisor.h
@@ -484,6 +484,12 @@ typedef int
unsigned int flags);
typedef int
+(*virDrvDomainBlockSetWriteThreshold)(virDomainPtr domain,
+ const char *disk,
+ double threshold,
+ unsigned int flags);
+
+typedef int
(*virDrvDomainInterfaceStats)(virDomainPtr domain,
const char *path,
virDomainInterfaceStatsPtr stats);
@@ -1324,6 +1330,7 @@ struct _virHypervisorDriver {
virDrvDomainBlockResize domainBlockResize;
virDrvDomainBlockStats domainBlockStats;
virDrvDomainBlockStatsFlags domainBlockStatsFlags;
+ virDrvDomainBlockSetWriteThreshold domainBlockSetWriteThreshold;
virDrvDomainInterfaceStats domainInterfaceStats;
virDrvDomainSetInterfaceParameters domainSetInterfaceParameters;
virDrvDomainGetInterfaceParameters domainGetInterfaceParameters;
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 2edba1a..a211de0 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -5743,6 +5743,105 @@ virDomainBlockStatsFlags(virDomainPtr dom,
/**
+ * virDomainBlockSetWriteThreshold:
+ * @dom: pointer to domain object
+ * @disk: path to the block device, or device shorthand
+ * @threshold: limit at which a write threshold event can trigger
+ * @flags: bitwise-OR of virDomainBlockSetWriteThresholdFlags
+ *
+ * This function is used to set a one-shot write threshold. It should
+ * be used in tandem with virConnectDomainEventRegisterAny()
+ * installing a handler for VIR_DOMAIN_EVENT_ID_WRITE_THRESHOLD. If
+ * the hypervisor detects that a write request (whether guest data, or
+ * host metadata) would exceed the host byte offset specified in
+ * @threshold, then an event is raised, and the threshold is reset to
+ * 0 at that time. The event registration is only needed once, but
+ * this function must be called each time a new threshold is desired;
+ * the event will only fire if a non-zero threshold is
+ * exceeded.
+ *
+ * By default, @threshold is specified in bytes, and must not exceed
+ * the size of the block device. However, when @flags includes
+ * VIR_DOMAIN_BLOCK_SET_WRITE_THRESHOLD_PERCENTAGE, @threshold is
+ * instead a value between 0.0 and 100.0, and the driver will compute
+ * a byte value based on the current size of the disk. A driver may
+ * round the requested threshold to a granularity that can actually
+ * be supported.
+ *
+ * Setting a threshold allows event-based resizing of host resources
+ * that back a guest disk without having to poll the current disk
+ * allocation, while still having enough time to complete the resize
+ * before the guest would end up halting due to insufficient space.
+ * Calling this function to set the threshold back to zero will stop
+ * further firing of the event. virDomainBlockStatsFlags() and
+ * virConnectGetAllDomainStats() can be used to track the current
+ * threshold value, always in the form normalized to bytes.
+ *
+ * The @disk parameter is either the device target shorthand (the
+ * <target dev='...'/> sub-element, such as "vda"), or (since 0.9.8)
+ * an unambiguous source name of the block device (the <source
+ * file='...'/> sub-element, such as "/path/to/image"). Valid names
+ * can be found by calling virDomainGetXMLDesc() and inspecting
+ * elements within //domain/devices/disk. Some drivers might also
+ * accept strings such as "vda[1]" for setting the threshold of a
+ * backing image, useful when doing a block commit into the backing
+ * image.
+ *
+ * Domains may have more than one block device. To set thresholds for
+ * each you should make multiple calls to this function. If write
+ * thresholds are not supported, an application will have to instead
+ * poll virDomainGetBlockInfo() or similar to track allocation.
+ *
+ * Returns -1 in case of error, 0 in case of success.
+ */
+int
+virDomainBlockSetWriteThreshold(virDomainPtr dom,
+ const char *disk,
+ double threshold,
+ unsigned int flags)
+{
+ virConnectPtr conn;
+
+ VIR_DOMAIN_DEBUG(dom, "disk=%s, threshold=%g, flags=%x",
+ disk, threshold, flags);
+
+ virResetLastError();
+
+ virCheckDomainReturn(dom, -1);
+ virCheckNonNullArgGoto(disk, error);
+ virCheckNonNegativeArgGoto(threshold, error);
+ if (flags & VIR_DOMAIN_BLOCK_SET_WRITE_THRESHOLD_PERCENTAGE) {
+ if (threshold > 100.0)
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("threshold in %s must be a percentage"),
+ __FUNCTION__);
+ goto error;
+ } else {
+ if (threshold > LLONG_MAX)
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("threshold in %s must fit in unsigned long long"),
+ __FUNCTION__);
+ goto error;
+ }
+ conn = dom->conn;
+
+ if (conn->driver->domainBlockSetWriteThreshold) {
+ int ret;
+ ret = conn->driver->domainBlockSetWriteThreshold(dom, disk, threshold,
+ flags);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+ virReportUnsupportedError();
+
+ error:
+ virDispatchError(dom->conn);
+ return -1;
+}
+
+
+/**
* virDomainInterfaceStats:
* @dom: pointer to the domain object
* @path: path to the interface
@@ -11201,6 +11300,8 @@ virConnectGetDomainCapabilities(virConnectPtr conn,
* unsigned long long.
* "block.<num>.errors" - Xen only: the 'oo_req' value as
* unsigned long long.
+ * "block.<num>.write-threshold" - byte at which a write threshold event
+ * will fire, as unsigned long long.
* "block.<num>.allocation" - offset of the highest written sector
* as unsigned long long.
* "block.<num>.capacity" - logical size in bytes of the block device backing
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index 716dd2f..5131fcf 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -712,6 +712,7 @@ LIBVIRT_1.2.15 {
LIBVIRT_1.2.16 {
global:
+ virDomainBlockSetWriteThreshold;
virDomainSetUserPassword;
} LIBVIRT_1.2.15;
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 91a1ca2..98db6a3 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -12150,6 +12150,27 @@ vshEventDeviceAddedPrint(virConnectPtr conn ATTRIBUTE_UNUSED,
}
static void
+vshEventWriteThresholdPrint(virConnectPtr conn ATTRIBUTE_UNUSED,
+ virDomainPtr dom,
+ const char *alias,
+ unsigned long long threshold,
+ unsigned long long length,
+ void *opaque)
+{
+ vshDomEventData *data = opaque;
+
+ if (!data->loop && *data->count)
+ return;
+ vshPrint(data->ctl,
+ _("event 'write-threshold' for domain %s disk %s: threshold %lld "
+ "exceeded by %lld bytes\n"),
+ virDomainGetName(dom), alias, threshold, length);
+ (*data->count)++;
+ if (!data->loop)
+ vshEventDone(data->ctl);
+}
+
+static void
vshEventTunablePrint(virConnectPtr conn ATTRIBUTE_UNUSED,
virDomainPtr dom,
virTypedParameterPtr params,
@@ -12256,6 +12277,8 @@ static vshEventCallback vshEventCallbacks[] = {
VIR_DOMAIN_EVENT_CALLBACK(vshEventAgentLifecyclePrint), },
{ "device-added",
VIR_DOMAIN_EVENT_CALLBACK(vshEventDeviceAddedPrint), },
+ { "write-threshold",
+ VIR_DOMAIN_EVENT_CALLBACK(vshEventWriteThresholdPrint), },
};
verify(VIR_DOMAIN_EVENT_ID_LAST == ARRAY_CARDINALITY(vshEventCallbacks));
diff --git a/tools/virsh.pod b/tools/virsh.pod
index d588e5a..14dd2c3 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -919,6 +919,7 @@ local file or block device,
"block.<num>.fl.reqs" - total flush requests,
"block.<num>.fl.times" - total time (ns) spent on cache flushing,
"block.<num>.errors" - Xen only: the 'oo_req' value,
+"block.<num>.write-threshold" - write threshold event trigger, in bytes,
"block.<num>.allocation" - offset of highest written sector in bytes,
"block.<num>.capacity" - logical size of source file in bytes,
"block.<num>.physical" - physical size of source file in bytes
--
2.1.0
9 years, 7 months
[libvirt] [PATCH] storage: Fix problem with disk backend pool allocation calculation
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1224018
The disk pool recalculates the pool allocation, capacity, and available
values each time through processing a newly created disk partition.
However, there were two issues with doing so. The process generally is
to read the partition table via virStorageBackendDiskReadPartitions and
process the volume. This is called during create and refresh backend
API's with the only difference being create passes a specific volume
to be processed while refresh processes all volumes (passing NULL for
the volume value).
The first issue via virStorageBackendDiskCreateVol was that the pool's
available value was cleared, so when virStorageBackendDiskMakeVol
processes the (new) volume it will ignore any other partitions on the
disk, thus after returning the pool allocation would only include the
newly added volume.
The second is while processing a partition, the adjustment of the
available value depends on the type of partition. For "primary" and
"logical" partitions, the available value was adjusted. However, for
"extended" partitions, the available value wasn't adjusted. Since the
calling function(s) storageVolCreateXML[From] will only adjust the
pool available value when they determine that the backend code didn't
this resulted in the available value being incorrectly adjusted by
that code. If a pool refresh was executed, the "correct" value showed up.
To fix the first issue, only clear the available value when we're
being processed from the refresh path (vol will be NULL). To fix the
second issue, increment available by 1 so that the calling function
won't adjust after we're done. That could leave the appearance of a
single byte being used by a pool that only has an extended partition,
but that's better than having it show up as the size of the partition
until someone refreshes. The refresh path will also nick by the same
value so it'll be consistent.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/storage/storage_backend_disk.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c
index 6394dac..bc14aab 100644
--- a/src/storage/storage_backend_disk.c
+++ b/src/storage/storage_backend_disk.c
@@ -164,8 +164,18 @@ virStorageBackendDiskMakeDataVol(virStoragePoolObjPtr pool,
return -1;
}
+ /* For "data", adjust the pool's allocation by the size of the volume
+ * For "metadata" (aka "extended" volume), we haven't yet used the space;
+ * however, the calling createVol path will adjust the pool allocation
+ * by the volume allocation if it determines a storage backend doesn't
+ * adjust the pool's allocation value. So bump the allocation to avoid
+ * having the calling code misrepresent the value. The refresh path
+ * would resolve/change the value.
+ */
if (STRNEQ(groups[2], "metadata"))
pool->def->allocation += vol->target.allocation;
+ else
+ pool->def->allocation++;
if (vol->source.extents[0].end > pool->def->capacity)
pool->def->capacity = vol->source.extents[0].end;
@@ -309,7 +319,13 @@ virStorageBackendDiskReadPartitions(virStoragePoolObjPtr pool,
pool->def->source.devices[0].path,
NULL);
- pool->def->allocation = pool->def->capacity = pool->def->available = 0;
+ /* The reload/restart/refresh path will recalculate everything;
+ * otherwise, keep allocation as is as capacity and available
+ * will be adjusted
+ */
+ if (!vol)
+ pool->def->allocation = 0;
+ pool->def->capacity = pool->def->available = 0;
ret = virCommandRunNul(cmd,
6,
--
2.1.0
9 years, 7 months
[libvirt] Strange test build failure
by Dimitri John Ledkov
# VIR_TEST_VERBOSE=1 VIR_TEST_DEBUG=1 ./qemuxml2argvtest 2>&1 | grep NUMA
61) QEMU XML-2-ARGV hugepages-pages
... libvirt: error : unsupported configuration: NUMA node 1 is
unavailable
64) QEMU XML-2-ARGV hugepages-shared
... libvirt: error : unsupported configuration: NUMA node 1 is
unavailable
331) QEMU XML-2-ARGV numatune-memnode
... libvirt: error : unsupported configuration: NUMA node 1 is
unavailable
333) QEMU XML-2-ARGV numatune-memnode-no-memory
... libvirt: error : unsupported configuration: NUMA node 3 is
unavailable
336) QEMU XML-2-ARGV numatune-auto-prefer
... libvirt: error : unsupported configuration: NUMA node 1 is
unavailable
449) QEMU XML-2-ARGV memory-hotplug-dimm
... libvirt: error : unsupported configuration: NUMA node 1 is
unavailable
450) QEMU XML-2-ARGV memory-hotplug-dimm-addr
... libvirt: error : unsupported configuration: NUMA node 1 is
unavailable
So the test fails, but I don't believe I'm compiling libvirt with
numad support... So I don't understand what is being asserted here.
--
Regards,
Dimitri.
Pura Vida!
https://clearlinux.org
Open Source Technology Center
Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.
9 years, 7 months
[libvirt] [PATCH 00/10] Get ready for migration events
by Jiri Denemark
QEMU will soon get support for migration events which will finally
allows us to get rid of polling query-migrate every 50ms. However, we
first need to be able to wait for all events related to migration
(migration status changes, block job events, async abort requests) at
once. This series prepares the infrastructure which will allows us to do
it (patches 1 and 2) and then makes use of it for block job events
(patch 4) and abort requests (patch 10). Patch 8 fixes a bug in
migration recovery after libvirtd restarts. The rest of the patches are
mostly cleanups or bugfixes or other small changes required by the 5
main patches.
Jiri Denemark (10):
util: Introduce thread queues
thread: Create thread local condition for every thread
qemu: Introduce qemuBlockJobUpdate
qemu: Properly report failed migration
qemu: Use thread queues for synchronous block jobs
qemu: Don't mess up with disk->mirrorState
Pass domain object to private data formatter/parser
qemu: Make qemuMigrationCancelDriveMirror usable without async job
qemu: Cancel disk mirrors after libvirtd restart
qemu: Use thread queues for asyncAbort
po/POTFILES.in | 2 +-
src/Makefile.am | 2 +
src/conf/domain_conf.c | 4 +-
src/conf/domain_conf.h | 6 +-
src/libvirt_private.syms | 17 ++
src/libxl/libxl_domain.c | 10 +-
src/lxc/lxc_domain.c | 12 +-
src/qemu/qemu_blockjob.c | 177 +++++----------------
src/qemu/qemu_blockjob.h | 15 +-
src/qemu/qemu_domain.c | 97 +++++++++---
src/qemu/qemu_domain.h | 8 +-
src/qemu/qemu_driver.c | 24 ++-
src/qemu/qemu_migration.c | 392 +++++++++++++++++++++++++++++-----------------
src/qemu/qemu_migration.h | 3 +
src/qemu/qemu_process.c | 17 +-
src/util/virthread.c | 21 ++-
src/util/virthreadqueue.c | 343 ++++++++++++++++++++++++++++++++++++++++
src/util/virthreadqueue.h | 54 +++++++
18 files changed, 841 insertions(+), 363 deletions(-)
create mode 100644 src/util/virthreadqueue.c
create mode 100644 src/util/virthreadqueue.h
--
2.4.1
9 years, 7 months