[libvirt] [libvirt PATCH v3 0/4] Share cgroup code that is duplicated between QEMU and LXC
by Fabiano Fidêncio
virLXCCgroupSetupBlkioTune() and qemuSetupBlkioCgroup() and
virLXCCgroupSetupCpuTune() and qemuSetupCpuCgroup() are the most similar
functions between QEMU and LXC code.
Let's move their common code to virCgroup.
Mind that the first two patches are basically preparing the ground for
the changes introduced in the last two patches.
I know that Pavel Hrdina suggested taking a different path[0] for this
series but I do believe Michal's and Jano's points are valid, thus I've
decided to just do the changes suggested by Michal (at least for now).
[0]: https://www.redhat.com/archives/libvir-list/2018-September/msg00534.html
changes since v1:
- Michal Privoznik pointed out (as did the `make syntax-check` :-)) that
we do want to keep src/util independently of the parsing code (thus,
including "conf/domain_conf.h" in vircgroup.h is not the way to go).
This has been solved now by partially following Michal's suggestion
and splitting the structs and functions that would be use in the
common code to new different files.
changes since v2:
- Fixed `make syntax-check` errors that I've missed before (didn't have
cppi installed);
- Created a new section in src/libvirt_private.syms to correctly export
the virBlkioDeviceArrayClear symbol;
- Removed a virlkio.c from libvirt_setuid_rpc_client_la__SOURCES (why
did I add it there in the first place? ;-))
- Explicitly included virmem.h in qemu_{domain,command}.c.
Although there's nothing enforcing it, I do believe it's a good
practive that should be followed and I've checked with Andrea and
Peter about doing that and both agreed with the approach.
Fabiano Fidêncio (4):
domain_conf: split out virBlkioDevice and virDomainBlkiotune
definitions
domain_conf: split out virDomainMemtune and virDomainHugePage
definitions
vircgroup: Add virCgroupSetupBlkioTune()
vircgroup: Add virCgroupSetupMemTune()
src/conf/domain_conf.c | 22 ++++--------
src/conf/domain_conf.h | 70 +++----------------------------------
src/libvirt_private.syms | 7 +++-
src/lxc/lxc_cgroup.c | 69 ++-----------------------------------
src/qemu/qemu_cgroup.c | 61 ++-------------------------------
src/qemu/qemu_command.c | 5 +--
src/qemu/qemu_domain.c | 3 +-
src/util/Makefile.inc.am | 2 ++
src/util/virblkio.c | 37 ++++++++++++++++++++
src/util/virblkio.h | 52 ++++++++++++++++++++++++++++
src/util/vircgroup.c | 74 ++++++++++++++++++++++++++++++++++++++++
src/util/vircgroup.h | 5 +++
src/util/virmem.h | 66 +++++++++++++++++++++++++++++++++++
13 files changed, 263 insertions(+), 210 deletions(-)
create mode 100644 src/util/virblkio.c
create mode 100644 src/util/virblkio.h
create mode 100644 src/util/virmem.h
--
2.17.1
Subject: [libvirt PATCH v2 0/4] MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
6 years, 3 months
[libvirt] [PATCH libvirt-python 0/2] event-test.py fixes
by Philipp Hahn
Hello,
event-test.py is bad at handling newer livecycle events.
Attached are two patches to improve that.
Philipp Hahn (2):
event-test.py: Sync list of domain lifecycle events
event-test.py: Future proof lifecycle event handling
examples/event-test.py | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
--
2.11.0
6 years, 3 months
[libvirt] [PATCH v2 00/13] Implement vsh-table API to virsh and virt-admin
by Simon Kobyda
API is implemented in virsh and virt-admin. It fixes problems with
table-alignment, makes tables more readable and deals with unicode.
Table however could not be implemented in places, which do use simple
lists, or table implementation would change content of output,
which users might rely on.
If you know about other place where it could be implemented,
let me know.
https://bugzilla.redhat.com/show_bug.cgi?id=1574624
https://bugzilla.redhat.com/show_bug.cgi?id=1584630
Changes in v2:
- Implemented gettext function
- Fixed few possible leaks caused by inserting "goto cleanup" statements
- Implemented VIR_AUTOFREE where it's appropriate
Simon Kobyda (13):
virsh: Implement vsh-table to iface-list
virsh: Implement vshTable API to net-list and net-dhcp-leases
virsh: Implement vshTable API to secret-list
virsh: Implement vshTable API to nwfilter-list and
nwfilterbinding-list
virsh: Implement vshTable API to snapshot-list.
virsh: Set up cmdDomblkinfo() and cmdDomblkinfoPrint() for vshTable
API implementation
virsh: Implement vshTable API to domblkinfo
virsh: Implement vshTable API to domblklist
virsh: Implement vshTable API to domiflist
virsh: Implement vshTable API to vcpupin, iothreadinfo, domfsinfo
virsh: Implement vshTable API to pool-list
virsh: Implement vshTable API to vol-list
virt-admin: Implement vshTable API to server-list and client-list
tools/virsh-domain-monitor.c | 147 ++++++++++++++++---------------
tools/virsh-domain.c | 98 +++++++++++++++------
tools/virsh-interface.c | 27 ++++--
tools/virsh-network.c | 59 ++++++++-----
tools/virsh-nwfilter.c | 47 +++++++---
tools/virsh-pool.c | 162 +++++++----------------------------
tools/virsh-secret.c | 28 ++++--
tools/virsh-snapshot.c | 33 ++++---
tools/virsh-volume.c | 129 ++++++----------------------
tools/virt-admin.c | 47 +++++++---
10 files changed, 371 insertions(+), 406 deletions(-)
--
2.17.1
6 years, 3 months
[libvirt] [PATCH 0/5] qemu: Change the way we generate VIR_DOMAIN_EVENT_RESUMED
by Jiri Denemark
https://bugzilla.redhat.com/show_bug.cgi?id=1612943
Jiri Denemark (5):
qemu: Properly report VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT
qemu: Report more appropriate running reasons
qemu: Pass running reason to RESUME event handler
qemu: Map running reason to resume event detail
qemu: Avoid duplicate resume events and state changes
src/qemu/qemu_domain.c | 29 ++++++++++++++++++++++++
src/qemu/qemu_domain.h | 7 ++++++
src/qemu/qemu_driver.c | 13 -----------
src/qemu/qemu_migration.c | 36 +++++-------------------------
src/qemu/qemu_process.c | 46 ++++++++++++++++++++++++---------------
5 files changed, 71 insertions(+), 60 deletions(-)
--
2.19.0
6 years, 3 months
[libvirt] [PATCH] qemuProcess: update hostdevs before connectting qemu monitor
by Wu Zongyong
In a following case:
virsh start $domain
service libvirtd stop
<shutdown> the guest from within the $domain
service libvirtd start
Notice that PCI devices which have been assigned to the $domain will
still be bound to stub drivers instead rebound to host drivers.
In that case the call stack is like below:
libvirtd start
qemuProcessReconnect
qemuProcessStop
qemuHostdevReAttachDomainDevices
qemuHostdevReAttachPCIDevices
virHostdevReAttachPCIDevices
qemuHostdevUpdateActiveDomainDevices won't be called because the monitor
channel is closed. So host devices in $domain will not be added to either
activePCIHostdevs list or inactivePCIHostdev list. And therefore,
virHostdevReAttachPCIDevices just neglects these host PCI devices which
are bound to stub drivers and don't rebind them to host drivers.
This patch fixs that by moving qemuHostdevUpdateActiveDomainDevices before
qemuConnectMonitor.
Signed-off-by: Wu Zongyong <cordius.wu(a)huawei.com>
---
src/qemu/qemu_process.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index f9a01da..d187271 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7783,6 +7783,9 @@ qemuProcessReconnect(void *opaque)
* allowReboot in status XML and we need to initialize it. */
qemuProcessPrepareAllowReboot(obj);
+ if (qemuHostdevUpdateActiveDomainDevices(driver, obj->def) < 0)
+ goto error;
+
if (priv->qemuCaps &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS))
retry = false;
@@ -7794,9 +7797,6 @@ qemuProcessReconnect(void *opaque)
if (qemuConnectMonitor(driver, obj, QEMU_ASYNC_JOB_NONE, retry, NULL) < 0)
goto error;
- if (qemuHostdevUpdateActiveDomainDevices(driver, obj->def) < 0)
- goto error;
-
priv->machineName = qemuDomainGetMachineName(obj);
if (!priv->machineName)
goto error;
--
1.9.1
6 years, 3 months
[libvirt] [PATCH 0/2] tests: Add QEMU 3.0.0 capability tests for s390x
by Boris Fiuczynski
Add capability and domcaps tests for QEMU 3.0.0 on s390x.
Boris Fiuczynski (2):
tests: Add capabilities data for QEMU 3.0.0 on s390x
tests: domaincaps: Add QEMU 3.0 for s390x
.../domaincapsschemadata/qemu_3.0.0.s390x.xml | 183 +
tests/domaincapstest.c | 4 +
.../caps_3.0.0.s390x.replies | 20530 ++++++++++++++++
.../qemucapabilitiesdata/caps_3.0.0.s390x.xml | 2691 ++
tests/qemucapabilitiestest.c | 1 +
5 files changed, 23409 insertions(+)
create mode 100644 tests/domaincapsschemadata/qemu_3.0.0.s390x.xml
create mode 100644 tests/qemucapabilitiesdata/caps_3.0.0.s390x.replies
create mode 100644 tests/qemucapabilitiesdata/caps_3.0.0.s390x.xml
--
2.17.0
6 years, 3 months
[libvirt] [PATCH 00/13] Implement vsh-table API to virsh and virt-admin
by Simon Kobyda
API is implemented in virsh and virt-admin. It fixes problems with
table-alignment, makes tables more readable and deals with unicode.
Table however could not be implemented in places, which do use simple
lists, or table implementation would change content of output,
which users might rely on.
If you know about other place where it could be implemented,
let me know.
https://bugzilla.redhat.com/show_bug.cgi?id=1574624
https://bugzilla.redhat.com/show_bug.cgi?id=1584630
Simon Kobyda (13):
virsh: Implement vsh-table to iface-list
virsh: Implement vshTable API to net-list and net-dhcp-leases
virsh: Implement vshTable API to secret-list
virsh: Implement vshTable API to nwfilter-list and
nwfilterbinding-list
virsh: Implement vshTable API to snapshot-list.
virsh: Set up cmdDomblkinfo() and cmdDomblkinfoPrint() for vshTable
API implementation
virsh: Implement vshTable API to domblkinfo
virsh: Implement vshTable API to domblklist
virsh: Implement vshTable API to domiflist
virsh: Implement vshTable API to vcpupin, iothreadinfo, domfsinfo
virsh: Implement vshTable API to pool-list
virsh: Implement vshTable API to vol-list
virt-admin: Implement vshTable API to server-list and client-list
tools/virsh-domain-monitor.c | 131 +++++++++++++++-------------
tools/virsh-domain.c | 95 +++++++++++++++------
tools/virsh-interface.c | 27 ++++--
tools/virsh-network.c | 55 ++++++++----
tools/virsh-nwfilter.c | 47 +++++++---
tools/virsh-pool.c | 160 +++++++----------------------------
tools/virsh-secret.c | 30 +++++--
tools/virsh-snapshot.c | 33 +++++---
tools/virsh-volume.c | 127 ++++++---------------------
tools/virt-admin.c | 46 +++++++---
10 files changed, 367 insertions(+), 384 deletions(-)
--
2.17.1
6 years, 3 months
[libvirt] [PATCH 0/2] qemu: Drop QEMU_CAPS_DEVICE_SCSI_GENERIC
by Andrea Bolognani
Andrea Bolognani (2):
tests: Fix duplicated capabilities
qemu: Drop QEMU_CAPS_DEVICE_SCSI_GENERIC
src/qemu/qemu_capabilities.c | 7 +--
src/qemu/qemu_capabilities.h | 2 +-
src/qemu/qemu_command.c | 61 ++++++++-----------
src/qemu/qemu_hotplug.c | 12 ----
.../caps_1.5.3.x86_64.xml | 1 -
.../caps_1.6.0.x86_64.xml | 1 -
.../caps_1.7.0.x86_64.xml | 1 -
.../caps_2.1.1.x86_64.xml | 1 -
.../caps_2.10.0.aarch64.xml | 1 -
.../caps_2.10.0.ppc64.xml | 1 -
.../caps_2.10.0.s390x.xml | 1 -
.../caps_2.10.0.x86_64.xml | 1 -
.../caps_2.11.0.s390x.xml | 1 -
.../caps_2.11.0.x86_64.xml | 1 -
.../caps_2.12.0.aarch64.xml | 1 -
.../caps_2.12.0.ppc64.xml | 1 -
.../caps_2.12.0.s390x.xml | 1 -
.../caps_2.12.0.x86_64.xml | 1 -
.../caps_2.4.0.x86_64.xml | 1 -
.../caps_2.5.0.x86_64.xml | 1 -
.../caps_2.6.0.aarch64.xml | 1 -
.../qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 1 -
.../caps_2.6.0.x86_64.xml | 1 -
.../qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 -
.../caps_2.7.0.x86_64.xml | 1 -
.../qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 -
.../caps_2.8.0.x86_64.xml | 1 -
.../qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1 -
.../qemucapabilitiesdata/caps_2.9.0.s390x.xml | 1 -
.../caps_2.9.0.x86_64.xml | 1 -
.../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 -
.../caps_3.0.0.riscv32.xml | 1 -
.../caps_3.0.0.riscv64.xml | 1 -
.../caps_3.0.0.x86_64.xml | 1 -
tests/qemuxml2argvtest.c | 51 ++++++++--------
tests/qemuxml2xmltest.c | 55 ++++++++---------
36 files changed, 78 insertions(+), 140 deletions(-)
--
2.17.1
6 years, 3 months
[libvirt] [PATCH v2] virsh: Don't break loop of domblkinfo for disks
by Han Han
https://bugzilla.redhat.com/show_bug.cgi?id=1619625
--all option is added to cmdDomblkinfo since commit 62c39193 allowing to
show all block devices info. Reset error when empty source in case error
breaks the loop of domblkinfo for disks.
Signed-off-by: Han Han <hhan(a)redhat.com>
---
tools/virsh-domain-monitor.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index b9b4f9739b..576610f005 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -475,6 +475,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
int ndisks;
size_t i;
xmlNodePtr *disks = NULL;
+ char *source = NULL;
char *target = NULL;
char *protocol = NULL;
@@ -505,16 +506,18 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
for (i = 0; i < ndisks; i++) {
ctxt->node = disks[i];
+ source = virXPathString("string(./source)", ctxt);
protocol = virXPathString("string(./source/@protocol)", ctxt);
target = virXPathString("string(./target/@dev)", ctxt);
rc = virDomainGetBlockInfo(dom, target, &info, 0);
if (rc < 0) {
- /* If protocol is present that's an indication of a networked
- * storage device which cannot provide statistics, so generate
- * 0 based data and get the next disk. */
- if (protocol && !active &&
+ /* For the case of empty cdrom, networked disk which cannot
+ * provide statistics, generate 0 based data and get the next
+ * disk.
+ */
+ if (!source && protocol && !active &&
virGetLastErrorCode() == VIR_ERR_INTERNAL_ERROR &&
virGetLastErrorDomain() == VIR_FROM_STORAGE) {
memset(&info, 0, sizeof(info));
@@ -526,6 +529,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
cmdDomblkinfoPrint(ctl, &info, target, human, false);
+ VIR_FREE(source);
VIR_FREE(target);
VIR_FREE(protocol);
}
@@ -540,6 +544,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
cleanup:
virshDomainFree(dom);
+ VIR_FREE(source);
VIR_FREE(target);
VIR_FREE(protocol);
VIR_FREE(disks);
--
2.18.0
6 years, 3 months