On Tue, Oct 22, 2019 at 03:57:14PM +0200, Michal Privoznik wrote:
These functions can't fail really. Drop checking of their retval
then.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/libxl/libxl_conf.c | 34 +++++++++++-----------------------
src/libxl/libxl_domain.c | 35 +++++++++++++----------------------
src/libxl/libxl_domain.h | 2 +-
src/libxl/libxl_driver.c | 19 +++++++------------
src/libxl/libxl_logger.c | 11 ++++-------
src/libxl/libxl_migration.c | 9 +++------
src/libxl/xen_common.c | 11 +++++------
src/libxl/xen_xl.c | 18 ++++++------------
src/libxl/xen_xm.c | 6 ++----
9 files changed, 52 insertions(+), 93 deletions(-)
@@ -931,7 +931,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,
*
* virDomainObjPtr must be locked on invocation
*/
-int
+void
Changing the return type can be done later,
libxlDomainAutoCoreDump(libxlDriverPrivatePtr driver,
virDomainObjPtr vm)
{
@@ -940,28 +940,19 @@ libxlDomainAutoCoreDump(libxlDriverPrivatePtr driver,
char timestr[100];
struct tm time_info;
char *dumpfile = NULL;
- int ret = -1;
localtime_r(&curtime, &time_info);
strftime(timestr, sizeof(timestr), "%Y-%m-%d-%H:%M:%S", &time_info);
- if (virAsprintf(&dumpfile, "%s/%s-%s",
- cfg->autoDumpDir,
- vm->def->name,
- timestr) < 0)
- goto cleanup;
+ virAsprintf(&dumpfile, "%s/%s-%s", cfg->autoDumpDir,
vm->def->name,
+ timestr);
/* Unlock virDomainObj while dumping core */
virObjectUnlock(vm);
libxl_domain_core_dump(cfg->ctx, vm->def->id, dumpfile, NULL);
virObjectLock(vm);
- ret = 0;
for now, you can just leave this ret = 0 here.
Jano
-
- cleanup:
VIR_FREE(dumpfile);
-
- return ret;
}
int