mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-11-05 16:24:27 +03:00
Compare commits
12 Commits
v8.6.0-rc1
...
v1.2.12-ma
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
819c14190c | ||
|
|
b5ddfbc0fe | ||
|
|
56fe8df69f | ||
|
|
039372edd9 | ||
|
|
32eb2a5897 | ||
|
|
bd1a133fc8 | ||
|
|
34538870c7 | ||
|
|
c518518bd0 | ||
|
|
5e7b535238 | ||
|
|
0e1054a129 | ||
|
|
1021df2815 | ||
|
|
b89978d53d |
@@ -1609,11 +1609,10 @@ remoteDispatchConnectListAllDomains(virNetServerPtr server ATTRIBUTE_UNUSED,
|
|||||||
cleanup:
|
cleanup:
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
virNetMessageSaveError(rerr);
|
virNetMessageSaveError(rerr);
|
||||||
if (doms && ndomains > 0) {
|
if (doms && ndomains > 0)
|
||||||
for (i = 0; i < ndomains; i++)
|
for (i = 0; i < ndomains; i++)
|
||||||
virObjectUnref(doms[i]);
|
virObjectUnref(doms[i]);
|
||||||
VIR_FREE(doms);
|
VIR_FREE(doms);
|
||||||
}
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4533,11 +4532,10 @@ remoteDispatchDomainListAllSnapshots(virNetServerPtr server ATTRIBUTE_UNUSED,
|
|||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
virNetMessageSaveError(rerr);
|
virNetMessageSaveError(rerr);
|
||||||
virObjectUnref(dom);
|
virObjectUnref(dom);
|
||||||
if (snaps && nsnaps > 0) {
|
if (snaps && nsnaps > 0)
|
||||||
for (i = 0; i < nsnaps; i++)
|
for (i = 0; i < nsnaps; i++)
|
||||||
virObjectUnref(snaps[i]);
|
virObjectUnref(snaps[i]);
|
||||||
VIR_FREE(snaps);
|
VIR_FREE(snaps);
|
||||||
}
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4602,11 +4600,10 @@ remoteDispatchDomainSnapshotListAllChildren(virNetServerPtr server ATTRIBUTE_UNU
|
|||||||
virNetMessageSaveError(rerr);
|
virNetMessageSaveError(rerr);
|
||||||
virObjectUnref(snapshot);
|
virObjectUnref(snapshot);
|
||||||
virObjectUnref(dom);
|
virObjectUnref(dom);
|
||||||
if (snaps && nsnaps > 0) {
|
if (snaps && nsnaps > 0)
|
||||||
for (i = 0; i < nsnaps; i++)
|
for (i = 0; i < nsnaps; i++)
|
||||||
virObjectUnref(snaps[i]);
|
virObjectUnref(snaps[i]);
|
||||||
VIR_FREE(snaps);
|
VIR_FREE(snaps);
|
||||||
}
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4661,11 +4658,10 @@ remoteDispatchConnectListAllStoragePools(virNetServerPtr server ATTRIBUTE_UNUSED
|
|||||||
cleanup:
|
cleanup:
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
virNetMessageSaveError(rerr);
|
virNetMessageSaveError(rerr);
|
||||||
if (pools && npools > 0) {
|
if (pools && npools > 0)
|
||||||
for (i = 0; i < npools; i++)
|
for (i = 0; i < npools; i++)
|
||||||
virObjectUnref(pools[i]);
|
virObjectUnref(pools[i]);
|
||||||
VIR_FREE(pools);
|
VIR_FREE(pools);
|
||||||
}
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4724,11 +4720,10 @@ remoteDispatchStoragePoolListAllVolumes(virNetServerPtr server ATTRIBUTE_UNUSED,
|
|||||||
cleanup:
|
cleanup:
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
virNetMessageSaveError(rerr);
|
virNetMessageSaveError(rerr);
|
||||||
if (vols && nvols > 0) {
|
if (vols && nvols > 0)
|
||||||
for (i = 0; i < nvols; i++)
|
for (i = 0; i < nvols; i++)
|
||||||
virObjectUnref(vols[i]);
|
virObjectUnref(vols[i]);
|
||||||
VIR_FREE(vols);
|
VIR_FREE(vols);
|
||||||
}
|
|
||||||
virObjectUnref(pool);
|
virObjectUnref(pool);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@@ -4784,11 +4779,10 @@ remoteDispatchConnectListAllNetworks(virNetServerPtr server ATTRIBUTE_UNUSED,
|
|||||||
cleanup:
|
cleanup:
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
virNetMessageSaveError(rerr);
|
virNetMessageSaveError(rerr);
|
||||||
if (nets && nnets > 0) {
|
if (nets && nnets > 0)
|
||||||
for (i = 0; i < nnets; i++)
|
for (i = 0; i < nnets; i++)
|
||||||
virObjectUnref(nets[i]);
|
virObjectUnref(nets[i]);
|
||||||
VIR_FREE(nets);
|
VIR_FREE(nets);
|
||||||
}
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4843,11 +4837,10 @@ remoteDispatchConnectListAllInterfaces(virNetServerPtr server ATTRIBUTE_UNUSED,
|
|||||||
cleanup:
|
cleanup:
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
virNetMessageSaveError(rerr);
|
virNetMessageSaveError(rerr);
|
||||||
if (ifaces && nifaces > 0) {
|
if (ifaces && nifaces > 0)
|
||||||
for (i = 0; i < nifaces; i++)
|
for (i = 0; i < nifaces; i++)
|
||||||
virObjectUnref(ifaces[i]);
|
virObjectUnref(ifaces[i]);
|
||||||
VIR_FREE(ifaces);
|
VIR_FREE(ifaces);
|
||||||
}
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4902,11 +4895,10 @@ remoteDispatchConnectListAllNodeDevices(virNetServerPtr server ATTRIBUTE_UNUSED,
|
|||||||
cleanup:
|
cleanup:
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
virNetMessageSaveError(rerr);
|
virNetMessageSaveError(rerr);
|
||||||
if (devices && ndevices > 0) {
|
if (devices && ndevices > 0)
|
||||||
for (i = 0; i < ndevices; i++)
|
for (i = 0; i < ndevices; i++)
|
||||||
virObjectUnref(devices[i]);
|
virObjectUnref(devices[i]);
|
||||||
VIR_FREE(devices);
|
VIR_FREE(devices);
|
||||||
}
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4961,11 +4953,10 @@ remoteDispatchConnectListAllNWFilters(virNetServerPtr server ATTRIBUTE_UNUSED,
|
|||||||
cleanup:
|
cleanup:
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
virNetMessageSaveError(rerr);
|
virNetMessageSaveError(rerr);
|
||||||
if (filters && nfilters > 0) {
|
if (filters && nfilters > 0)
|
||||||
for (i = 0; i < nfilters; i++)
|
for (i = 0; i < nfilters; i++)
|
||||||
virObjectUnref(filters[i]);
|
virObjectUnref(filters[i]);
|
||||||
VIR_FREE(filters);
|
VIR_FREE(filters);
|
||||||
}
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5020,11 +5011,10 @@ remoteDispatchConnectListAllSecrets(virNetServerPtr server ATTRIBUTE_UNUSED,
|
|||||||
cleanup:
|
cleanup:
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
virNetMessageSaveError(rerr);
|
virNetMessageSaveError(rerr);
|
||||||
if (secrets && nsecrets > 0) {
|
if (secrets && nsecrets > 0)
|
||||||
for (i = 0; i < nsecrets; i++)
|
for (i = 0; i < nsecrets; i++)
|
||||||
virObjectUnref(secrets[i]);
|
virObjectUnref(secrets[i]);
|
||||||
VIR_FREE(secrets);
|
VIR_FREE(secrets);
|
||||||
}
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6192,11 +6182,10 @@ remoteDispatchNetworkGetDHCPLeases(virNetServerPtr server ATTRIBUTE_UNUSED,
|
|||||||
cleanup:
|
cleanup:
|
||||||
if (rv < 0)
|
if (rv < 0)
|
||||||
virNetMessageSaveError(rerr);
|
virNetMessageSaveError(rerr);
|
||||||
if (leases && nleases > 0) {
|
if (leases && nleases > 0)
|
||||||
for (i = 0; i < nleases; i++)
|
for (i = 0; i < nleases; i++)
|
||||||
virNetworkDHCPLeaseFree(leases[i]);
|
virNetworkDHCPLeaseFree(leases[i]);
|
||||||
VIR_FREE(leases);
|
VIR_FREE(leases);
|
||||||
}
|
|
||||||
virObjectUnref(net);
|
virObjectUnref(net);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ virCPUDefCopy(const virCPUDef *cpu)
|
|||||||
|
|
||||||
for (i = 0; i < cpu->ncells; i++) {
|
for (i = 0; i < cpu->ncells; i++) {
|
||||||
copy->cells[i].mem = cpu->cells[i].mem;
|
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);
|
copy->cells[i].cpumask = virBitmapNewCopy(cpu->cells[i].cpumask);
|
||||||
|
|
||||||
|
|||||||
@@ -845,7 +845,7 @@ typedef struct {
|
|||||||
|
|
||||||
static const virLXCBasicMountInfo lxcBasicMounts[] = {
|
static const virLXCBasicMountInfo lxcBasicMounts[] = {
|
||||||
{ "proc", "/proc", "proc", MS_NOSUID|MS_NOEXEC|MS_NODEV, false, false, false },
|
{ "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/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 },
|
{ "/.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 },
|
{ "sysfs", "/sys", "sysfs", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_RDONLY, false, false, false },
|
||||||
@@ -1025,7 +1025,7 @@ static int lxcContainerMountBasicFS(bool userns_enabled,
|
|||||||
|
|
||||||
if (bindOverReadonly &&
|
if (bindOverReadonly &&
|
||||||
mount(mnt_src, mnt->dst, NULL,
|
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,
|
virReportSystemError(errno,
|
||||||
_("Failed to re-mount %s on %s flags=%x"),
|
_("Failed to re-mount %s on %s flags=%x"),
|
||||||
mnt_src, mnt->dst,
|
mnt_src, mnt->dst,
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ static int lxcDomainGetInfo(virDomainPtr dom,
|
|||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
info->cpuTime = 0;
|
info->cpuTime = 0;
|
||||||
info->memory = 0;
|
info->memory = vm->def->mem.cur_balloon;
|
||||||
} else {
|
} else {
|
||||||
if (virCgroupGetCpuacctUsage(priv->cgroup, &(info->cpuTime)) < 0) {
|
if (virCgroupGetCpuacctUsage(priv->cgroup, &(info->cpuTime)) < 0) {
|
||||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
|
|||||||
@@ -789,7 +789,7 @@ qemuInitCgroup(virQEMUDriverPtr driver,
|
|||||||
static void
|
static void
|
||||||
qemuRestoreCgroupState(virDomainObjPtr vm)
|
qemuRestoreCgroupState(virDomainObjPtr vm)
|
||||||
{
|
{
|
||||||
char *mem_mask;
|
char *mem_mask = NULL;
|
||||||
int empty = -1;
|
int empty = -1;
|
||||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||||
virBitmapPtr all_nodes;
|
virBitmapPtr all_nodes;
|
||||||
|
|||||||
@@ -1380,6 +1380,12 @@ qemuDomainHelperGetVcpus(virDomainObjPtr vm, virVcpuInfoPtr info, int maxinfo,
|
|||||||
if ((hostcpus = nodeGetCPUCount()) < 0)
|
if ((hostcpus = nodeGetCPUCount()) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (priv->vcpupids == NULL) {
|
||||||
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
|
"%s", _("cpu affinity is not supported"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
maxcpu = maplen * 8;
|
maxcpu = maplen * 8;
|
||||||
if (maxcpu > hostcpus)
|
if (maxcpu > hostcpus)
|
||||||
maxcpu = hostcpus;
|
maxcpu = hostcpus;
|
||||||
@@ -1395,8 +1401,7 @@ qemuDomainHelperGetVcpus(virDomainObjPtr vm, virVcpuInfoPtr info, int maxinfo,
|
|||||||
info[i].number = i;
|
info[i].number = i;
|
||||||
info[i].state = VIR_VCPU_RUNNING;
|
info[i].state = VIR_VCPU_RUNNING;
|
||||||
|
|
||||||
if (priv->vcpupids != NULL &&
|
if (qemuGetProcessInfo(&(info[i].cpuTime),
|
||||||
qemuGetProcessInfo(&(info[i].cpuTime),
|
|
||||||
&(info[i].cpu),
|
&(info[i].cpu),
|
||||||
NULL,
|
NULL,
|
||||||
vm->pid,
|
vm->pid,
|
||||||
@@ -1410,28 +1415,22 @@ qemuDomainHelperGetVcpus(virDomainObjPtr vm, virVcpuInfoPtr info, int maxinfo,
|
|||||||
|
|
||||||
if (cpumaps != NULL) {
|
if (cpumaps != NULL) {
|
||||||
memset(cpumaps, 0, maplen * maxinfo);
|
memset(cpumaps, 0, maplen * maxinfo);
|
||||||
if (priv->vcpupids != NULL) {
|
for (v = 0; v < maxinfo; v++) {
|
||||||
for (v = 0; v < maxinfo; v++) {
|
unsigned char *cpumap = VIR_GET_CPUMAP(cpumaps, maplen, v);
|
||||||
unsigned char *cpumap = VIR_GET_CPUMAP(cpumaps, maplen, v);
|
virBitmapPtr map = NULL;
|
||||||
virBitmapPtr map = NULL;
|
unsigned char *tmpmap = NULL;
|
||||||
unsigned char *tmpmap = NULL;
|
int tmpmapLen = 0;
|
||||||
int tmpmapLen = 0;
|
|
||||||
|
|
||||||
if (virProcessGetAffinity(priv->vcpupids[v],
|
if (virProcessGetAffinity(priv->vcpupids[v],
|
||||||
&map, maxcpu) < 0)
|
&map, maxcpu) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
virBitmapToData(map, &tmpmap, &tmpmapLen);
|
virBitmapToData(map, &tmpmap, &tmpmapLen);
|
||||||
if (tmpmapLen > maplen)
|
if (tmpmapLen > maplen)
|
||||||
tmpmapLen = maplen;
|
tmpmapLen = maplen;
|
||||||
memcpy(cpumap, tmpmap, tmpmapLen);
|
memcpy(cpumap, tmpmap, tmpmapLen);
|
||||||
|
|
||||||
VIR_FREE(tmpmap);
|
VIR_FREE(tmpmap);
|
||||||
virBitmapFree(map);
|
virBitmapFree(map);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
|
||||||
"%s", _("cpu affinity is not available"));
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2630,7 +2629,7 @@ static int qemuDomainGetInfo(virDomainPtr dom,
|
|||||||
info->memory = vm->def->mem.cur_balloon;
|
info->memory = vm->def->mem.cur_balloon;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
info->memory = 0;
|
info->memory = vm->def->mem.cur_balloon;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->nrVirtCpu = vm->def->vcpus;
|
info->nrVirtCpu = vm->def->vcpus;
|
||||||
@@ -4605,13 +4604,13 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
|||||||
|
|
||||||
if (flags & VIR_DOMAIN_AFFECT_LIVE && !(flags & VIR_DOMAIN_VCPU_GUEST)) {
|
if (flags & VIR_DOMAIN_AFFECT_LIVE && !(flags & VIR_DOMAIN_VCPU_GUEST)) {
|
||||||
if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_temp) < 0)
|
if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_temp) < 0)
|
||||||
goto cleanup;
|
goto endjob;
|
||||||
|
|
||||||
if (!(all_nodes = virNumaGetHostNodeset()))
|
if (!(all_nodes = virNumaGetHostNodeset()))
|
||||||
goto cleanup;
|
goto endjob;
|
||||||
|
|
||||||
if (!(all_nodes_str = virBitmapFormat(all_nodes)))
|
if (!(all_nodes_str = virBitmapFormat(all_nodes)))
|
||||||
goto cleanup;
|
goto endjob;
|
||||||
|
|
||||||
if (virCgroupGetCpusetMems(cgroup_temp, &mem_mask) < 0 ||
|
if (virCgroupGetCpusetMems(cgroup_temp, &mem_mask) < 0 ||
|
||||||
virCgroupSetCpusetMems(cgroup_temp, all_nodes_str) < 0)
|
virCgroupSetCpusetMems(cgroup_temp, all_nodes_str) < 0)
|
||||||
|
|||||||
@@ -3624,6 +3624,7 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
|||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
char expire_time [64];
|
char expire_time [64];
|
||||||
const char *connected = NULL;
|
const char *connected = NULL;
|
||||||
|
const char *password;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||||
|
|
||||||
@@ -3631,16 +3632,14 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
password = auth->passwd ? auth->passwd : defaultPasswd;
|
||||||
|
|
||||||
if (auth->connected)
|
if (auth->connected)
|
||||||
connected = virDomainGraphicsAuthConnectedTypeToString(auth->connected);
|
connected = virDomainGraphicsAuthConnectedTypeToString(auth->connected);
|
||||||
|
|
||||||
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
|
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
ret = qemuMonitorSetPassword(priv->mon,
|
ret = qemuMonitorSetPassword(priv->mon, type, password, connected);
|
||||||
type,
|
|
||||||
auth->passwd ? auth->passwd : defaultPasswd,
|
|
||||||
connected);
|
|
||||||
|
|
||||||
if (ret == -2) {
|
if (ret == -2) {
|
||||||
if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
||||||
@@ -3648,14 +3647,15 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
|
|||||||
_("Graphics password only supported for VNC"));
|
_("Graphics password only supported for VNC"));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
} else {
|
} else {
|
||||||
ret = qemuMonitorSetVNCPassword(priv->mon,
|
ret = qemuMonitorSetVNCPassword(priv->mon, password);
|
||||||
auth->passwd ? auth->passwd : defaultPasswd);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
goto end_job;
|
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;
|
time_t lifetime = auth->validTo - now;
|
||||||
if (lifetime <= 0)
|
if (lifetime <= 0)
|
||||||
snprintf(expire_time, sizeof(expire_time), "now");
|
snprintf(expire_time, sizeof(expire_time), "now");
|
||||||
|
|||||||
@@ -2498,9 +2498,18 @@ qemuProcessSetVcpuAffinities(virDomainObjPtr vm)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (priv->vcpupids == NULL) {
|
if (priv->vcpupids == NULL) {
|
||||||
virReportError(VIR_ERR_OPERATION_INVALID,
|
/* If any CPU has custom affinity that differs from the
|
||||||
"%s", _("cpu affinity is not supported"));
|
* VM default affinity, we must reject it
|
||||||
return -1;
|
*/
|
||||||
|
for (n = 0; n < def->vcpus; n++) {
|
||||||
|
if (!virBitmapEqual(def->cpumask,
|
||||||
|
def->cputune.vcpupin[n]->cpumask)) {
|
||||||
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
|
"%s", _("cpu affinity is not supported"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (n = 0; n < def->vcpus; n++) {
|
for (n = 0; n < def->vcpus; n++) {
|
||||||
|
|||||||
@@ -540,10 +540,6 @@ remoteClientCloseFunc(virNetClientPtr client ATTRIBUTE_UNUSED,
|
|||||||
cbdata->freeCallback = NULL;
|
cbdata->freeCallback = NULL;
|
||||||
}
|
}
|
||||||
virObjectUnlock(cbdata);
|
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 */
|
/* helper macro to ease extraction of arguments from the URI */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* storage_backend_fs.c: storage backend for FS and directory handling
|
* 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
|
* Copyright (C) 2007-2008 Daniel P. Berrange
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* 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;
|
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);
|
VIR_FREE(vol->target.path);
|
||||||
if (virAsprintf(&vol->target.path, "%s/%s",
|
if (virAsprintf(&vol->target.path, "%s/%s",
|
||||||
pool->def->target.path,
|
pool->def->target.path,
|
||||||
|
|||||||
@@ -504,6 +504,12 @@ bool virBitmapEqual(virBitmapPtr b1, virBitmapPtr b2)
|
|||||||
virBitmapPtr tmp;
|
virBitmapPtr tmp;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
if (!b1 && !b2)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (!b1 || !b2)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (b1->max_bit > b2->max_bit) {
|
if (b1->max_bit > b2->max_bit) {
|
||||||
tmp = b1;
|
tmp = b1;
|
||||||
b1 = b2;
|
b1 = b2;
|
||||||
|
|||||||
@@ -84,8 +84,7 @@ virBitmapPtr virBitmapNewData(void *data, int len) ATTRIBUTE_NONNULL(1);
|
|||||||
int virBitmapToData(virBitmapPtr bitmap, unsigned char **data, int *dataLen)
|
int virBitmapToData(virBitmapPtr bitmap, unsigned char **data, int *dataLen)
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
bool virBitmapEqual(virBitmapPtr b1, virBitmapPtr b2)
|
bool virBitmapEqual(virBitmapPtr b1, virBitmapPtr b2);
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
||||||
|
|
||||||
size_t virBitmapSize(virBitmapPtr bitmap)
|
size_t virBitmapSize(virBitmapPtr bitmap)
|
||||||
ATTRIBUTE_NONNULL(1);
|
ATTRIBUTE_NONNULL(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user