[PATCH] domain_conf: make virDomainDiskSetSource() void
by Matt Coleman
The function only returns zero or aborts, so it might as well be void.
This has the added benefit of simplifying the code that calls it.
Signed-off-by: Matt Coleman <matt(a)datto.com>
---
src/conf/domain_conf.c | 3 +--
src/conf/domain_conf.h | 3 +--
src/libxl/libxl_driver.c | 6 ++----
src/libxl/xen_xl.c | 3 +--
src/libxl/xen_xm.c | 13 ++++---------
src/lxc/lxc_controller.c | 13 ++-----------
src/vbox/vbox_common.c | 6 +-----
src/vmx/vmx.c | 36 ++++++++++++------------------------
src/vz/vz_sdk.c | 4 ++--
9 files changed, 26 insertions(+), 61 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7696b12ef9..5c8ec19da8 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2241,13 +2241,12 @@ virDomainDiskGetSource(virDomainDiskDef const *def)
}
-int
+void
virDomainDiskSetSource(virDomainDiskDefPtr def, const char *src)
{
char *tmp = g_strdup(src);
g_free(def->src->path);
def->src->path = tmp;
- return 0;
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 8a487e9de3..c164b28ea1 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -3040,8 +3040,7 @@ void virDomainLeaseDefFree(virDomainLeaseDefPtr def);
int virDomainDiskGetType(virDomainDiskDefPtr def);
void virDomainDiskSetType(virDomainDiskDefPtr def, int type);
const char *virDomainDiskGetSource(virDomainDiskDef const *def);
-int virDomainDiskSetSource(virDomainDiskDefPtr def, const char *src)
- G_GNUC_WARN_UNUSED_RESULT;
+void virDomainDiskSetSource(virDomainDiskDefPtr def, const char *src);
void virDomainDiskEmptySource(virDomainDiskDefPtr def);
const char *virDomainDiskGetDriver(const virDomainDiskDef *def);
int virDomainDiskSetDriver(virDomainDiskDefPtr def, const char *name)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 824ed60dfd..00a74dcb49 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3022,8 +3022,7 @@ libxlDomainChangeEjectableMedia(virDomainObjPtr vm, virDomainDiskDefPtr disk)
goto cleanup;
}
- if (virDomainDiskSetSource(origdisk, virDomainDiskGetSource(disk)) < 0)
- goto cleanup;
+ virDomainDiskSetSource(origdisk, virDomainDiskGetSource(disk));
virDomainDiskSetType(origdisk, virDomainDiskGetType(disk));
virDomainDiskDefFree(disk);
@@ -4084,8 +4083,7 @@ libxlDomainUpdateDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev)
return -1;
}
- if (virDomainDiskSetSource(orig, virDomainDiskGetSource(disk)) < 0)
- return -1;
+ virDomainDiskSetSource(orig, virDomainDiskGetSource(disk));
virDomainDiskSetType(orig, virDomainDiskGetType(disk));
virDomainDiskSetFormat(orig, virDomainDiskGetFormat(disk));
if (virDomainDiskSetDriver(orig, virDomainDiskGetDriver(disk)) < 0)
diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c
index 74f48e4117..d195f866c5 100644
--- a/src/libxl/xen_xl.c
+++ b/src/libxl/xen_xl.c
@@ -641,8 +641,7 @@ xenParseXLDiskSrc(virDomainDiskDefPtr disk, char *srcstr)
disk->src->protocol = VIR_STORAGE_NET_PROTOCOL_RBD;
ret = virStorageSourceParseRBDColonString(tmpstr, disk->src);
} else {
- if (virDomainDiskSetSource(disk, srcstr) < 0)
- goto cleanup;
+ virDomainDiskSetSource(disk, srcstr);
ret = 0;
}
diff --git a/src/libxl/xen_xm.c b/src/libxl/xen_xm.c
index 9063a43135..283ed1ee8b 100644
--- a/src/libxl/xen_xm.c
+++ b/src/libxl/xen_xm.c
@@ -129,14 +129,11 @@ xenParseXMDisk(char *entry, int hvm)
if (offset == head) {
/* No source file given, eg CDROM with no media */
- ignore_value(virDomainDiskSetSource(disk, NULL));
+ virDomainDiskSetSource(disk, NULL);
} else {
tmp = g_strndup(head, offset - head);
- if (virDomainDiskSetSource(disk, tmp) < 0) {
- VIR_FREE(tmp);
- goto error;
- }
+ virDomainDiskSetSource(disk, tmp);
VIR_FREE(tmp);
}
@@ -175,8 +172,7 @@ xenParseXMDisk(char *entry, int hvm)
VIR_FREE(tmp);
/* Strip the prefix we found off the source file name */
- if (virDomainDiskSetSource(disk, src + len + 1) < 0)
- goto error;
+ virDomainDiskSetSource(disk, src + len + 1);
src = virDomainDiskGetSource(disk);
}
@@ -206,8 +202,7 @@ xenParseXMDisk(char *entry, int hvm)
}
/* Strip the prefix we found off the source file name */
- if (virDomainDiskSetSource(disk, src + len + 1) < 0)
- goto error;
+ virDomainDiskSetSource(disk, src + len + 1);
src = virDomainDiskGetSource(disk);
}
}
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 4f77a6ace8..97de0408b6 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -479,7 +479,6 @@ static int virLXCControllerSetupLoopDeviceDisk(virDomainDiskDefPtr disk)
int lofd;
g_autofree char *loname = NULL;
const char *src = virDomainDiskGetSource(disk);
- int ret = -1;
if ((lofd = virFileLoopDeviceAssociate(src, &loname)) < 0)
return -1;
@@ -492,14 +491,7 @@ static int virLXCControllerSetupLoopDeviceDisk(virDomainDiskDefPtr disk)
* the rest of container setup 'just works'
*/
virDomainDiskSetType(disk, VIR_STORAGE_TYPE_BLOCK);
- if (virDomainDiskSetSource(disk, loname) < 0)
- goto cleanup;
-
- ret = 0;
-
- cleanup:
- if (ret < 0)
- VIR_FORCE_CLOSE(lofd);
+ virDomainDiskSetSource(disk, loname);
return lofd;
@@ -561,8 +553,7 @@ static int virLXCControllerSetupNBDDeviceDisk(virDomainDiskDefPtr disk)
* the rest of container setup 'just works'
*/
virDomainDiskSetType(disk, VIR_STORAGE_TYPE_BLOCK);
- if (virDomainDiskSetSource(disk, dev) < 0)
- return -1;
+ virDomainDiskSetSource(disk, dev);
return 0;
}
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index d072ca8015..26168c3c5b 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -3309,11 +3309,7 @@ vboxDumpDisks(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine)
VBOX_UTF16_TO_UTF8(mediumLocUtf16, &mediumLocUtf8);
- if (virDomainDiskSetSource(disk, mediumLocUtf8) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not set disk source"));
- goto cleanup;
- }
+ virDomainDiskSetSource(disk, mediumLocUtf8);
rc = gVBoxAPI.UIMedium.GetReadOnly(medium, &readOnly);
if (NS_FAILED(rc)) {
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 5fac290a5e..4001174380 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -2410,10 +2410,7 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
virDomainDiskSetType(*def, VIR_STORAGE_TYPE_FILE);
if (!(tmp = ctx->parseFileName(fileName, ctx->opaque)))
goto cleanup;
- if (virDomainDiskSetSource(*def, tmp) < 0) {
- VIR_FREE(tmp);
- goto cleanup;
- }
+ virDomainDiskSetSource(*def, tmp);
VIR_FREE(tmp);
(*def)->cachemode = writeThrough ? VIR_DOMAIN_DISK_CACHE_WRITETHRU
: VIR_DOMAIN_DISK_CACHE_DEFAULT;
@@ -2450,19 +2447,16 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
virDomainDiskSetType(*def, VIR_STORAGE_TYPE_FILE);
if (!(tmp = ctx->parseFileName(fileName, ctx->opaque)))
goto cleanup;
- if (virDomainDiskSetSource(*def, tmp) < 0) {
- VIR_FREE(tmp);
- goto cleanup;
- }
+ virDomainDiskSetSource(*def, tmp);
VIR_FREE(tmp);
} else if (deviceType && STRCASEEQ(deviceType, "atapi-cdrom")) {
virDomainDiskSetType(*def, VIR_STORAGE_TYPE_BLOCK);
if (fileName && STRCASEEQ(fileName, "auto detect")) {
- ignore_value(virDomainDiskSetSource(*def, NULL));
+ virDomainDiskSetSource(*def, NULL);
(*def)->startupPolicy = VIR_DOMAIN_STARTUP_POLICY_OPTIONAL;
- } else if (virDomainDiskSetSource(*def, fileName) < 0) {
- goto cleanup;
+ } else {
+ virDomainDiskSetSource(*def, fileName);
}
} else if (deviceType && STRCASEEQ(deviceType, "cdrom-raw")) {
/* Raw access CD-ROMs actually are device='lun' */
@@ -2470,10 +2464,10 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
virDomainDiskSetType(*def, VIR_STORAGE_TYPE_BLOCK);
if (fileName && STRCASEEQ(fileName, "auto detect")) {
- ignore_value(virDomainDiskSetSource(*def, NULL));
+ virDomainDiskSetSource(*def, NULL);
(*def)->startupPolicy = VIR_DOMAIN_STARTUP_POLICY_OPTIONAL;
- } else if (virDomainDiskSetSource(*def, fileName) < 0) {
- goto cleanup;
+ } else {
+ virDomainDiskSetSource(*def, fileName);
}
} else if (busType == VIR_DOMAIN_DISK_BUS_SCSI &&
deviceType && STRCASEEQ(deviceType, "scsi-passthru")) {
@@ -2481,9 +2475,7 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
/* SCSI-passthru CD-ROMs actually are device='lun' */
(*def)->device = VIR_DOMAIN_DISK_DEVICE_LUN;
virDomainDiskSetType(*def, VIR_STORAGE_TYPE_BLOCK);
-
- if (virDomainDiskSetSource(*def, fileName) < 0)
- goto cleanup;
+ virDomainDiskSetSource(*def, fileName);
} else {
/*
* This function was called in order to parse a CDROM device,
@@ -2502,7 +2494,7 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
}
virDomainDiskSetType(*def, VIR_STORAGE_TYPE_FILE);
- ignore_value(virDomainDiskSetSource(*def, NULL));
+ virDomainDiskSetSource(*def, NULL);
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid or not yet handled value '%s' "
@@ -2514,18 +2506,14 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con
} else if (device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
if (fileType != NULL && STRCASEEQ(fileType, "device")) {
virDomainDiskSetType(*def, VIR_STORAGE_TYPE_BLOCK);
- if (virDomainDiskSetSource(*def, fileName) < 0)
- goto cleanup;
+ virDomainDiskSetSource(*def, fileName);
} else if (fileType != NULL && STRCASEEQ(fileType, "file")) {
char *tmp = NULL;
virDomainDiskSetType(*def, VIR_STORAGE_TYPE_FILE);
if (fileName && !(tmp = ctx->parseFileName(fileName, ctx->opaque)))
goto cleanup;
- if (virDomainDiskSetSource(*def, tmp) < 0) {
- VIR_FREE(tmp);
- goto cleanup;
- }
+ virDomainDiskSetSource(*def, tmp);
VIR_FREE(tmp);
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 7877974628..6a0ab5c862 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -674,8 +674,8 @@ prlsdkGetDiskInfo(vzDriverPtr driver,
if (!(buf = prlsdkGetStringParamVar(PrlVmDev_GetFriendlyName, prldisk)))
goto cleanup;
- if (*buf != '\0' && virDomainDiskSetSource(disk, buf) < 0)
- goto cleanup;
+ if (*buf != '\0')
+ virDomainDiskSetSource(disk, buf);
if (prlsdkGetDiskId(prldisk, &disk->bus, &disk->dst) < 0)
goto cleanup;
--
2.27.0
4 years, 6 months
[PATCH] convert char pointers to use g_autofree
by Ryan Gahagan
From: bschoney <bschoney(a)utexas.edu>
additional conversions to the GLib API in src/util per issue #11.
Please let me know if there are additional changes I should make in the files updated so far.
I intend to submit work on additional files, and I want to be sure the changes so far are correct.
Related issue: https://gitlab.com/libvirt/libvirt/-/issues/11
Signed-off-by: bschoney <bschoney(a)utexas.edu>
---
src/util/vircgroupv1.c | 3 +--
src/util/virhostcpu.c | 4 +---
src/util/virlockspace.c | 6 ++----
src/util/virmacmap.c | 3 +--
src/util/virresctrl.c | 25 ++++++++-----------------
src/util/virsysinfo.c | 9 +++------
6 files changed, 16 insertions(+), 34 deletions(-)
diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c
index 731e9d61d4..984cd50409 100644
--- a/src/util/vircgroupv1.c
+++ b/src/util/vircgroupv1.c
@@ -1549,7 +1549,7 @@ virCgroupV1GetMemoryStat(virCgroupPtr group,
unsigned long long *unevictable)
{
int ret = -1;
- char *stat = NULL;
+ g_autofree char *stat = NULL;
char *line = NULL;
unsigned long long cacheVal = 0;
unsigned long long activeAnonVal = 0;
@@ -1614,7 +1614,6 @@ virCgroupV1GetMemoryStat(virCgroupPtr group,
ret = 0;
cleanup:
- VIR_FREE(stat);
return ret;
}
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index c531d65f86..4f6c3390ce 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -87,7 +87,7 @@ virHostCPUGetStatsFreeBSD(int cpuNum,
int *nparams)
{
const char *sysctl_name;
- long *cpu_times;
+ g_autofree long *cpu_times = NULL;
struct clockinfo clkinfo;
size_t i, j, cpu_times_size, clkinfo_size;
int cpu_times_num, offset, hz, stathz, ret = -1;
@@ -172,8 +172,6 @@ virHostCPUGetStatsFreeBSD(int cpuNum,
ret = 0;
cleanup:
- VIR_FREE(cpu_times);
-
return ret;
}
diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c
index 2731d46dfc..c88a24be36 100644
--- a/src/util/virlockspace.c
+++ b/src/util/virlockspace.c
@@ -515,7 +515,7 @@ int virLockSpaceCreateResource(virLockSpacePtr lockspace,
const char *resname)
{
int ret = -1;
- char *respath = NULL;
+ g_autofree char *respath = NULL;
VIR_DEBUG("lockspace=%p resname=%s", lockspace, resname);
@@ -538,7 +538,6 @@ int virLockSpaceCreateResource(virLockSpacePtr lockspace,
cleanup:
virMutexUnlock(&lockspace->lock);
- VIR_FREE(respath);
return ret;
}
@@ -547,7 +546,7 @@ int virLockSpaceDeleteResource(virLockSpacePtr lockspace,
const char *resname)
{
int ret = -1;
- char *respath = NULL;
+ g_autofree char *respath = NULL;
VIR_DEBUG("lockspace=%p resname=%s", lockspace, resname);
@@ -575,7 +574,6 @@ int virLockSpaceDeleteResource(virLockSpacePtr lockspace,
cleanup:
virMutexUnlock(&lockspace->lock);
- VIR_FREE(respath);
return ret;
}
diff --git a/src/util/virmacmap.c b/src/util/virmacmap.c
index 2d203e72af..70b148acac 100644
--- a/src/util/virmacmap.c
+++ b/src/util/virmacmap.c
@@ -129,7 +129,7 @@ static int
virMacMapLoadFile(virMacMapPtr mgr,
const char *file)
{
- char *map_str = NULL;
+ g_autofree char *map_str = NULL;
virJSONValuePtr map = NULL;
int map_str_len = 0;
size_t i;
@@ -189,7 +189,6 @@ virMacMapLoadFile(virMacMapPtr mgr,
ret = 0;
cleanup:
- VIR_FREE(map_str);
virJSONValueFree(map);
return ret;
}
diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
index d3087b98c1..1c2d175295 100644
--- a/src/util/virresctrl.c
+++ b/src/util/virresctrl.c
@@ -709,7 +709,7 @@ virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl)
{
int ret = -1;
int rv = -1;
- char *featurestr = NULL;
+ g_autofree char *featurestr = NULL;
char **features = NULL;
size_t nfeatures = 0;
virResctrlInfoMongrpPtr info_monitor = NULL;
@@ -771,7 +771,6 @@ virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl)
ret = 0;
cleanup:
- VIR_FREE(featurestr);
g_strfreev(features);
VIR_FREE(info_monitor);
return ret;
@@ -1736,7 +1735,7 @@ virResctrlAllocGetGroup(virResctrlInfoPtr resctrl,
const char *groupname,
virResctrlAllocPtr *alloc)
{
- char *schemata = NULL;
+ g_autofree char *schemata = NULL;
int rv = virFileReadValueString(&schemata,
SYSFS_RESCTRL_PATH "/%s/schemata",
groupname);
@@ -1753,11 +1752,9 @@ virResctrlAllocGetGroup(virResctrlInfoPtr resctrl,
if (virResctrlAllocParse(resctrl, *alloc, schemata) < 0)
goto error;
- VIR_FREE(schemata);
return 0;
error:
- VIR_FREE(schemata);
virObjectUnref(*alloc);
*alloc = NULL;
return -1;
@@ -2354,8 +2351,8 @@ virResctrlAllocCreate(virResctrlInfoPtr resctrl,
virResctrlAllocPtr alloc,
const char *machinename)
{
- char *schemata_path = NULL;
- char *alloc_str = NULL;
+ g_autofree char *schemata_path = NULL;
+ g_autofree char *alloc_str = NULL;
int ret = -1;
int lockfd = -1;
@@ -2403,8 +2400,6 @@ virResctrlAllocCreate(virResctrlInfoPtr resctrl,
ret = 0;
cleanup:
virResctrlUnlock(lockfd);
- VIR_FREE(alloc_str);
- VIR_FREE(schemata_path);
return ret;
}
@@ -2413,8 +2408,8 @@ static int
virResctrlAddPID(const char *path,
pid_t pid)
{
- char *tasks = NULL;
- char *pidstr = NULL;
+ g_autofree char *tasks = NULL;
+ g_autofree char *pidstr = NULL;
int ret = 0;
if (!path) {
@@ -2436,8 +2431,6 @@ virResctrlAddPID(const char *path,
ret = 0;
cleanup:
- VIR_FREE(tasks);
- VIR_FREE(pidstr);
return ret;
}
@@ -2657,8 +2650,8 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor,
size_t i = 0;
unsigned long long val = 0;
g_autoptr(DIR) dirp = NULL;
- char *datapath = NULL;
- char *filepath = NULL;
+ g_autofree char *datapath = NULL;
+ g_autofree char *filepath = NULL;
struct dirent *ent = NULL;
virResctrlMonitorStatsPtr stat = NULL;
@@ -2737,8 +2730,6 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor,
ret = 0;
cleanup:
- VIR_FREE(datapath);
- VIR_FREE(filepath);
virResctrlMonitorStatsFree(stat);
return ret;
}
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index 217f842a37..e1336bf566 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -532,9 +532,9 @@ static int
virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret)
{
const char *tmp_base;
- char *manufacturer = NULL;
- char *procline = NULL;
- char *ncpu = NULL;
+ g_autofree char *manufacturer = NULL;
+ g_autofree char *procline = NULL;
+ g_autofree char *ncpu = NULL;
int result = -1;
virSysinfoProcessorDefPtr processor;
@@ -593,9 +593,6 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret)
result = 0;
error:
- VIR_FREE(manufacturer);
- VIR_FREE(procline);
- VIR_FREE(ncpu);
return result;
}
--
2.29.0
4 years, 6 months
[libvirt PATCH] Fix name prefix of VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE
by Daniel P. Berrangé
The enum constant names should all have a prefix that matches the enum
name. VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE was missing the "CREATE_"
part of the name prefix.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
include/libvirt/libvirt-domain-checkpoint.h | 4 ++--
src/libvirt-domain-checkpoint.c | 4 ++--
src/qemu/qemu_checkpoint.c | 4 ++--
tools/virsh-checkpoint.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/libvirt/libvirt-domain-checkpoint.h b/include/libvirt/libvirt-domain-checkpoint.h
index 58932c8a6a..a2f97531f8 100644
--- a/include/libvirt/libvirt-domain-checkpoint.h
+++ b/include/libvirt/libvirt-domain-checkpoint.h
@@ -57,8 +57,8 @@ typedef enum {
quiesce all mounted
file systems within
the domain */
- VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE = (1 << 2), /* validate disk data state
- when redefining a checkpoint */
+ VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_VALIDATE = (1 << 2), /* validate disk data state
+ when redefining a checkpoint */
} virDomainCheckpointCreateFlags;
/* Create a checkpoint using the current VM state. */
diff --git a/src/libvirt-domain-checkpoint.c b/src/libvirt-domain-checkpoint.c
index e0c2527ccb..e6ad4f4f5d 100644
--- a/src/libvirt-domain-checkpoint.c
+++ b/src/libvirt-domain-checkpoint.c
@@ -125,7 +125,7 @@ virDomainCheckpointGetConnect(virDomainCheckpointPtr checkpoint)
* has a way to resupply correct defaults). Not all hypervisors support
* this flag.
*
- * If @flags includes VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE along with
+ * If @flags includes VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_VALIDATE along with
* VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE the state of the metadata related
* to the disk state of the redefined checkpoint is validated. Note that
* hypervisors may require that the @domain is running to perform validation.
@@ -160,7 +160,7 @@ virDomainCheckpointCreateXML(virDomainPtr domain,
VIR_DOMAIN_CHECKPOINT_CREATE_QUIESCE,
error);
- VIR_REQUIRE_FLAG_GOTO(VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE,
+ VIR_REQUIRE_FLAG_GOTO(VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_VALIDATE,
VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE,
error);
diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c
index c24376dbe8..eb33633a11 100644
--- a/src/qemu/qemu_checkpoint.c
+++ b/src/qemu/qemu_checkpoint.c
@@ -538,13 +538,13 @@ qemuCheckpointCreateXML(virDomainPtr domain,
virDomainCheckpointPtr checkpoint = NULL;
bool update_current = true;
bool redefine = flags & VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE;
- bool validate_bitmaps = flags & VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE;
+ bool validate_bitmaps = flags & VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_VALIDATE;
unsigned int parse_flags = 0;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
g_autoptr(virDomainCheckpointDef) def = NULL;
virCheckFlags(VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE |
- VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE, NULL);
+ VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_VALIDATE, NULL);
if (redefine) {
parse_flags |= VIR_DOMAIN_CHECKPOINT_PARSE_REDEFINE;
diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c
index cc2bbdae8a..f6396d16eb 100644
--- a/tools/virsh-checkpoint.c
+++ b/tools/virsh-checkpoint.c
@@ -125,7 +125,7 @@ cmdCheckpointCreate(vshControl *ctl,
if (vshCommandOptBool(cmd, "redefine"))
flags |= VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE;
if (vshCommandOptBool(cmd, "redefine-validate"))
- flags |= VIR_DOMAIN_CHECKPOINT_REDEFINE_VALIDATE;
+ flags |= VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_VALIDATE;
if (vshCommandOptBool(cmd, "quiesce"))
flags |= VIR_DOMAIN_CHECKPOINT_CREATE_QUIESCE;
--
2.28.0
4 years, 6 months
[libvirt PATCH 0/2] Fix dependencies for python scripts
by Daniel P. Berrangé
Daniel P. Berrangé (2):
meson: ensure python script is run in utf8 env
meson: drop use of .path() for python args
docs/manpages/meson.build | 4 ++--
docs/meson.build | 8 ++++----
src/access/meson.build | 2 +-
src/admin/meson.build | 4 ++--
src/esx/meson.build | 4 ++--
src/hyperv/meson.build | 2 +-
src/meson.build | 18 +++++++++---------
src/qemu/meson.build | 2 +-
src/util/meson.build | 4 ++--
9 files changed, 24 insertions(+), 24 deletions(-)
--
2.28.0
4 years, 6 months
[PATCH 0/7] drop support for Windows versions prior to 2012R2
by Matt Coleman
Microsoft no longer supports Windows 2008R2 at all. Windows 2012 and
2012 R2 are still within extended support until October 9, 2023.
Hyper-V's WMI API has two versions. V1 is supported by 2008R2 and 2012.
2012 also offered initial support for V2, but it's incomplete.
2012R2 was the first version to offer full support for the V2 API.
This patchset drops support for the V1 WMI API.
Here's a GitLab merge request, if you'd prefer to review it there:
https://gitlab.com/iammattcoleman/libvirt/-/merge_requests/7
Matt Coleman (7):
hyperv: remove V1 classes from the WMI generator input
hyperv: remove hypervPrivate->wmiVersion
hyperv: remove support for multiple API versions from the WMI
generator
hyperv: remove hypervWmiClassInfoList, hypervWmiClassInfoListPtr, and
_hypervWmiClassInfoList
hyperv: do not generate *_CLASSNAME constants
docs: drop support for Windows versions prior to 2012R2
news: drop support for Windows versions prior to 2012R2
NEWS.rst | 6 +
docs/drvhyperv.html.in | 17 +-
docs/platforms.rst | 3 +-
scripts/hyperv_wmi_generator.py | 275 ++++-------------
src/hyperv/hyperv_driver.c | 299 +++++-------------
src/hyperv/hyperv_private.h | 7 -
src/hyperv/hyperv_wmi.c | 108 ++-----
src/hyperv/hyperv_wmi.h | 39 +--
src/hyperv/hyperv_wmi_classes.h | 13 -
src/hyperv/hyperv_wmi_generator.input | 422 +-------------------------
10 files changed, 180 insertions(+), 1009 deletions(-)
--
2.27.0
4 years, 6 months
[PATCH] qemustatusxml2xmltest: Remove 'virdeterministichash' mocking
by Peter Krempa
Commit 89a3115bac2c92ac67516 was not updated after recent changes to
hash table usage and was still referencing the now removed deterministic
hash mock, which caused CI failure.
Fixes: 89a3115bac2c92ac67516d04df6a45769f69a37c
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Pushed as fix for CI.
tests/qemustatusxml2xmltest.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tests/qemustatusxml2xmltest.c b/tests/qemustatusxml2xmltest.c
index 3168622be6..67a070c986 100644
--- a/tests/qemustatusxml2xmltest.c
+++ b/tests/qemustatusxml2xmltest.c
@@ -151,5 +151,4 @@ mymain(void)
VIR_TEST_MAIN_PRELOAD(mymain,
VIR_TEST_MOCK("virpci"),
VIR_TEST_MOCK("virrandom"),
- VIR_TEST_MOCK("domaincaps"),
- VIR_TEST_MOCK("virdeterministichash"))
+ VIR_TEST_MOCK("domaincaps"))
--
2.26.2
4 years, 6 months
[PULL 0/3] MIPS patches for 5.2-rc1
by Philippe Mathieu-Daudé
The following changes since commit 3493c36f0371777c62d1d72b205b0eb6117e2156:
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20201106' into staging (2020-11-06 13:43:28 +0000)
are available in the Git repository at:
https://gitlab.com/philmd/qemu.git tags/mips-fixes-20201109
for you to fetch changes up to bf4ee88ab63fcf2dcb75f0d68cc6c8d2edb68212:
hw/mips/boston: Fix memory leak in boston_fdt_filter() error-handling paths (2020-11-09 00:40:44 +0100)
----------------------------------------------------------------
MIPS patches queue
- Deprecate nanoMIPS ISA
- Fix PageMask with variable page size (Huacai Chen)
- Fix memory leak in boston_fdt_filter (Coverity CID 1432275, Peter Maydell)
CI jobs results:
. https://cirrus-ci.com/build/5439131968864256
. https://gitlab.com/philmd/qemu/-/pipelines/213403385
. https://travis-ci.org/github/philmd/qemu/builds/742312387
----------------------------------------------------------------
Jiaxun Yang (1):
target/mips: Fix PageMask with variable page size
Peter Maydell (1):
hw/mips/boston: Fix memory leak in boston_fdt_filter() error-handling
paths
Philippe Mathieu-Daudé (1):
target/mips: Deprecate nanoMIPS ISA
docs/system/deprecated.rst | 23 +++++++++++++++++++++++
target/mips/cpu.h | 1 +
hw/mips/boston.c | 10 ++++------
target/mips/cp0_helper.c | 27 +++++++++++++++++++++------
MAINTAINERS | 6 +++++-
5 files changed, 54 insertions(+), 13 deletions(-)
--
2.26.2
4 years, 6 months
Libvirt Open Source Contribution
by Barrett J Schonefeld
Hey libvirt team,
We (Ryan Gahagan, Dustan Helm, and Barrett Schonefeld) are computer science
students at the University of Texas at Austin. We are taking a course in
virtualization, and we’d like to contribute to the libvirt repository as
part of this course. Here are the issues we are most interested in:
https://gitlab.com/libvirt/libvirt/-/issues/11
https://gitlab.com/libvirt/libvirt/-/issues/16
Additionally, we would like to take a look at issue 4 (
https://gitlab.com/libvirt/libvirt/-/issues/4), the UDP slowdown for QEMU.
We expect issue 4 to be more time-intensive, and we would like to
communicate with you to ensure we’re solving the problem effectively.
Our course only runs until the end of the fall semester, so our time to
contribute to this project is somewhat limited. If you think any of the
issues we picked would be too difficult to accomplish during that time
frame, we would appreciate alternative suggestions. We really hope to
contribute to this project and help make improvements where we can.
Best regards,
Dustan Helm: dustan.helm(a)yahoo.com
Barrett Schonefeld: bschoney(a)utexas.edu
Ryan Gahagan: ryangahagan18(a)gmail.com
4 years, 6 months
[PATCH 0/9] tests: Add testing of qemu migration cookie
by Peter Krempa
Note that this series probably depends on the hash table refactor.
Add testing of migration cookie as we don't have any schema or examples
of it to prevent breakage and help with development.
Peter Krempa (9):
qemuxml2xmltest: Remove 'WITH_QEMU' conditional
qemuxml2xmltest: Split out status XML testing to
qemustatusxml2xmltest.c
qemu_migration_cookie: Make header standalone
qemu_migration_cookie: Export qemuMigrationCookieXMLFormat for tests
tests: Add mock library for virGetHostname and virGetHostUUID
qemu_migration_cookie: Make cookie parsing robust against missing
domain job
tests: Add testing of qemu migration cookie
qemumigrationcookiexmltest: Add synthetic test case
virCPUDefFormatBufFull: Use virXMLFormatElement
src/conf/cpu_conf.c | 16 +-
src/qemu/qemu_migration_cookie.c | 4 +-
src/qemu/qemu_migration_cookie.h | 9 +
src/util/virutil.h | 2 +-
src/util/viruuid.h | 2 +-
tests/hostidmock.c | 36 ++
tests/meson.build | 3 +
.../basic-xml2xml-in.xml | 6 +
.../basic-xml2xml-out.xml | 9 +
.../full-xml2xml-in.xml | 221 ++++++++++++
.../full-xml2xml-out.xml | 219 ++++++++++++
.../modern-dom-out-dest.xml | 12 +
.../modern-dom-out-source.xml | 12 +
tests/qemumigrationcookiexmltest.c | 337 ++++++++++++++++++
tests/qemustatusxml2xmltest.c | 159 +++++++++
tests/qemuxml2xmltest.c | 136 ++-----
16 files changed, 1048 insertions(+), 135 deletions(-)
create mode 100644 tests/hostidmock.c
create mode 100644 tests/qemumigrationcookiexmldata/basic-xml2xml-in.xml
create mode 100644 tests/qemumigrationcookiexmldata/basic-xml2xml-out.xml
create mode 100644 tests/qemumigrationcookiexmldata/full-xml2xml-in.xml
create mode 100644 tests/qemumigrationcookiexmldata/full-xml2xml-out.xml
create mode 100644 tests/qemumigrationcookiexmldata/modern-dom-out-dest.xml
create mode 100644 tests/qemumigrationcookiexmldata/modern-dom-out-source.xml
create mode 100644 tests/qemumigrationcookiexmltest.c
create mode 100644 tests/qemustatusxml2xmltest.c
--
2.26.2
4 years, 6 months