mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-09-19 01:44:56 +03:00
Compare commits
10 Commits
v4.9.0
...
v1.2.11-ma
Author | SHA1 | Date | |
---|---|---|---|
|
b7fbb52ac8 | ||
|
0060c4ee9e | ||
|
5f2b433767 | ||
|
0c4b7b6bb5 | ||
|
6b740484ae | ||
|
e6a04f51c9 | ||
|
f0be92b412 | ||
|
b175298be8 | ||
|
7195a5fa47 | ||
|
41358b7e91 |
@@ -1609,11 +1609,10 @@ remoteDispatchConnectListAllDomains(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||
cleanup:
|
||||
if (rv < 0)
|
||||
virNetMessageSaveError(rerr);
|
||||
if (doms && ndomains > 0) {
|
||||
if (doms && ndomains > 0)
|
||||
for (i = 0; i < ndomains; i++)
|
||||
virObjectUnref(doms[i]);
|
||||
VIR_FREE(doms);
|
||||
}
|
||||
VIR_FREE(doms);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -4533,11 +4532,10 @@ remoteDispatchDomainListAllSnapshots(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||
if (rv < 0)
|
||||
virNetMessageSaveError(rerr);
|
||||
virObjectUnref(dom);
|
||||
if (snaps && nsnaps > 0) {
|
||||
if (snaps && nsnaps > 0)
|
||||
for (i = 0; i < nsnaps; i++)
|
||||
virObjectUnref(snaps[i]);
|
||||
VIR_FREE(snaps);
|
||||
}
|
||||
VIR_FREE(snaps);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -4602,11 +4600,10 @@ remoteDispatchDomainSnapshotListAllChildren(virNetServerPtr server ATTRIBUTE_UNU
|
||||
virNetMessageSaveError(rerr);
|
||||
virObjectUnref(snapshot);
|
||||
virObjectUnref(dom);
|
||||
if (snaps && nsnaps > 0) {
|
||||
if (snaps && nsnaps > 0)
|
||||
for (i = 0; i < nsnaps; i++)
|
||||
virObjectUnref(snaps[i]);
|
||||
VIR_FREE(snaps);
|
||||
}
|
||||
VIR_FREE(snaps);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -4661,11 +4658,10 @@ remoteDispatchConnectListAllStoragePools(virNetServerPtr server ATTRIBUTE_UNUSED
|
||||
cleanup:
|
||||
if (rv < 0)
|
||||
virNetMessageSaveError(rerr);
|
||||
if (pools && npools > 0) {
|
||||
if (pools && npools > 0)
|
||||
for (i = 0; i < npools; i++)
|
||||
virObjectUnref(pools[i]);
|
||||
VIR_FREE(pools);
|
||||
}
|
||||
VIR_FREE(pools);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -4724,11 +4720,10 @@ remoteDispatchStoragePoolListAllVolumes(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||
cleanup:
|
||||
if (rv < 0)
|
||||
virNetMessageSaveError(rerr);
|
||||
if (vols && nvols > 0) {
|
||||
if (vols && nvols > 0)
|
||||
for (i = 0; i < nvols; i++)
|
||||
virObjectUnref(vols[i]);
|
||||
VIR_FREE(vols);
|
||||
}
|
||||
VIR_FREE(vols);
|
||||
virObjectUnref(pool);
|
||||
return rv;
|
||||
}
|
||||
@@ -4784,11 +4779,10 @@ remoteDispatchConnectListAllNetworks(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||
cleanup:
|
||||
if (rv < 0)
|
||||
virNetMessageSaveError(rerr);
|
||||
if (nets && nnets > 0) {
|
||||
if (nets && nnets > 0)
|
||||
for (i = 0; i < nnets; i++)
|
||||
virObjectUnref(nets[i]);
|
||||
VIR_FREE(nets);
|
||||
}
|
||||
VIR_FREE(nets);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -4843,11 +4837,10 @@ remoteDispatchConnectListAllInterfaces(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||
cleanup:
|
||||
if (rv < 0)
|
||||
virNetMessageSaveError(rerr);
|
||||
if (ifaces && nifaces > 0) {
|
||||
if (ifaces && nifaces > 0)
|
||||
for (i = 0; i < nifaces; i++)
|
||||
virObjectUnref(ifaces[i]);
|
||||
VIR_FREE(ifaces);
|
||||
}
|
||||
VIR_FREE(ifaces);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -4902,11 +4895,10 @@ remoteDispatchConnectListAllNodeDevices(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||
cleanup:
|
||||
if (rv < 0)
|
||||
virNetMessageSaveError(rerr);
|
||||
if (devices && ndevices > 0) {
|
||||
if (devices && ndevices > 0)
|
||||
for (i = 0; i < ndevices; i++)
|
||||
virObjectUnref(devices[i]);
|
||||
VIR_FREE(devices);
|
||||
}
|
||||
VIR_FREE(devices);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -4961,11 +4953,10 @@ remoteDispatchConnectListAllNWFilters(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||
cleanup:
|
||||
if (rv < 0)
|
||||
virNetMessageSaveError(rerr);
|
||||
if (filters && nfilters > 0) {
|
||||
if (filters && nfilters > 0)
|
||||
for (i = 0; i < nfilters; i++)
|
||||
virObjectUnref(filters[i]);
|
||||
VIR_FREE(filters);
|
||||
}
|
||||
VIR_FREE(filters);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -5020,11 +5011,10 @@ remoteDispatchConnectListAllSecrets(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||
cleanup:
|
||||
if (rv < 0)
|
||||
virNetMessageSaveError(rerr);
|
||||
if (secrets && nsecrets > 0) {
|
||||
if (secrets && nsecrets > 0)
|
||||
for (i = 0; i < nsecrets; i++)
|
||||
virObjectUnref(secrets[i]);
|
||||
VIR_FREE(secrets);
|
||||
}
|
||||
VIR_FREE(secrets);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -6192,11 +6182,10 @@ remoteDispatchNetworkGetDHCPLeases(virNetServerPtr server ATTRIBUTE_UNUSED,
|
||||
cleanup:
|
||||
if (rv < 0)
|
||||
virNetMessageSaveError(rerr);
|
||||
if (leases && nleases > 0) {
|
||||
if (leases && nleases > 0)
|
||||
for (i = 0; i < nleases; i++)
|
||||
virNetworkDHCPLeaseFree(leases[i]);
|
||||
VIR_FREE(leases);
|
||||
}
|
||||
VIR_FREE(leases);
|
||||
virObjectUnref(net);
|
||||
return rv;
|
||||
}
|
||||
|
@@ -24,6 +24,13 @@ AC_DEFUN([LIBVIRT_CHECK_UDEV],[
|
||||
if test "$with_udev" = "yes" && test "$with_pciaccess" != "yes" ; then
|
||||
AC_MSG_ERROR([You must install the pciaccess module to build with udev])
|
||||
fi
|
||||
|
||||
if test "$with_udev" = "yes" ; then
|
||||
PKG_CHECK_EXISTS([libudev >= 218], [with_udev_logging=no], [with_udev_logging=yes])
|
||||
if test "$with_udev_logging" = "yes" ; then
|
||||
AC_DEFINE_UNQUOTED([HAVE_UDEV_LOGGING], 1, [whether libudev logging can be used])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([LIBVIRT_RESULT_UDEV],[
|
||||
|
@@ -158,6 +158,7 @@ virCPUDefCopy(const virCPUDef *cpu)
|
||||
|
||||
for (i = 0; i < cpu->ncells; i++) {
|
||||
copy->cells[i].mem = cpu->cells[i].mem;
|
||||
copy->cells[i].memAccess = cpu->cells[i].memAccess;
|
||||
|
||||
copy->cells[i].cpumask = virBitmapNewCopy(cpu->cells[i].cpumask);
|
||||
|
||||
|
@@ -805,7 +805,7 @@ typedef struct {
|
||||
|
||||
static const virLXCBasicMountInfo lxcBasicMounts[] = {
|
||||
{ "proc", "/proc", "proc", MS_NOSUID|MS_NOEXEC|MS_NODEV, false, false, false },
|
||||
{ "/proc/sys", "/proc/sys", NULL, MS_BIND|MS_RDONLY, false, false, false },
|
||||
{ "/proc/sys", "/proc/sys", NULL, MS_BIND|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false, false, false },
|
||||
{ "/.oldroot/proc/sys/net/ipv4", "/proc/sys/net/ipv4", NULL, MS_BIND, false, false, true },
|
||||
{ "/.oldroot/proc/sys/net/ipv6", "/proc/sys/net/ipv6", NULL, MS_BIND, false, false, true },
|
||||
{ "sysfs", "/sys", "sysfs", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false, false, false },
|
||||
@@ -985,7 +985,7 @@ static int lxcContainerMountBasicFS(bool userns_enabled,
|
||||
|
||||
if (bindOverReadonly &&
|
||||
mount(mnt_src, mnt->dst, NULL,
|
||||
MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) < 0) {
|
||||
MS_BIND|MS_REMOUNT|mnt_mflags|MS_RDONLY, NULL) < 0) {
|
||||
virReportSystemError(errno,
|
||||
_("Failed to re-mount %s on %s flags=%x"),
|
||||
mnt_src, mnt->dst,
|
||||
|
@@ -585,7 +585,7 @@ static int lxcDomainGetInfo(virDomainPtr dom,
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
info->cpuTime = 0;
|
||||
info->memory = 0;
|
||||
info->memory = vm->def->mem.cur_balloon;
|
||||
} else {
|
||||
if (virCgroupGetCpuacctUsage(priv->cgroup, &(info->cpuTime)) < 0) {
|
||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||
|
@@ -340,7 +340,7 @@ static int udevGenerateDeviceName(struct udev_device *device,
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_UDEV_LOGGING
|
||||
typedef void (*udevLogFunctionPtr)(struct udev *udev,
|
||||
int priority,
|
||||
const char *file,
|
||||
@@ -373,6 +373,7 @@ udevLogFunction(struct udev *udev ATTRIBUTE_UNUSED,
|
||||
|
||||
VIR_FREE(format);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static int udevTranslatePCIIds(unsigned int vendor,
|
||||
@@ -1759,8 +1760,10 @@ static int nodeStateInitialize(bool privileged,
|
||||
* its return value.
|
||||
*/
|
||||
udev = udev_new();
|
||||
#if HAVE_UDEV_LOGGING
|
||||
/* cast to get rid of missing-format-attribute warning */
|
||||
udev_set_log_fn(udev, (udevLogFunctionPtr) udevLogFunction);
|
||||
#endif
|
||||
|
||||
priv->udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
|
||||
if (priv->udev_monitor == NULL) {
|
||||
|
@@ -2653,7 +2653,7 @@ static int qemuDomainGetInfo(virDomainPtr dom,
|
||||
info->memory = vm->def->mem.cur_balloon;
|
||||
}
|
||||
} else {
|
||||
info->memory = 0;
|
||||
info->memory = vm->def->mem.cur_balloon;
|
||||
}
|
||||
|
||||
info->nrVirtCpu = vm->def->vcpus;
|
||||
@@ -6051,7 +6051,7 @@ qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path,
|
||||
if (fd < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainSaveImageGetXMLDescEnsureACL(conn, def) < 0)
|
||||
if (virDomainSaveImageGetXMLDescEnsureACL(conn, def, flags) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = qemuDomainDefFormatXML(driver, def, flags);
|
||||
@@ -14404,7 +14404,7 @@ qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
|
||||
if (!(vm = qemuDomObjFromSnapshot(snapshot)))
|
||||
return NULL;
|
||||
|
||||
if (virDomainSnapshotGetXMLDescEnsureACL(snapshot->domain->conn, vm->def) < 0)
|
||||
if (virDomainSnapshotGetXMLDescEnsureACL(snapshot->domain->conn, vm->def, flags) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(snap = qemuSnapObjFromSnapshot(vm, snapshot)))
|
||||
|
@@ -3555,6 +3555,7 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
||||
time_t now = time(NULL);
|
||||
char expire_time [64];
|
||||
const char *connected = NULL;
|
||||
const char *password;
|
||||
int ret = -1;
|
||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||
|
||||
@@ -3562,16 +3563,14 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
password = auth->passwd ? auth->passwd : defaultPasswd;
|
||||
|
||||
if (auth->connected)
|
||||
connected = virDomainGraphicsAuthConnectedTypeToString(auth->connected);
|
||||
|
||||
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
|
||||
goto cleanup;
|
||||
ret = qemuMonitorSetPassword(priv->mon,
|
||||
type,
|
||||
auth->passwd ? auth->passwd : defaultPasswd,
|
||||
connected);
|
||||
ret = qemuMonitorSetPassword(priv->mon, type, password, connected);
|
||||
|
||||
if (ret == -2) {
|
||||
if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
||||
@@ -3579,14 +3578,15 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
||||
_("Graphics password only supported for VNC"));
|
||||
ret = -1;
|
||||
} else {
|
||||
ret = qemuMonitorSetVNCPassword(priv->mon,
|
||||
auth->passwd ? auth->passwd : defaultPasswd);
|
||||
ret = qemuMonitorSetVNCPassword(priv->mon, password);
|
||||
}
|
||||
}
|
||||
if (ret != 0)
|
||||
goto end_job;
|
||||
|
||||
if (auth->expires) {
|
||||
if (password[0] == '\0') {
|
||||
snprintf(expire_time, sizeof(expire_time), "now");
|
||||
} else if (auth->expires) {
|
||||
time_t lifetime = auth->validTo - now;
|
||||
if (lifetime <= 0)
|
||||
snprintf(expire_time, sizeof(expire_time), "now");
|
||||
|
@@ -540,10 +540,6 @@ remoteClientCloseFunc(virNetClientPtr client ATTRIBUTE_UNUSED,
|
||||
cbdata->freeCallback = NULL;
|
||||
}
|
||||
virObjectUnlock(cbdata);
|
||||
|
||||
/* free the connection reference that comes along with the callback
|
||||
* registration */
|
||||
virObjectUnref(cbdata->conn);
|
||||
}
|
||||
|
||||
/* helper macro to ease extraction of arguments from the URI */
|
||||
|
@@ -4480,6 +4480,7 @@ enum remote_procedure {
|
||||
* @generate: both
|
||||
* @priority: high
|
||||
* @acl: domain:read
|
||||
* @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE
|
||||
*/
|
||||
REMOTE_PROC_DOMAIN_SNAPSHOT_GET_XML_DESC = 186,
|
||||
|
||||
@@ -4810,6 +4811,7 @@ enum remote_procedure {
|
||||
* @generate: both
|
||||
* @priority: high
|
||||
* @acl: domain:read
|
||||
* @acl: domain:read_secure:VIR_DOMAIN_XML_SECURE
|
||||
*/
|
||||
REMOTE_PROC_DOMAIN_SAVE_IMAGE_GET_XML_DESC = 235,
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* storage_backend_fs.c: storage backend for FS and directory handling
|
||||
*
|
||||
* Copyright (C) 2007-2014 Red Hat, Inc.
|
||||
* Copyright (C) 2007-2015 Red Hat, Inc.
|
||||
* Copyright (C) 2007-2008 Daniel P. Berrange
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
@@ -1003,6 +1003,14 @@ virStorageBackendFileSystemVolCreate(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||
|
||||
vol->type = VIR_STORAGE_VOL_FILE;
|
||||
|
||||
/* Volumes within a directory pools are not recursive; do not
|
||||
* allow escape to ../ or a subdir */
|
||||
if (strchr(vol->name, '/')) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||
_("volume name '%s' cannot contain '/'"), vol->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
VIR_FREE(vol->target.path);
|
||||
if (virAsprintf(&vol->target.path, "%s/%s",
|
||||
pool->def->target.path,
|
||||
|
Reference in New Issue
Block a user