[libvirt] [PATCH] qemu: Fix debug message in qemuProcessHandleResume
by Jiri Denemark
The message talks about "resumed" state, which is a bit confusing. While
we have a "resumed" event, the corresponding state is called "running".
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 59ca7cd333..4e93b2d741 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -721,7 +721,7 @@ qemuProcessHandleResume(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) {
eventDetail = qemuDomainRunningReasonToResumeEvent(reason);
- VIR_DEBUG("Transitioned guest %s out of paused into resumed state, "
+ VIR_DEBUG("Transitioned guest %s out of paused into running state, "
"reason '%s', event detail %d",
vm->def->name, virDomainRunningReasonTypeToString(reason),
eventDetail);
--
2.19.1
6 years, 5 months
[libvirt] [PATCH v2 0/3] qemu: Restore lost shutdown reason
by John Ferlan
v1:
https://www.redhat.com/archives/libvir-list/2018-October/msg00945.html
Changes since v1:
Patch 1 (NEW)
- Set the priv->allowReboot prior to any error processing since we
could/should be using that.
Patch 2 (ADJUSTED LOGIC)
- Rather than open code the "reason" to use the -no-shutdown flag,
let's create a qemu_domain helper for that so that both the command
line building and the Reconnection failure logic can use it.
Patch 3 (NEW)
- Let's narrow the window for using VIR_DOMAIN_SHUTOFF_CRASHED to
just the period where we try to open a monitor channel. If we
cannot do so, then "assume" the reason was crashed. There are
a few open failure steps that may not exactly fit the model, but
those are probably splitting hairs.
John Ferlan (3):
qemu: Move allow reboot check setting
qemu: Restore lost shutdown reason
qemu: Narrow the shutdown reconnection failure reason window
src/qemu/qemu_command.c | 6 +-----
src/qemu/qemu_domain.c | 17 +++++++++++++++++
src/qemu/qemu_domain.h | 3 +++
src/qemu/qemu_process.c | 27 ++++++++++++++++++---------
4 files changed, 39 insertions(+), 14 deletions(-)
--
2.17.2
6 years, 5 months
[libvirt] [jenkins-ci PATCH 0/4] Add Fedora 29, drop Fedora 27
by Andrea Bolognani
It's that time of the year again :)
Andrea Bolognani (4):
guests: Add Fedora 29
Build on Fedora 29
Stop building on Fedora 27
guests: Drop Fedora 27
guests/host_vars/libvirt-fedora-27/docker.yml | 2 -
guests/host_vars/libvirt-fedora-29/docker.yml | 2 +
.../install.yml | 2 +-
.../main.yml | 2 +-
guests/inventory | 2 +-
guests/playbooks/build/jobs/defaults.yml | 4 +-
.../playbooks/build/projects/libvirt-dbus.yml | 6 +-
.../build/projects/libvirt-ocaml.yml | 2 +-
.../build/projects/libvirt-sandbox.yml | 4 +-
.../playbooks/build/projects/libvirt-tck.yml | 4 +-
guests/playbooks/build/projects/libvirt.yml | 2 +-
.../playbooks/build/projects/virt-manager.yml | 6 +-
.../playbooks/build/projects/virt-viewer.yml | 1 +
guests/vars/mappings.yml | 1 -
guests/vars/vault.yml | 82 +++++++++----------
jobs/defaults.yaml | 4 +-
projects/libvirt-dbus.yaml | 6 +-
projects/libvirt-ocaml.yaml | 2 +-
projects/libvirt-sandbox.yaml | 4 +-
projects/libvirt-tck.yaml | 4 +-
projects/libvirt.yaml | 2 +-
projects/virt-manager.yaml | 6 +-
projects/virt-viewer.yaml | 1 +
23 files changed, 76 insertions(+), 75 deletions(-)
delete mode 100644 guests/host_vars/libvirt-fedora-27/docker.yml
create mode 100644 guests/host_vars/libvirt-fedora-29/docker.yml
rename guests/host_vars/{libvirt-fedora-27 => libvirt-fedora-29}/install.yml (66%)
rename guests/host_vars/{libvirt-fedora-27 => libvirt-fedora-29}/main.yml (95%)
--
2.19.1
6 years, 5 months
[libvirt] [PATCH] libxl: Properly dispose libxl_domain_config object
by Jim Fehlig
V2 of the libxl soft reset patch, which was pushed as commit da4b0fd9,
dropped the hunk that disposed of the libxl_domain_config object. Add
the missing hunk to properly dispose the object.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
Pushing as trivial...
src/libxl/libxl_domain.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 6aca7eebf8..5fe3f44fbe 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -605,6 +605,7 @@ libxlDomainShutdownThread(void *opaque)
virObjectEventStateQueue(driver->domainEventState, dom_event);
libxl_event_free(cfg->ctx, ev);
VIR_FREE(shutdown_info);
+ libxl_domain_config_dispose(&d_config);
virObjectUnref(cfg);
}
--
2.18.0
6 years, 5 months
[libvirt] [PATCH v2] lxc: Include support to lxc version 3.0 or higher.
by Julio Faracco
This patch introduce the new settings for LXC 3.0 or higher. The older
versions keep the compatibility to deprecated settings for LXC, but
after release 3.0, the compatibility was removed. This commit adds the
support to the refactored settings.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
src/lxc/lxc_native.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index cbdec723dd..8604cbaf46 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -200,7 +200,9 @@ lxcSetRootfs(virDomainDefPtr def,
int type = VIR_DOMAIN_FS_TYPE_MOUNT;
VIR_AUTOFREE(char *) value = NULL;
- if (virConfGetValueString(properties, "lxc.rootfs", &value) <= 0)
+ if (virConfGetValueString(properties, "lxc.rootfs", &value) <= 0 &&
+ /* Legacy config keys were removed after release 3.0. */
+ virConfGetValueString(properties, "lxc.rootfs.path", &value) <= 0)
return -1;
if (STRPREFIX(value, "/dev/"))
@@ -684,7 +686,9 @@ lxcCreateConsoles(virDomainDefPtr def, virConfPtr properties)
virDomainChrDefPtr console;
size_t i;
- if (virConfGetValueString(properties, "lxc.tty", &value) <= 0)
+ if (virConfGetValueString(properties, "lxc.tty", &value) <= 0 &&
+ /* Legacy config keys were removed after release 3.0. */
+ virConfGetValueString(properties, "lxc.tty.max", &value) <= 0)
return 0;
if (virStrToLong_i(value, NULL, 10, &nbttys) < 0) {
@@ -724,7 +728,7 @@ lxcIdmapWalkCallback(const char *name, virConfValuePtr value, void *data)
char type;
unsigned long start, target, count;
- if (STRNEQ(name, "lxc.id_map") || !value->str)
+ if (STRNEQ(name, "lxc.id_map") || STRNEQ(name, "lxc.idmap") || !value->str)
return 0;
if (sscanf(value->str, "%c %lu %lu %lu", &type,
@@ -1041,7 +1045,9 @@ lxcParseConfigString(const char *config,
if (VIR_STRDUP(vmdef->os.init, "/sbin/init") < 0)
goto error;
- if (virConfGetValueString(properties, "lxc.utsname", &value) <= 0 ||
+ if ((virConfGetValueString(properties, "lxc.utsname", &value) <= 0 &&
+ /* Legacy config keys were removed after release 3.0. */
+ virConfGetValueString(properties, "lxc.uts.name", &value) <= 0) ||
VIR_STRDUP(vmdef->name, value) < 0)
goto error;
if (!vmdef->name && (VIR_STRDUP(vmdef->name, "unnamed") < 0))
@@ -1051,7 +1057,9 @@ lxcParseConfigString(const char *config,
goto error;
/* Look for fstab: we shouldn't have it */
- if (virConfGetValue(properties, "lxc.mount")) {
+ if (virConfGetValue(properties, "lxc.mount") ||
+ /* Legacy config keys were removed after release 3.0. */
+ virConfGetValue(properties, "lxc.mount.fstab")) {
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("lxc.mount found, use lxc.mount.entry lines instead"));
goto error;
--
2.17.1
6 years, 5 months
[libvirt] [PATCH V2 0/3] libxl: add support for soft reset
by Jim Fehlig
Patches 1 and 2 are new to V2 and make slight improvements to
libxlDomainShutdownThread. Patch 3 is adjusted to work with Xen 4.6.
Jim Fehlig (3):
libxl: remove redundant calls to virObjectEventStateQueue
libxl: Remove some goto labels in libxlDomainShutdownThread
libxl: add support for soft reset
src/libxl/libxl_domain.c | 99 ++++++++++++++++++++++++++++------------
1 file changed, 69 insertions(+), 30 deletions(-)
--
2.18.0
6 years, 5 months
[libvirt] RFC: VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA is not functional?
by Han Han
Hello,
I found snapshot APIs(like virDomainSnapshotNum) invoked with
VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA will return 0 even there are internal
no-metadata snapshots in the domain.
Then I find the reason is in virDomainSnapshotObjListGetNames():
937 /* If this common code is being used, we assume that all
snapshots
938 ┆* have metadata, and thus can handle METADATA up front as
an
939 ┆* all-or-none filter. XXX This might not always be true, if
we
940 ┆* add the ability to track qcow2 internal snapshots without
the
941 ┆* use of metadata.
*/
942 if ((data.flags & VIR_DOMAIN_SNAPSHOT_FILTERS_METADATA)
==
943 ┆
VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA)
944 ┆ return 0;
So currently, with VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA, no snapshot will
be returned.
I checked the commit. It is really old(6478ec1673a Eric Blake
2012-08-13 18:09:12 -0600) . I guess it was initially designed for the
function to list internal snapshots without metadata.
However, now internal snapshot seems lower prioritized than external
snapshot.
Do we have plan to design this function? Since the APIs invoked with this
flag don't return the **right** result, if the function for
VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA will not be designed, how will we deal
with the flag? Remove it from code OR update the docs to mark it
unsupported?
--
Best regards,
-----------------------------------
Han Han
Quality Engineer
Redhat.
Email: hhan(a)redhat.com
Phone: +861065339333
6 years, 5 months
[libvirt] [PATCH v2] snapshot: Don't hose list on deletion failure
by Eric Blake
If qemuDomainSnapshotDiscard() fails for any reason (rare,
but possible with an ill-timed ENOMEM or if
qemuDomainSnapshotForEachQcow2() has problems talking to the
qemu guest monitor), then an attempt to retry the snapshot
deletion API will crash because we didn't undo the effects
of virDomainSnapshotDropParent() temporarily rearranging the
internal list structures, and the second attempt to drop
parents will dereference NULL. Fix it by instead noting that
there are only two callers to qemuDomainSnapshotDiscard(),
and only one of the two callers wants the parent to be updated;
thus we can move the call to virDomainSnapshotDropParent()
into a code path that only gets executed on success.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
v2: avoid use-after-free
---
src/qemu/qemu_domain.c | 6 ++++--
src/qemu/qemu_driver.c | 1 -
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index f00f1b3fdb..dd67be5e2a 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -8246,7 +8246,7 @@ int
qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainSnapshotObjPtr snap,
- bool update_current,
+ bool update_parent,
bool metadata_only)
{
char *snapFile = NULL;
@@ -8275,7 +8275,7 @@ qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
goto cleanup;
if (snap == vm->current_snapshot) {
- if (update_current && snap->def->parent) {
+ if (update_parent && snap->def->parent) {
parentsnap = virDomainSnapshotFindByName(vm->snapshots,
snap->def->parent);
if (!parentsnap) {
@@ -8298,6 +8298,8 @@ qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
if (unlink(snapFile) < 0)
VIR_WARN("Failed to unlink %s", snapFile);
+ if (update_parent)
+ virDomainSnapshotDropParent(snap);
virDomainSnapshotObjListRemove(vm->snapshots, snap);
ret = 0;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a52e2495d5..9f71641dfa 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16526,7 +16526,6 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
snap->first_child = NULL;
ret = 0;
} else {
- virDomainSnapshotDropParent(snap);
ret = qemuDomainSnapshotDiscard(driver, vm, snap, true, metadata_only);
}
--
2.17.2
6 years, 5 months
[libvirt] [PATCH v7 00/14] PCI passthrough support on s390
by Yi Min Zhao
Abstract
========
The PCI representation in QEMU has been extended for S390
allowing configuration of zPCI attributes like uid (user-defined
identifier) and fid (PCI function identifier).
The details can be found here:
https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg07262.html
To support the new zPCI feature of the S390 platform, a new element of
PCI address is introduced. It has two optional attributes, @uid and
@fid. For example:
<hostdev mode='subsystem' type='pci'>
<driver name='vfio'/>
<source>
<address domain='0x0001' bus='0x00' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'>
<zpci uid='0x0003' fid='0x00000027'/>
</address>
</hostdev>
If they are defined by the user, unique values within the guest domain
must be used. If they are not specified and the architecture requires
them, they are automatically generated with non-conflicting values.
zPCI address as an extension of the PCI address are stored in a new
structure 'virZPCIDeviceAddress' which is a member of common PCI
Address structure. Additionally, two hashtables are used for assignment
and reservation of zPCI uid/fid.
In support of extending the PCI address, a new PCI address extension flag is
introduced. This extension flag allows is not only dedicated for the S390
platform but also other architectures needing certain extensions to PCI
address space.
Code Base
=========
commit in master:
3a1cdb06fd conf: Fix bug in finding alloc through matching vcpus
Change Log
==========
v6->v7:
1. Optimize some functions' names and code logic.
2. Fixup build error.
3. Add negative test case for patch 9.
4. Use virXMLFormatElement() in virDomainDeviceInfoFormat().
v5->v6:
1. Modify zPCI XML definition.
2. Optimize the logic of zPCI address assignment and reservation.
3. Add extension flag into PCI address structure.
4. Update commit messages.
v4->v5:
1. Update the version number.
2. Fixup code style error.
3. Separate qemu code into single patch.
4. Rebase the patches to the new code of master branch.
v3->v4:
1. Update docs.
2. Format code style.
3. Optimize zPCI support check.
4. Move the check of zPCI defined in xml but unsupported by Qemu to
qemuDomainDeviceDefValidate().
5. Change zpci address member of PCI address struct from pointer to
instance.
6. Modify zpci address definition principle. Currently the user must
either define both of uid and fid or not.
v2->v3:
1. Revise code style.
2. Update test cases.
3. Introduce qemuDomainCollectPCIAddressExtension() to collect PCI
extension addresses.
4. Introduce virDeviceInfoPCIAddressExtensionPresent() to check if zPCI
address exists.
5. Optimize zPCI address check logic.
6. Optimize passed parameters of zPCI addr alloc/release/reserve functions.
7. Report enum range error in qemuDomainDeviceSupportZPCI().
8. Update commit messages.
v1->v2:
1. Separate test commit and merge testcases into corresponding commits that
introduce the functionalities firstly.
2. Spare some checks for zpci device.
3. Add vsock and controller support.
4. Add uin32 type schema.
5. Rename zpciuid and zpcifid to zpci_uid and zpci_fid.
6. Always return multibus support on S390.
Yi Min Zhao (14):
conf: Add definitions for 'uid' and 'fid' PCI address attributes
qemu: Introduce zPCI capability
conf: Introduce a new PCI address extension flag
qemu: Enable PCI multi bus for S390 guests
qemu: Auto add pci-root for s390/s390x guests
conf: Introduce address caching for PCI extensions
conf: use virXMLFormatElement() in virDomainDeviceInfoFormat()
conf: Introduce parser, formatter for uid and fid
qemu: Add zPCI address definition check
conf: Allocate/release 'uid' and 'fid' in PCI address
qemu: Generate and use zPCI device in QEMU command line
qemu: Add hotpluging support for PCI devices on S390 guests
docs: Add 'uid' and 'fid' information
news: Update news for PCI address extension attributes
cfg.mk | 1 +
docs/formatdomain.html.in | 10 +-
docs/news.xml | 11 +
docs/schemas/basictypes.rng | 27 ++
docs/schemas/domaincommon.rng | 1 +
src/bhyve/bhyve_device.c | 3 +-
src/conf/device_conf.c | 69 ++++
src/conf/device_conf.h | 7 +
src/conf/domain_addr.c | 340 +++++++++++++++++-
src/conf/domain_addr.h | 27 +-
src/conf/domain_conf.c | 50 ++-
src/libvirt_private.syms | 7 +
src/qemu/qemu_capabilities.c | 6 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 104 ++++++
src/qemu/qemu_command.h | 2 +
src/qemu/qemu_domain.c | 37 ++
src/qemu/qemu_domain_address.c | 205 ++++++++++-
src/qemu/qemu_hotplug.c | 160 ++++++++-
src/util/virpci.c | 26 ++
src/util/virpci.h | 15 +
.../caps_2.10.0.s390x.xml | 1 +
.../caps_2.11.0.s390x.xml | 1 +
.../caps_2.12.0.s390x.xml | 1 +
.../qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 +
.../qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 +
.../qemucapabilitiesdata/caps_2.9.0.s390x.xml | 1 +
.../qemucapabilitiesdata/caps_3.0.0.s390x.xml | 1 +
.../disk-virtio-s390-zpci.args | 26 ++
.../disk-virtio-s390-zpci.xml | 19 +
.../hostdev-vfio-zpci-autogenerate.args | 25 ++
.../hostdev-vfio-zpci-autogenerate.xml | 18 +
.../hostdev-vfio-zpci-boundaries.args | 29 ++
.../hostdev-vfio-zpci-boundaries.xml | 30 ++
.../hostdev-vfio-zpci-multidomain-many.args | 39 ++
.../hostdev-vfio-zpci-multidomain-many.xml | 79 ++++
.../hostdev-vfio-zpci-wrong-arch.xml | 34 ++
tests/qemuxml2argvdata/hostdev-vfio-zpci.args | 25 ++
tests/qemuxml2argvdata/hostdev-vfio-zpci.xml | 21 ++
tests/qemuxml2argvtest.c | 22 ++
.../disk-virtio-s390-zpci.xml | 31 ++
.../hostdev-vfio-zpci-autogenerate.xml | 34 ++
.../hostdev-vfio-zpci-boundaries.xml | 48 +++
.../hostdev-vfio-zpci-multidomain-many.xml | 97 +++++
.../qemuxml2xmloutdata/hostdev-vfio-zpci.xml | 32 ++
tests/qemuxml2xmltest.c | 17 +
46 files changed, 1707 insertions(+), 35 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-virtio-s390-zpci.args
create mode 100644 tests/qemuxml2argvdata/disk-virtio-s390-zpci.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.args
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-wrong-arch.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci.args
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-virtio-s390-zpci.xml
create mode 100644 tests/qemuxml2xmloutdata/hostdev-vfio-zpci-autogenerate.xml
create mode 100644 tests/qemuxml2xmloutdata/hostdev-vfio-zpci-boundaries.xml
create mode 100644 tests/qemuxml2xmloutdata/hostdev-vfio-zpci-multidomain-many.xml
create mode 100644 tests/qemuxml2xmloutdata/hostdev-vfio-zpci.xml
--
Yi Min
6 years, 5 months