[libvirt] Libvirt bite sized tasks
by Michal Privoznik
Dear lists,
I've just started new wiki page which aim is to summarize small and
trivial tasks, that starting contributors can take, investigate and
implement. The aim is to give them something easy to start with while
not scaring them out about complexity of our code. The page can be found
here:
http://wiki.libvirt.org/page/BiteSizedTasks
The name is copied from qemu wiki:
http://wiki.qemu.org/BiteSizedTasks
Please, feel free to extend the list. I plan to use it in the future
when interviewing GSoC candidates.
Michal
8 years, 8 months
[libvirt] [FOR 1.3.0 PATCH] conf: add net device prefix for Xen
by Jim Fehlig
In commit d2e5538b1, the libxl driver was changed to copy interface
names autogenerated by libxl to the corresponding network def in the
domain's virDomainDef object. The copied name is freed when the domain
transitions to the shutoff state. But when migrating a domain, the
autogenerated name is included in the XML sent to the destination host.
It is possible an interface with the same name already exists on the
destination host, causing migration to fail. Indeed the Xen project's
OSSTEST CI already encountered such a failure.
This patch defines another VIR_NET_GENERATED_PREFIX for Xen, allowing
the autogenerated names to be excluded when parsing and formatting
inactive config.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
This is an alternative approach to Joao's fix for this regression
https://www.redhat.com/archives/libvir-list/2015-December/msg00197.html
I think it is the same approach used by the qemu driver. My only
reservation is that it expands the potential for clashes with
user-defined names. I.e. with this change both 'vnet' and 'vif' are
reserved prefixes.
src/conf/domain_conf.c | 6 ++++--
src/conf/domain_conf.h | 4 ++++
src/libxl/libxl_domain.c | 5 +++--
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 2f5c0ed..debcf4e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8428,7 +8428,8 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
ifname = virXMLPropString(cur, "dev");
if (ifname &&
(flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) &&
- STRPREFIX(ifname, VIR_NET_GENERATED_PREFIX)) {
+ (STRPREFIX(ifname, VIR_NET_GENERATED_PREFIX) ||
+ STRPREFIX(ifname, VIR_NET_GENERATED_PREFIX_XEN))) {
/* An auto-generated target name, blank it out */
VIR_FREE(ifname);
}
@@ -19790,7 +19791,8 @@ virDomainNetDefFormat(virBufferPtr buf,
virBufferEscapeString(buf, "<backenddomain name='%s'/>\n", def->domain_name);
if (def->ifname &&
!((flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE) &&
- (STRPREFIX(def->ifname, VIR_NET_GENERATED_PREFIX)))) {
+ (STRPREFIX(def->ifname, VIR_NET_GENERATED_PREFIX) ||
+ STRPREFIX(def->ifname, VIR_NET_GENERATED_PREFIX_XEN)))) {
/* Skip auto-generated target names for inactive config. */
virBufferEscapeString(buf, "<target dev='%s'/>\n", def->ifname);
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 90d8e13..d2cc26f 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1085,6 +1085,10 @@ struct _virDomainNetDef {
* by libvirt, and cannot be used for a persistent network name. */
# define VIR_NET_GENERATED_PREFIX "vnet"
+/* Used for prefix of ifname of any network name generated dynamically
+ * by libvirt for Xen, and cannot be used for a persistent network name. */
+# define VIR_NET_GENERATED_PREFIX_XEN "vif"
+
typedef enum {
VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT = 0,
VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED,
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index ef92974..c5d84a4 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -734,7 +734,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,
for (i = 0; i < vm->def->nnets; i++) {
virDomainNetDefPtr net = vm->def->nets[i];
- if (STRPREFIX(net->ifname, "vif"))
+ if (STRPREFIX(net->ifname, VIR_NET_GENERATED_PREFIX_XEN))
VIR_FREE(net->ifname);
}
}
@@ -918,7 +918,8 @@ libxlDomainCreateIfaceNames(virDomainDefPtr def, libxl_domain_config *d_config)
if (net->ifname)
continue;
- ignore_value(virAsprintf(&net->ifname, "vif%d.%d%s",
+ ignore_value(virAsprintf(&net->ifname,
+ VIR_NET_GENERATED_PREFIX_XEN "%d.%d%s",
def->id, x_nic->devid, suffix));
}
}
--
2.6.1
8 years, 9 months
[libvirt] [PATCH v7 00/13] qemu: Add quorum support to libvirt
by Matthias Gatto
The purpose of these patches is to introduce quorum for libvirt
I've try to follow this proposal:
http://www.redhat.com/archives/libvir-list/2014-May/msg00533.html
This feature ask for 5 task:
1) Allow a _virStorageSource to contain more than one backing store.
Because all the actual libvirt code use the backingStore field
as a pointer and we needs want to change that, I've decide to encapsulate
the backingStore field to simplifie the array manipulation.
2) Add the missing field a quorum need in _virStorageSource and
the VIR_STORAGE_TYPE_QUORUM and VIR_STORAGE_FILE_QUORUM in
their respectives enums.
3) Parse and format the xml
Because a quorum allows to have more than one backing store at the same level
we need to change virDomainDiskDefFormat and virDomainDiskDefParseXML
to call virDomainDiskBackingStoreFormat and virDomainDiskBackingStoreParse
in a loop.
virDomainDiskBackingStoreFormat and virDomainDiskBackingStoreParse can
call themself recursively in a loop because a quorum can contain another
quorum
4) Build qemu string
As for the xml, we have to call the function which create quorum recursively.
But this task have the problem explained here:
http://www.redhat.com/archives/libvir-list/2014-October/msg00529.html
The _virStorageSource missing some informations that can be passed to
a child, and therefore this version of quorum is incomplet.
5) Allow to hotplug/change a disk in a quorum
This part is not present in these patches because for this task
we have to use blockdev-add, and currently libvirt use
device_add for hotpluging that doesn't allow to hotplug quorum childs.
V2:
-Rebase on master
-Add Documentation
V3:
-Transforme the backingStore field in virStorageSource into
an array of pointer instead of a pointer
-Modify virStorageSourceSetBackingStore to allow it to expand
the backingStore size.
V4:
-Rebase on master
V5:
-Rebase on master
-patch 1-4/9: use patchs from John Ferlan
-patch 4/9: check return of virStorageSourceSetBackingStore
-patch 5/9: report type of error on virStorageSourceSetBackingStore
v6:
-Rebase on master
-Remove node-name patch
-patch 06/13: Add virStorageSourceIsRAID
-patch 10/13: Add virDomainDefHasRAID
-patch 11-13/13: Block all unsupported operations
v7:
-Rebase on master.
-Parse unconditionally backing store.
-fold qemuBuildRAIDFileSourceStr into qemuBuildRAIDStr.
-use 0/-1 return values when failing instead of bool.
-virStorageSourceSetBackingStore now free backing store when they are
already set.
Matthias Gatto (13):
virstoragefile: Add virStorageSourceGetBackingStore
virstoragefile: Always use virStorageSourceGetBackingStore to get
backing store
virstoragefile: Add virStorageSourceSetBackingStore
virstoragefile: Always use virStorageSourceSetBackingStore to set
backing store
virstoragefile: change backingStore to backingStores.
virstoragefile: Add virStorageSourceIsRAID
virstoragefile: Add quorum in virstoragefile
domain_conf: Read and Write quorum config
qemu: Add quorum support in qemuBuildDriveDevStr
domain: Add virDomainDefHasRAID
qemu: Forbid blocks operations with quorum
qemu: qemuDomainGetBlockInfo quorum support
qemu: qemuDiskPathToAlias quorum support
docs/formatdomain.html.in | 23 ++++-
docs/schemas/domaincommon.rng | 21 +++-
docs/schemas/storagecommon.rng | 1 +
docs/schemas/storagevol.rng | 1 +
src/conf/domain_conf.c | 174 ++++++++++++++++++++++++----------
src/conf/domain_conf.h | 1 +
src/conf/storage_conf.c | 23 +++--
src/libvirt_private.syms | 4 +
src/qemu/qemu_cgroup.c | 4 +-
src/qemu/qemu_command.c | 78 +++++++++++++++
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_driver.c | 72 ++++++++++----
src/qemu/qemu_migration.c | 1 +
src/qemu/qemu_monitor_json.c | 4 +-
src/security/security_dac.c | 2 +-
src/security/security_selinux.c | 4 +-
src/security/virt-aa-helper.c | 2 +-
src/storage/storage_backend.c | 24 +++--
src/storage/storage_backend_fs.c | 45 +++++----
src/storage/storage_backend_gluster.c | 11 ++-
src/storage/storage_backend_logical.c | 15 ++-
src/storage/storage_driver.c | 3 +-
src/util/virstoragefile.c | 121 ++++++++++++++++++++---
src/util/virstoragefile.h | 15 ++-
tests/virstoragetest.c | 18 ++--
25 files changed, 518 insertions(+), 151 deletions(-)
--
2.6.2
8 years, 9 months
[libvirt] [PATCH v2 0/5] Add virtio-gpu & virgl support
by Marc-André Lureau
The following series allow using virtio-gpu and virgl if qemu support
it. Ths Spice bits are not yet in qemu 2.5, but should make it in 2.6
and I added the RFC patches that are expected to not change much.
v1->v2: addressing Ján Tomko review
- update accel2d/accel3d to be tristate and fix its usage
- use a single QEMU_CAPS_DEVICE_VIRTIO_GPU cap for -device
virtio-gpu-* & virtio-vga
- remove qemu legacy, -vga support or command line parsing
- add xml2xml tests
- squash xml2argvtests with their respecitve feature addition commits
- update libvirt version in doc
- update commit messages
Marc-André Lureau (5):
Replace support{2d,3d} with accel{2d,3d}
domain: replace bool accel{2d,3d} with a tristate
qemu: add virtio video device
qemu: add virtio-gpu virgl support
RFC qemu: add spice opengl support
docs/formatdomain.html.in | 11 +-
docs/schemas/domaincommon.rng | 6 +
src/conf/domain_conf.c | 84 +-
src/conf/domain_conf.h | 6 +-
src/qemu/qemu_capabilities.c | 12 +
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_command.c | 40 +-
src/vbox/vbox_common.c | 18 +-
src/vz/vz_sdk.c | 2 +-
tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 22 +-
tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.4.0-1.replies | 95 +-
tests/qemucapabilitiesdata/caps_2.5.0-1.caps | 168 +
tests/qemucapabilitiesdata/caps_2.5.0-1.replies | 4043 ++++++++++++++++++++
tests/qemucapabilitiestest.c | 1 +
.../qemuxml2argv-video-virtio-gpu-device.args | 23 +
.../qemuxml2argv-video-virtio-gpu-device.xml | 31 +
.../qemuxml2argv-video-virtio-gpu-spice-gl.args | 23 +
.../qemuxml2argv-video-virtio-gpu-spice-gl.xml | 36 +
.../qemuxml2argv-video-virtio-gpu-virgl.args | 23 +
.../qemuxml2argv-video-virtio-gpu-virgl.xml | 33 +
tests/qemuxml2argvtest.c | 14 +
tests/qemuxml2xmltest.c | 4 +
29 files changed, 4732 insertions(+), 99 deletions(-)
create mode 100644 tests/qemucapabilitiesdata/caps_2.5.0-1.caps
create mode 100644 tests/qemucapabilitiesdata/caps_2.5.0-1.replies
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-device.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-spice-gl.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-virtio-gpu-virgl.xml
--
2.5.0
8 years, 9 months
[libvirt] [PATCHv3 0/2] notify about reverting to a snapshot
by Dmitry Andreev
Reverting to snapshot may change domain configuration but
there will be no events about that.
Lack of the event become a problem for virt-manager
https://bugzilla.redhat.com/show_bug.cgi?id=1081148
This patch-set introduces new event and emits it in
qemuDomainRevertToSnapshot.
v3:
[2/2] event is emited only in the case when stopped domain
is reverted to a stopped domain.
Dmitry Andreev (2):
Introduce new VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT sub-event
qemu: emit 'defined' event after reverted to snapshot without state
changes
examples/object-events/event-test.c | 2 ++
include/libvirt/libvirt-domain.h | 1 +
src/qemu/qemu_driver.c | 8 +++++++-
tools/virsh-domain.c | 3 ++-
4 files changed, 12 insertions(+), 2 deletions(-)
--
1.8.3.1
8 years, 9 months
[libvirt] [PATCH] libvirt-guests: emit most messages to stderr
by Michael Chapman
Some of the shell functions in this script (e.g. check_guests_shutdown)
produce output that is captured and processed by other parts of the
script. Any error messages from these shell functions must go to stderr,
not stdout.
Rather than trying to determine which messages are safe for stdout and
which are not (and maintaining this safety as the script is refactored),
simplify things by emitting all messages to stderr, except for the
output from gueststatus(), rh_status() and usage().
Signed-off-by: Michael Chapman <mike(a)very.puzzling.org>
---
tools/libvirt-guests.sh.in | 94 +++++++++++++++++++++++-----------------------
1 file changed, 47 insertions(+), 47 deletions(-)
diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
index 7f74b85..80b1ec7 100644
--- a/tools/libvirt-guests.sh.in
+++ b/tools/libvirt-guests.sh.in
@@ -92,16 +92,16 @@ test_connect()
i=${CONNECT_RETRIES}
while [ $i -gt 0 ]; do
- run_virsh "$uri" connect 2>/dev/null
+ run_virsh "$uri" connect >/dev/null 2>/dev/null
if [ $? -eq 0 ]; then
return 0;
fi
sleep ${RETRIES_SLEEP}
- eval_gettext "Unable to connect to libvirt currently. Retrying .. \$i"
+ eval_gettext "Unable to connect to libvirt currently. Retrying .. \$i" >&2
i=$(($i-1))
done
- eval_gettext "Can't connect to \$uri. Skipping."
- echo
+ eval_gettext "Can't connect to \$uri. Skipping." >&2
+ echo >&2
return 1
}
@@ -163,8 +163,8 @@ start() {
[ -f "$LISTFILE" ] || { started; return 0; }
if [ "x$ON_BOOT" != xstart ]; then
- gettext "libvirt-guests is configured not to start any guests on boot"
- echo
+ gettext "libvirt-guests is configured not to start any guests on boot" >&2
+ echo >&2
rm -f "$LISTFILE"
started
return 0
@@ -187,19 +187,19 @@ start() {
done
set +f
if ! "$configured"; then
- eval_gettext "Ignoring guests on \$uri URI"; echo
+ eval_gettext "Ignoring guests on \$uri URI" >&2; echo >&2
continue
fi
test_connect "$uri" || continue
- eval_gettext "Resuming guests on \$uri URI..."; echo
+ eval_gettext "Resuming guests on \$uri URI..." >&2; echo >&2
for guest in $list; do
name=$(guest_name "$uri" "$guest")
- eval_gettext "Resuming guest \$name: "
+ eval_gettext "Resuming guest \$name: " >&2
if guest_is_on "$uri" "$guest"; then
if "$guest_running"; then
- gettext "already active"; echo
+ gettext "already active" >&2; echo >&2
else
if "$isfirst"; then
isfirst=false
@@ -208,7 +208,7 @@ start() {
fi
retval run_virsh "$uri" start $bypass "$name" \
>/dev/null && \
- gettext "done"; echo
+ gettext "done" >&2; echo >&2
if "$sync_time"; then
run_virsh "$uri" domtime --sync "$name" >/dev/null
fi
@@ -234,7 +234,7 @@ suspend_guest()
bypass=
slept=0
test "x$BYPASS_CACHE" = x0 || bypass=--bypass-cache
- printf '%s...\n' "$label"
+ printf '%s...\n' "$label" >&2
run_virsh "$uri" managedsave $bypass "$guest" >/dev/null &
virsh_pid=$!
while true; do
@@ -246,9 +246,9 @@ suspend_guest()
progress=$(run_virsh_c "$uri" domjobinfo "$guest" 2>/dev/null | \
awk '/^Data processed:/{print $3, $4}')
if [ -n "$progress" ]; then
- printf '%s%s\n' "$label" "$progress"
+ printf '%s%s\n' "$label" "$progress" >&2
else
- printf '%s%s\n' "$label" "..."
+ printf '%s%s\n' "$label" "..." >&2
fi
fi
done
@@ -264,8 +264,8 @@ shutdown_guest()
guest=$2
name=$(guest_name "$uri" "$guest")
- eval_gettext "Starting shutdown on guest: \$name"
- echo
+ eval_gettext "Starting shutdown on guest: \$name" >&2
+ echo >&2
retval run_virsh "$uri" shutdown "$guest" >/dev/null || return
timeout=$SHUTDOWN_TIMEOUT
check_timeout=false
@@ -283,24 +283,24 @@ shutdown_guest()
if $check_timeout; then
if [ $(($timeout % 5)) -eq 0 ]; then
- printf "$format" "$name" "$timeout"
+ printf "$format" "$name" "$timeout" >&2
fi
timeout=$(($timeout - 1))
else
slept=$(($slept + 1))
if [ $(($slept % 5)) -eq 0 ]; then
- printf "$format" "$name"
+ printf "$format" "$name" >&2
fi
fi
done
if guest_is_on "$uri" "$guest"; then
if "$guest_running"; then
- eval_gettext "Shutdown of guest \$name failed to complete in time."
+ eval_gettext "Shutdown of guest \$name failed to complete in time." >&2
else
- eval_gettext "Shutdown of guest \$name complete."
+ eval_gettext "Shutdown of guest \$name complete." >&2
fi
- echo
+ echo >&2
fi
}
@@ -313,8 +313,8 @@ shutdown_guest_async()
guest=$2
name=$(guest_name "$uri" "$guest")
- eval_gettext "Starting shutdown on guest: \$name"
- echo
+ eval_gettext "Starting shutdown on guest: \$name" >&2
+ echo >&2
retval run_virsh "$uri" shutdown "$guest" > /dev/null
}
@@ -337,8 +337,8 @@ check_guests_shutdown()
guests_up=
for guest in $guests; do
if ! guest_is_on "$uri" "$guest" >/dev/null 2>&1; then
- eval_gettext "Failed to determine state of guest: \$guest. Not tracking it anymore."
- echo
+ eval_gettext "Failed to determine state of guest: \$guest. Not tracking it anymore." >&2
+ echo >&2
continue
fi
if "$guest_running"; then
@@ -363,8 +363,8 @@ print_guests_shutdown()
esac
name=$(guest_name "$uri" "$guest")
- eval_gettext "Shutdown of guest \$name complete."
- echo
+ eval_gettext "Shutdown of guest \$name complete." >&2
+ echo >&2
done
}
@@ -404,18 +404,18 @@ shutdown_guests_parallel()
if $check_timeout; then
if [ $(($timeout % 5)) -eq 0 ]; then
- printf "$format" $(($guestcount + $shutdowncount)) "$timeout"
+ printf "$format" $(($guestcount + $shutdowncount)) "$timeout" >&2
fi
timeout=$(($timeout - 1))
if [ $timeout -le 0 ]; then
- eval_gettext "Timeout expired while shutting down domains"; echo
+ eval_gettext "Timeout expired while shutting down domains" >&2; echo >&2
RETVAL=1
return
fi
else
slept=$(($slept + 1))
if [ $(($slept % 5)) -eq 0 ]; then
- printf "$format" $(($guestcount + $shutdowncount))
+ printf "$format" $(($guestcount + $shutdowncount)) >&2
fi
fi
@@ -435,8 +435,8 @@ stop() {
if [ "x$ON_SHUTDOWN" = xshutdown ]; then
suspending=false
if [ $SHUTDOWN_TIMEOUT -lt 0 ]; then
- gettext "SHUTDOWN_TIMEOUT must be equal or greater than 0"
- echo
+ gettext "SHUTDOWN_TIMEOUT must be equal or greater than 0" >&2
+ echo >&2
RETVAL=6
return
fi
@@ -449,21 +449,21 @@ stop() {
test_connect "$uri" || continue
- eval_gettext "Running guests on \$uri URI: "
+ eval_gettext "Running guests on \$uri URI: " >&2
list=$(list_guests "$uri")
if [ $? -eq 0 ]; then
empty=true
for uuid in $list; do
- "$empty" || printf ", "
- printf %s "$(guest_name "$uri" "$uuid")"
+ "$empty" || printf ", " >&2
+ printf %s "$(guest_name "$uri" "$uuid")" >&2
empty=false
done
if "$empty"; then
- gettext "no running guests."
+ gettext "no running guests." >&2
fi
- echo
+ echo >&2
fi
if "$suspending"; then
@@ -472,26 +472,26 @@ stop() {
empty=true
for uuid in $transient; do
if "$empty"; then
- eval_gettext "Not suspending transient guests on URI: \$uri: "
+ eval_gettext "Not suspending transient guests on URI: \$uri: " >&2
empty=false
else
- printf ", "
+ printf ", " >&2
fi
- printf %s "$(guest_name "$uri" "$uuid")"
+ printf %s "$(guest_name "$uri" "$uuid")" >&2
done
- echo
+ echo >&2
# reload domain list to contain only persistent guests
list=$(list_guests "$uri" "--persistent")
if [ $? -ne 0 ]; then
- eval_gettext "Failed to list persistent guests on \$uri"
- echo
+ eval_gettext "Failed to list persistent guests on \$uri" >&2
+ echo >&2
RETVAL=1
set +f
return
fi
else
- gettext "Failed to list transient guests"
- echo
+ gettext "Failed to list transient guests" >&2
+ echo >&2
RETVAL=1
set +f
return
@@ -507,9 +507,9 @@ stop() {
if [ -s "$LISTFILE" ]; then
while read uri list; do
if "$suspending"; then
- eval_gettext "Suspending guests on \$uri URI..."; echo
+ eval_gettext "Suspending guests on \$uri URI..." >&2; echo >&2
else
- eval_gettext "Shutting down guests on \$uri URI..."; echo
+ eval_gettext "Shutting down guests on \$uri URI..." >&2; echo >&2
fi
if [ "$PARALLEL_SHUTDOWN" -gt 1 ] &&
--
2.4.3
8 years, 9 months
[libvirt] ARM KVM GICv3 Support
by Christoffer Dall
Hi all,
I'm trying to figure out what the correct solution for libvirt support
for ARM KVM guests with GICv3 is.
The challenge is that QEMU's virt machine model defaults to GICv2 unless
you specify an additional "-machine gic-version=host" parameter to QEMU,
in which case your VM gets the same GIC version as your host.
Now, I'm told that this is inconvenient for libvirt, because it
typically does not pass any -machine options, is that correct?
Further, there are two additional complications: First, some guest
images may not include GICv3 support. For Linux, this is relatively old
kernels (prior to v3.17), but other guests may only support GICv2.
Second, some hardware platforms only support GICv2 guests, some only
support GICv3 guests, and some support both GICv2 and GICv3 guests
(those hosts with a GICv3 with the backwards compatibility support).
It is unclear to me how libvirt users will relate to these constraints.
For example, in an OpenStack deployment, will it somehow be easy to tell
which nodes support which GIC version such that administrators can
choose compatible VM images, or how does that work?
The end goal here is to determine if we need to add any functionality to
QEMU to better support libvirt, and what kind of features/glue need to
be added to libvirt for this to work.
Much thanks for any feedback!
-Christoffer
8 years, 9 months
[libvirt] Found mem leak in livirt, need help to debug
by Piotr Rybicki
Hi.
There is a mem leak in libvirt, when doing external snapshot (for backup
purposes). My KVM domain uses raw storage images via libgfapi. I'm using
latest 1.2.21 libvirt (although previous versions act the same).
My bash script for snapshot backup uses series of shell commands (virsh
connect to a remote libvirt host):
* virsh domblklist KVM
* qemu-img create -f qcow2 -o backing_file=gluster(...) - precreate
backing file
* virsh snapshot-create KVM SNAP.xml (...) - create snapshot from
precreated XML snapshot file
* cp main img file
* virsh blockcommit KVM disk (...)
Backup script works fine, however libvirtd process gets bigger and
bigger each time I run this script.
Some proof of memleak:
32017 - libvirtd pid
When libvirt started:
# ps p 32017 o vsz,rss
VSZ RSS
585736 15220
When I start KVM via virsh start KVM
# ps p 32017 o vsz,rss
VSZ RSS
1327968 125956
When i start backup script, after snapshot is created (lots of mem
allocated)
# ps p 32017 o vsz,rss
VSZ RSS
3264544 537632
After backup script finished
# ps p 32017 o vsz,rss
VSZ RSS
3715920 644940
When i start backup script for a second time, after snapshot is created
# ps p 32017 o vsz,rss
VSZ RSS
5521424 1056352
And so on, until libvirt spills 'Out of memory' when connecting, ane
being really huge process.
Now, I would like to diagnose it further, to provide detailed
information about memleak. I tried to use valgrind, but unfortunatelly
I'm on Opteron 6380 platform, and valgrind doesn't support XOP quitting
witch SIGILL.
If someone could provide me with detailed information on how to get some
usefull debug info about this memleak, i'll be more than happy to do it,
and share results here.
Thanks in advance and best regards
Piotr Rybicki
8 years, 9 months
[libvirt] oVirt considers using macTableManager='libvirt'
by Ido Barkan
Hi guys,
We, at oVirt, are considring using the automatic bridge management
feature of libvirt for our hosts
(macTableManager='libvirt').
I could find any discussion in the mailing list archives about the
motivation for this feature.
(was there?). If there wasn't I would like to start a new one, about
the possible trade offs it would
have in oVirt.
Specifically I have a few questions:
1) The obvious performance motivation is clear: considering N hosts
with M vms each connected to
the same LAN, the first packet to any unknown yet host will flood
all the vms in all N bridges.
-- was there any other motivation that I do not understand
(apart from slightly better security?
2) oVirt uses TC for port mirroring, in case this is requested by
users, to mirror traffic from a chosen
bridge to a chosen NIC in the host. I could not understand if
macTableManager will interfere
with it, or not.
3) Are there any drawbacks to enabling this feature?
4) We aim for rhel7.2. Will the feature be supported (or partially
supported) for kernels older then
3.17? And if so, in what way?
5) oVirt currently builds its own bridges and tell libvirt about them.
Does that have any affect on the
functionality of that feature?
6) are there any plans to support OVS for this feature in the future?
--
Thanks,
Ido Barkan
8 years, 9 months
[libvirt] [PATCH 0/8] Add perf and Intel CMT feature support
by Qiaowei Ren
The series mainly adds Intel CMT feature support into libvirt. CMT is
new introduced PQos (Platform Qos) feature to monitor the usage of
cache by applications running on the platform.
Currently CMT patches has been merged into Linux kernel mainline.
The CMT implementation in Linux kernel is based on perf mechanism and
there is no support for perf in libvirt, and so this series firstly
add perf support into libvirt, including two public API and a set of
util interfaces. And based on these APIs and interfaces, thie series
implements CMT perf event support.
TODO:
1. add support for new APIs into libvirt-python library.
Changes since v1:
* change perf APIs implementation to match new style of the API.
* add new xml element
* reenable all perf events previously enabled when libvirtd daemon
restart.
* redesign perf util functions.
Changes since v2:
* add an example XML file to the test suite.
* add virPerfReadEvent().
* change 'perf' xml element to new style.
* change 'perf' command to new stype.
Qiaowei Ren (8):
perf: add new public APIs for perf event
perf: implement the remote protocol for perf event
perf: implement a set of util functions for perf event
qemu_driver: add support to perf event
perf: add new xml element
perf: reenable perf events when libvirtd restart
virsh: implement new command to support perf
virsh: extend domstats command
daemon/remote.c | 47 ++++
docs/schemas/domaincommon.rng | 27 +++
include/libvirt/libvirt-domain.h | 19 ++
include/libvirt/virterror.h | 1 +
src/Makefile.am | 1 +
src/conf/domain_conf.c | 111 ++++++++++
src/conf/domain_conf.h | 10 +
src/driver-hypervisor.h | 12 +
src/libvirt-domain.c | 93 ++++++++
src/libvirt_private.syms | 12 +
src/libvirt_public.syms | 6 +
src/qemu/qemu_domain.h | 3 +
src/qemu/qemu_driver.c | 195 +++++++++++++++++
src/qemu/qemu_process.c | 10 +
src/remote/remote_driver.c | 39 ++++
src/remote/remote_protocol.x | 30 ++-
src/remote_protocol-structs | 18 ++
src/util/virerror.c | 1 +
src/util/virperf.c | 303 ++++++++++++++++++++++++++
src/util/virperf.h | 63 ++++++
tests/domainschemadata/domain-perf-simple.xml | 20 ++
tools/virsh-domain-monitor.c | 7 +
tools/virsh-domain.c | 128 +++++++++++
tools/virsh.pod | 27 ++-
24 files changed, 1180 insertions(+), 3 deletions(-)
create mode 100644 src/util/virperf.c
create mode 100644 src/util/virperf.h
create mode 100644 tests/domainschemadata/domain-perf-simple.xml
--
1.9.1
8 years, 9 months