[PATCH 0/6] virsh: Some fixes noted when reviewing Jan's series
by Peter Krempa
Peter Krempa (6):
virsh: Un-document 'virsh echo'
virshtest: Don't use both '--xml' and '--shell' for 'virsh echo'
virsh: cmdEcho: Make '--xml' and '--shell' mutually exclusive
virsh: cmdEcho: Rewrite with new buffer helpers
virsh: Add testing for vshStringToArray
vshStringToArray: Rewrite using 'g_strsplit'
docs/manpages/virsh.rst | 17 ------
tests/virshtest.c | 20 +++++--
tools/vsh.c | 115 +++++++++++++++++++---------------------
3 files changed, 69 insertions(+), 83 deletions(-)
--
2.31.1
3 years, 4 months
[libvirt PATCH] vsh: steal pointer in vshEditWriteToTempFile
by Ján Tomko
Fixes: 13896b5ad1d7f157273b6e49106df1f33958a9ed
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
Pushed as trivial. Ears of shame were applied.
tools/vsh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/vsh.c b/tools/vsh.c
index f9600bafba..96b3ced0ca 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -2377,7 +2377,7 @@ vshEditWriteToTempFile(vshControl *ctl, const char *doc)
}
/* Temporary filename: caller frees. */
- return ret;
+ return g_steal_pointer(&ret);
}
/* Characters permitted in $EDITOR environment variable and temp filename. */
--
2.31.1
3 years, 4 months
[PATCH v3 00/11] Implement IOThreads related APIs for test driver
by Luke Yue
v3:
- Rebase to current master branch
- Fix compilation
- Fix tests
Luke Yue (11):
domain_driver.c: Introduce and use virDomainDriverAddIOThreadCheck()
test_driver: Introduce testIOThreadInfo and generate IOThread infos
test_driver: Implement virDomainAddIOThread
test_driver: Implement virDomainDelIOThread
domain_driver.c: Introduce and use virDomainDriverGetIOThreadsConfig()
test_driver: Implement virDomainGetIOThreadInfo
test_driver: Implement virDomainPinIOThread
test_driver: Implement testDomainSetIOThreadParams
test_driver: Implement virConnectGetAllDomainStats
test_driver: Introduce testDomainGetStatsIOThread
tests: Test IOThread related functions for test driver
examples/xml/test/testdomfc4.xml | 5 +
src/hypervisor/domain_driver.c | 132 ++++++++
src/hypervisor/domain_driver.h | 10 +
src/libvirt_private.syms | 3 +
src/qemu/qemu_driver.c | 113 +------
src/test/meson.build | 1 +
src/test/test_driver.c | 515 +++++++++++++++++++++++++++++++
tests/virshtest.c | 90 ++++++
8 files changed, 761 insertions(+), 108 deletions(-)
--
2.32.0
3 years, 4 months
[libvirt PATCH 0/3] xml: use g_auto for xmlXPathObject (glib chronicles)
by Ján Tomko
Ján Tomko (3):
util: define cleanup func for xmlXPathObject
util: xml: use g_auto for xmlXPathObject
util: xml: clean up unnecessary ret variables
src/util/virxml.c | 49 +++++++++++++----------------------------------
src/util/virxml.h | 1 +
2 files changed, 14 insertions(+), 36 deletions(-)
--
2.31.1
3 years, 4 months
Plans for the next release
by Jiri Denemark
I'm sending this early as I'll be out until Aug 25, but don't worry I'll
be back in time to handle the whole release process.
To aim for the release on Sep 01 I suggest entering the freeze on
Thursday Aug 26 and tagging RC2 on Monday Aug 30.
I hope this works for everyone.
Jirka
3 years, 4 months
[PATCH 0/5] src: move validation to virXMLParseHelper()
by Kristina Hanicova
This series avoids duplication of the same code used for validation of
XML document against rng schema and makes it easier to add validation of
other objects in the future as well.
Kristina Hanicova (5):
src: add 'schema' and 'validate' variable to virXMLParseHelper()
util: add xml validation against schema in virXMLParseHelper()
domain_conf: replace validation with variables passed to virXMLParse()
domain_conf: Remove redundant variable
conf: replace validation with variables passed to virXMLParse()
src/conf/backup_conf.c | 13 ++-----------
src/conf/checkpoint_conf.c | 12 ++----------
src/conf/domain_conf.c | 27 +++++++--------------------
src/conf/interface_conf.c | 2 +-
src/conf/network_conf.c | 2 +-
src/conf/node_device_conf.c | 2 +-
src/conf/nwfilter_conf.c | 2 +-
src/conf/secret_conf.c | 2 +-
src/conf/snapshot_conf.c | 15 ++-------------
src/conf/storage_conf.c | 4 ++--
src/conf/virnetworkportdef.c | 2 +-
src/conf/virnwfilterbindingdef.c | 2 +-
src/conf/virnwfilterbindingobj.c | 2 +-
src/test/test_driver.c | 2 +-
src/util/virxml.c | 16 +++++++++++++++-
src/util/virxml.h | 20 +++++++++++---------
src/vbox/vbox_snapshot_conf.c | 6 +++---
src/vz/vz_sdk.c | 2 +-
tests/qemuxml2argvtest.c | 2 +-
19 files changed, 55 insertions(+), 80 deletions(-)
--
2.31.1
3 years, 4 months
[libvirt PATCH] virsh: refactor cmdDomblkinfo
by Ján Tomko
Use automatic memory cleanup to get rid of the cleanup section,
and of the memory leak that happens inside the loop, because
cap, alloc and phy are only freed once per function.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
tools/virsh-domain-monitor.c | 62 +++++++++++++++---------------------
1 file changed, 25 insertions(+), 37 deletions(-)
diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index a2bf5c05fc..55c8dcf118 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -452,22 +452,16 @@ static bool
cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
{
virDomainBlockInfo info;
- virDomainPtr dom;
- bool ret = false;
+ g_autoptr(virshDomain) dom = NULL;
bool human = false;
bool all = false;
const char *device = NULL;
- xmlDocPtr xmldoc = NULL;
- xmlXPathContextPtr ctxt = NULL;
+ g_autoptr(xmlDoc) xmldoc = NULL;
+ g_autoptr(xmlXPathContext) ctxt = NULL;
int ndisks;
size_t i;
- xmlNodePtr *disks = NULL;
- char *target = NULL;
- char *protocol = NULL;
- char *cap = NULL;
- char *alloc = NULL;
- char *phy = NULL;
- vshTable *table = NULL;
+ g_autofree xmlNodePtr *disks = NULL;
+ g_autoptr(vshTable) table = NULL;
VSH_EXCLUSIVE_OPTIONS("all", "device");
@@ -477,7 +471,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
all = vshCommandOptBool(cmd, "all");
if (!all && vshCommandOptStringQuiet(ctl, cmd, "device", &device) <= 0) {
vshError(ctl, "command 'domblkinfo' requires <device> option");
- goto cleanup;
+ return false;
}
human = vshCommandOptBool(cmd, "human");
@@ -487,18 +481,24 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
int rc;
if (virshDomainGetXML(ctl, cmd, 0, &xmldoc, &ctxt) < 0)
- goto cleanup;
+ return false;
ndisks = virXPathNodeSet("./devices/disk", ctxt, &disks);
if (ndisks < 0)
- goto cleanup;
+ return false;
/* title */
table = vshTableNew(_("Target"), _("Capacity"), _("Allocation"), _("Physical"), NULL);
if (!table)
- goto cleanup;
+ return false;
for (i = 0; i < ndisks; i++) {
+ g_autofree char *target = NULL;
+ g_autofree char *protocol = NULL;
+ g_autofree char *cap = NULL;
+ g_autofree char *alloc = NULL;
+ g_autofree char *phy = NULL;
+
ctxt->node = disks[i];
protocol = virXPathString("string(./source/@protocol)", ctxt);
target = virXPathString("string(./target/@dev)", ctxt);
@@ -517,7 +517,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
memset(&info, 0, sizeof(info));
vshResetLibvirtError();
} else {
- goto cleanup;
+ return false;
}
}
} else {
@@ -527,41 +527,29 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
}
if (!cmdDomblkinfoGet(&info, &cap, &alloc, &phy, human))
- goto cleanup;
+ return false;
if (vshTableRowAppend(table, target, cap, alloc, phy, NULL) < 0)
- goto cleanup;
-
- VIR_FREE(target);
- VIR_FREE(protocol);
+ return false;
}
vshTablePrintToStdout(table, ctl);
} else {
+ g_autofree char *cap = NULL;
+ g_autofree char *alloc = NULL;
+ g_autofree char *phy = NULL;
+
if (virDomainGetBlockInfo(dom, device, &info, 0) < 0)
- goto cleanup;
+ return false;
if (!cmdDomblkinfoGet(&info, &cap, &alloc, &phy, human))
- goto cleanup;
+ return false;
vshPrint(ctl, "%-15s %s\n", _("Capacity:"), cap);
vshPrint(ctl, "%-15s %s\n", _("Allocation:"), alloc);
vshPrint(ctl, "%-15s %s\n", _("Physical:"), phy);
}
- ret = true;
-
- cleanup:
- vshTableFree(table);
- VIR_FREE(cap);
- VIR_FREE(alloc);
- VIR_FREE(phy);
- virshDomainFree(dom);
- VIR_FREE(target);
- VIR_FREE(protocol);
- VIR_FREE(disks);
- xmlXPathFreeContext(ctxt);
- xmlFreeDoc(xmldoc);
- return ret;
+ return true;
}
/*
--
2.31.1
3 years, 4 months
[PATCH 0/2] versions of: save status xml after generating taint message
by Kristina Hanicova
Both of these patches solve the same bug and only one needs to be
merged. The first one is a bit longer, but I think it is more effective
(because of function qemuDomainObjCheckTaint, where qemuDomainObjTaint
could be potentially called in multiple for cycles). The second one is
short and probably more readable.
I will leave it up to the reviewer to choose one.
Kristina Hanicova (2):
qemu: save status xml after generating taint message
qemu: save status xml after generating taint message
src/qemu/qemu_domain.c | 14 ++++++++++++++
src/qemu/qemu_domain.h | 5 +++++
src/qemu/qemu_driver.c | 4 ++--
3 files changed, 21 insertions(+), 2 deletions(-)
--
2.31.1
3 years, 4 months
[PATCH v2 00/11] Implement IOThreads related APIs for test driver
by Luke Yue
v2:
- Move the extracted functions to hypervisor/domain_driver.c
- Implement virDomainPinIOThread
- Implement virDomainSetIOThreadParams
- Implement virConnectGetAllDomainStats, currently only supports get
state and IOThread info
- Add more tests
Luke Yue (11):
domain_driver.c: Introduce and use virDomainDriverAddIOThreadCheck()
test_driver: Introduce testIOThreadInfo and generate IOThread infos
test_driver: Implement virDomainAddIOThread
test_driver: Implement virDomainDelIOThread
domain_driver.c: Introduce and use virDomainDriverGetIOThreadsConfig()
test_driver: Implement virDomainGetIOThreadInfo
test_driver: Implement virDomainPinIOThread
test_driver: Implement testDomainSetIOThreadParams
test_driver: Implement virConnectGetAllDomainStats
test_driver: Introduce testDomainGetStatsIOThread
tests: Test IOThread related functions for test driver
examples/xml/test/testdomfc4.xml | 5 +
src/hypervisor/domain_driver.c | 123 ++++++++
src/hypervisor/domain_driver.h | 9 +
src/libvirt_private.syms | 3 +
src/qemu/qemu_driver.c | 113 +------
src/test/meson.build | 1 +
src/test/test_driver.c | 509 +++++++++++++++++++++++++++++++
tests/virshtest.c | 90 ++++++
8 files changed, 745 insertions(+), 108 deletions(-)
--
2.32.0
3 years, 4 months
[PATCH 0/4] Implement some job related APIs for test driver
by Luke Yue
Luke Yue (4):
test_driver: Implement virDomainGetJobInfo
test_driver: Implement virDomainGetJobStats
test_driver: Implement virDomainAbortJob
virshtest: add test for domjobinfo
src/test/test_driver.c | 170 +++++++++++++++++++++++++++++++++++++++++
tests/virshtest.c | 11 +++
2 files changed, 181 insertions(+)
--
2.32.0
3 years, 4 months