[libvirt] [PATCH] look for numad in /usr/sbin
by Jim Fehlig
When looking for numad with AC_PATH_PROG, include /usr/sbin in
the search path.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 4942e07..f494f46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1454,7 +1454,7 @@ AC_ARG_WITH([numad],
if test "$with_numad" != "no" ; then
fail=0
- AC_PATH_PROG([NUMAD], [numad], [], [/bin:/usr/bin])
+ AC_PATH_PROG([NUMAD], [numad], [], [/bin:/usr/bin:/usr/sbin])
if test "$with_numad" = "check"; then
test "$with_numactl" = "yes" || fail=1
--
1.8.0.1
11 years
[libvirt] [test-API][PATCH V2] Modify previous test cases by invoking api
by Jincheng Miao
* repos/domain/blkstats.py
* repos/domain/domain_blkinfo.py
Function blkstats and domain_blkinfo used virsh commands to test result,
that is not fit for testing api, so I replace commands with invoking api.
V1->V2:
Removed blockdev params for domain_blkinfo, this hard code disk device is
not convenient for users.
---
repos/domain/blkstats.py | 2 -
repos/domain/domain_blkinfo.py | 94 ++++++++++++++++++++++++------------------
2 files changed, 55 insertions(+), 41 deletions(-)
diff --git a/repos/domain/blkstats.py b/repos/domain/blkstats.py
index 0254922..27c2a46 100644
--- a/repos/domain/blkstats.py
+++ b/repos/domain/blkstats.py
@@ -1,8 +1,6 @@
#!/usr/bin/evn python
# To test domain block device statistics
-import os
-import sys
import time
import libxml2
diff --git a/repos/domain/domain_blkinfo.py b/repos/domain/domain_blkinfo.py
index b6051aa..81035ed 100644
--- a/repos/domain/domain_blkinfo.py
+++ b/repos/domain/domain_blkinfo.py
@@ -1,22 +1,17 @@
#!/usr/bin/env python
-# To test "virsh domblkinfo" command
+# To test domain's blockkinfo API
-import os
-import sys
-import re
import commands
-
+import libxml2
import libvirt
from libvirt import libvirtError
from src import sharedmod
-GET_DOMBLKINFO_MAC = "virsh domblkinfo %s %s | awk '{print $2}'"
GET_CAPACITY = "du -b %s | awk '{print $1}'"
GET_PHYSICAL_K = " du -B K %s | awk '{print $1}'"
-VIRSH_DOMBLKINFO = "virsh domblkinfo %s %s"
-required_params = ('guestname', 'blockdev',)
+required_params = ('guestname', )
optional_params = {}
def get_output(command, logger):
@@ -32,8 +27,8 @@ def check_domain_exists(conn, guestname, logger):
""" check if the domain exists, may or may not be active """
guest_names = []
ids = conn.listDomainsID()
- for id in ids:
- obj = conn.lookupByID(id)
+ for domain_id in ids:
+ obj = conn.lookupByID(domain_id)
guest_names.append(obj.name())
guest_names += conn.listDefinedDomains()
@@ -44,17 +39,27 @@ def check_domain_exists(conn, guestname, logger):
else:
return True
+def check_guest_status(domobj):
+ """Check guest current status"""
+ state = domobj.info()[0]
+ if state == libvirt.VIR_DOMAIN_SHUTOFF or \
+ state == libvirt.VIR_DOMAIN_SHUTDOWN:
+ # add check function
+ return False
+ else:
+ return True
+
def check_block_data(blockdev, blkdata, logger):
""" check data about capacity,allocation,physical """
status, apparent_size = get_output(GET_CAPACITY % blockdev, logger)
if not status:
- if apparent_size == blkdata[0]:
- logger.info("the capacity of '%s' is %s, checking succeeded" % \
- (blockdev, apparent_size))
+ if apparent_size == str(blkdata[0]):
+ logger.info("the capacity of '%s' is %s, checking succeeded"
+ % (blockdev, apparent_size))
else:
- logger.error("apparent-size from 'du' is %s, \n\
- but from 'domblkinfo' is %s, checking failed" % \
- (apparent_size, blkdata[0]))
+ logger.error("apparent-size from 'du' is %s" % apparent_size)
+ logger.error("but from 'domain blockinfo' is %d, checking failed"
+ % blkdata[0])
return 1
else:
return 1
@@ -64,14 +69,15 @@ def check_block_data(blockdev, blkdata, logger):
block_size_b = int(block_size_k[:-1]) * 1024
# Temporarily, we only test the default case, assuming
# Allocation value is equal to Physical value
- if str(block_size_b) == blkdata[1] and str(block_size_b) == blkdata[2]:
- logger.info("the block size of '%s' is %s, same with \n\
- Allocation and Physical value, checking succeeded" % \
- (blockdev, block_size_b))
+ if block_size_b == blkdata[1] and block_size_b == blkdata[2]:
+ logger.info("the block size of '%s' is %s"
+ % (blockdev, block_size_b))
+ logger.info("Allocation and Physical value's checking succeeded")
else:
- logger.error("the block size from 'du' is %s, \n\
- the Allocation value is %s, Physical value is %s, \n\
- checking failed" % (block_size_b, blkdata[1], blkdata[2]))
+ logger.error("the block size from 'du' is %d" % block_size_b)
+ logger.error("the Allocation value is %d, Physical value is %d"
+ % (blkdata[1], blkdata[2]))
+ logger.error("checking failed")
return 1
return 0
@@ -79,14 +85,12 @@ def check_block_data(blockdev, blkdata, logger):
def domain_blkinfo(params):
""" using du command to check the data
- in the output of virsh domblkinfo
+ in the output of API blockinfo
"""
logger = params['logger']
guestname = params.get('guestname')
- blockdev = params.get('blockdev')
logger.info("the name of guest is %s" % guestname)
- logger.info("the block device is %s" % blockdev)
conn = sharedmod.libvirtobj['conn']
@@ -94,23 +98,35 @@ def domain_blkinfo(params):
logger.error("need a defined guest")
return 1
- logger.info("the output of virsh domblkinfo is:")
- status, output = get_output(VIRSH_DOMBLKINFO % (guestname, blockdev), logger)
- if not status:
- logger.info("\n" + output)
- else:
+ domobj = conn.lookupByName(guestname)
+
+ xml = domobj.XMLDesc(0)
+ doc = libxml2.parseDoc(xml)
+ cont = doc.xpathNewContext()
+ vdevs = cont.xpathEval("/domain/devices/disk/source/@file")
+ blockdev = vdevs[0].content
+ logger.info("the block device is %s" % blockdev)
+
+ if not check_guest_status(domobj):
+ logger.error("guest is not started.")
return 1
- status, data_str = get_output(GET_DOMBLKINFO_MAC % (guestname, blockdev), logger)
- if not status:
- blkdata = data_str.rstrip().split('\n')
- logger.info("capacity,allocation,physical list: %s" % blkdata)
- else:
+ try:
+ logger.info("the output of domain blockinfo is:")
+ block_info = domobj.blockInfo(blockdev, 0)
+ logger.info("Capacity : %d " % block_info[0])
+ logger.info("Allocation: %d " % block_info[1])
+ logger.info("Physical : %d " % block_info[2])
+
+ except libvirtError, e:
+ logger.error("API error message: %s, error code is %s"
+ % (e.message, e.get_error_code()))
return 1
- if check_block_data(blockdev, blkdata, logger):
- logger.error("checking domblkinfo data FAILED")
+ if check_block_data(blockdev, block_info, logger):
+ logger.error("checking domain blockinfo data FAILED")
return 1
else:
- logger.info("checking domblkinfo data SUCCEEDED")
+ logger.info("checking domain blockinfo data SUCCEEDED")
+
return 0
--
1.8.3.1
11 years
[libvirt] [PATCH] storage: don't read storage volumes in nonblock mode
by Eric Blake
Commit 348b4e2 introduced a potential problem (thankfully not
in any release): we are attempting to use virFileReadHeaderFD()
on a file that was opened with O_NONBLOCK. While this
shouldn't be a problem in practice (because O_NONBLOCK
typically doesn't affect regular or block files, and fifos and
sockets cannot be storage volumes), it's better to play it safe
to avoid races from opening an unexpected file type while also
avoiding problems with having to handle EAGAIN while read()ing.
Based on a report by Dan Berrange.
* src/storage/storage_backend.c
(virStorageBackendVolOpenCheckMode): Fix up fd after avoiding race.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
src/storage/storage_backend.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index 57c1728..bde39d6 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -1179,6 +1179,12 @@ virStorageBackendVolOpenCheckMode(const char *path, struct stat *sb,
return -2;
}
+ /* O_NONBLOCK should only matter during open() for fifos and
+ * sockets, which we already filtered; but using it prevents a
+ * TOCTTOU race. However, later on we will want to read() the
+ * header from this fd, and virFileRead* routines require a
+ * blocking fd, so fix it up after verifying we avoided a
+ * race. */
if ((fd = open(path, O_RDONLY|O_NONBLOCK|O_NOCTTY)) < 0) {
if ((errno == ENOENT || errno == ELOOP) &&
S_ISLNK(sb->st_mode)) {
@@ -1200,13 +1206,13 @@ virStorageBackendVolOpenCheckMode(const char *path, struct stat *sb,
return -1;
}
- if (S_ISREG(sb->st_mode))
+ if (S_ISREG(sb->st_mode)) {
mode = VIR_STORAGE_VOL_OPEN_REG;
- else if (S_ISCHR(sb->st_mode))
+ } else if (S_ISCHR(sb->st_mode)) {
mode = VIR_STORAGE_VOL_OPEN_CHAR;
- else if (S_ISBLK(sb->st_mode))
+ } else if (S_ISBLK(sb->st_mode)) {
mode = VIR_STORAGE_VOL_OPEN_BLOCK;
- else if (S_ISDIR(sb->st_mode)) {
+ } else if (S_ISDIR(sb->st_mode)) {
mode = VIR_STORAGE_VOL_OPEN_DIR;
if (STREQ(base, ".") ||
@@ -1215,6 +1221,17 @@ virStorageBackendVolOpenCheckMode(const char *path, struct stat *sb,
VIR_INFO("Skipping special dir '%s'", base);
return -2;
}
+ } else {
+ VIR_WARN("ignoring unexpected type for file '%s'", path);
+ VIR_FORCE_CLOSE(fd);
+ return -2;
+ }
+
+ if (virSetBlocking(fd, true) < 0) {
+ virReportSystemError(errno, _("unable to set blocking mode for '%s'"),
+ path);
+ VIR_FORCE_CLOSE(fd);
+ return -2;
}
if (!(mode & flags)) {
--
1.8.3.1
11 years
[libvirt] [libvirt-python] Call virGetLastError from mod rather than py wrapper
by Doug Goldstein
All other code always calls the methods from the mod rather than using
the python wrapper so this matches the state of all other callers.
---
libvirt-override.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt-override.py b/libvirt-override.py
index ccfec48..87996f8 100644
--- a/libvirt-override.py
+++ b/libvirt-override.py
@@ -20,7 +20,7 @@ class libvirtError(Exception):
# Never call virConnGetLastError().
# virGetLastError() is now thread local
- err = virGetLastError()
+ err = libvirtmod.virGetLastError()
if err is None:
msg = defmsg
else:
--
1.8.3.2
11 years
[libvirt] [PATCH python] Make block pull event dispatcher private
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The method dispatchDomainEventBlockPullCallback which is
used internally to dispatch block pull events to the python
application code was missing the leading '_', to denote that
it was private. All other event callback helpers have a
leading '_'. No application should have been using this so
it is justifiable to rename it.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
libvirt-override-virConnect.py | 2 +-
libvirt-override.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libvirt-override-virConnect.py b/libvirt-override-virConnect.py
index 4ba3d30..23fadfd 100644
--- a/libvirt-override-virConnect.py
+++ b/libvirt-override-virConnect.py
@@ -113,7 +113,7 @@
authScheme, subject, opaque)
return 0
- def dispatchDomainEventBlockPullCallback(self, dom, path, type, status, cbData):
+ def _dispatchDomainEventBlockPullCallback(self, dom, path, type, status, cbData):
"""Dispatches events to python user domain blockJob event callbacks
"""
try:
diff --git a/libvirt-override.c b/libvirt-override.c
index 4cc64b7..d3802de 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -5998,7 +5998,7 @@ libvirt_virConnectDomainEventBlockJobCallback(virConnectPtr conn ATTRIBUTE_UNUSE
/* Call the Callback Dispatcher */
pyobj_ret = PyObject_CallMethod(pyobj_conn,
- (char*)"dispatchDomainEventBlockPullCallback",
+ (char*)"_dispatchDomainEventBlockPullCallback",
(char*)"OsiiO",
pyobj_dom, path, type, status, pyobj_cbData);
--
1.8.3.1
11 years
[libvirt] [PATCH python] Don't include virDomainSnapshotRef in python API
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The reference counting API is for internal use only. Attempts
to use it from python application code will cause havoc.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
generator.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/generator.py b/generator.py
index ea5b8a1..c769ed0 100755
--- a/generator.py
+++ b/generator.py
@@ -517,7 +517,8 @@ skip_function = (
"virNWFilterRef",
"virStoragePoolRef",
"virStorageVolRef",
- 'virStreamRef',
+ "virStreamRef",
+ "virDomainSnapshotRef",
# This functions shouldn't be called via the bindings (and even the docs
# contain an explicit warning to that effect). The equivalent should be
--
1.8.3.1
11 years
[libvirt] [PATCH v2 1/2] LXC: fix the problem that libvirt lxc fail to start on latest kernel
by Gao feng
After kernel commit 5ff9d8a65ce80efb509ce4e8051394e9ed2cd942
vfs: Lock in place mounts from more privileged users,
unprivileged user has no rights to move the mounts that
inherited from parent mountns. we use this feature to move
the /stateDir/domain-name.{dev, devpts} to the /dev/ and
/dev/pts directroy of container. this commit breaks libvirt lxc.
this patch changes the behavior to bind these mounts when
user namespace is enabled and move these mounts when user
namespace is disabled.
Signed-off-by: Gao feng <gaofeng(a)cn.fujitsu.com>
---
src/lxc/lxc_container.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 2bdf957..3d9b491 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -958,6 +958,7 @@ static int lxcContainerMountFSDev(virDomainDefPtr def,
{
int ret = -1;
char *path = NULL;
+ int flags = def->idmap.nuidmap ? MS_BIND : MS_MOVE;
VIR_DEBUG("Mount /dev/ stateDir=%s", stateDir);
@@ -971,9 +972,10 @@ static int lxcContainerMountFSDev(virDomainDefPtr def,
goto cleanup;
}
- VIR_DEBUG("Trying to move %s to /dev", path);
+ VIR_DEBUG("Trying to %s %s to /dev", def->idmap.nuidmap ?
+ "bind" : "move", path);
- if (mount(path, "/dev", NULL, MS_MOVE, NULL) < 0) {
+ if (mount(path, "/dev", NULL, flags, NULL) < 0) {
virReportSystemError(errno,
_("Failed to mount %s on /dev"),
path);
@@ -992,6 +994,7 @@ static int lxcContainerMountFSDevPTS(virDomainDefPtr def,
{
int ret;
char *path = NULL;
+ int flags = def->idmap.nuidmap ? MS_BIND : MS_MOVE;
VIR_DEBUG("Mount /dev/pts stateDir=%s", stateDir);
@@ -1007,10 +1010,10 @@ static int lxcContainerMountFSDevPTS(virDomainDefPtr def,
goto cleanup;
}
- VIR_DEBUG("Trying to move %s to /dev/pts", path);
+ VIR_DEBUG("Trying to %s %s to /dev/pts", def->idmap.nuidmap ?
+ "bind" : "move", path);
- if ((ret = mount(path, "/dev/pts",
- NULL, MS_MOVE, NULL)) < 0) {
+ if ((ret = mount(path, "/dev/pts", NULL, flags, NULL)) < 0) {
virReportSystemError(errno,
_("Failed to mount %s on /dev/pts"),
path);
--
1.8.3.1
11 years
Re: [libvirt] [Qemu-devel] [PATCH] virtio-rng: correct the default limit rate
by Eric Blake
[adding libvirt]
On 11/26/2013 06:58 AM, Paolo Bonzini wrote:
> Il 26/11/2013 14:43, Amos Kong ha scritto:
>> /* Set a default rate limit of 2^47 bytes per minute or roughly 2TB/s. If
>> * you have an entropy source capable of generating more entropy than this
>> * and you can pass it through via virtio-rng, then hats off to you. Until
>> * then, this is unlimited for all practical purposes.
>> */
>>
>> But the current rate is (INT64_MAX) bytes per (1 << 16) ms, it's 128,000 TB/s
>
> You are changing:
>
> * max-bytes from 2^63 to 2^47
>
> * period from 65536 to 60000
>
> For a user, changing only period would have no effect, the limit rate
> would remain effectively infinite. Changing max-bytes would give a 7%
> higher rate after your patch.
>
> Not a big deal, and max-bytes is easier to explain after your patch
> (bytes/minute) than before (bytes/65536ms).
>
> Reviewed-by: Paolo Bonzini <pbonzini(a)redhat.com>
>
Hmm. Libvirt is already converting a user's rate of bytes/period into
the qemu parameters, defaulting to 1 second as its default period. Am I
correct that as long as libvirt specified both rate AND period, then
this change has no impact (and that the 7% change occurs if you specify
period while leaving max-bytes alone)? Or is this an ABI change where
libvirt will have to be taught to be smart enough to know whether it is
old qemu or new qemu to adjust how libvirt does its calculations when
converting the user's rate into qemu terms?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
11 years
[libvirt] [PATCH v2] Pin guest to memory node on NUMA system
by Shivaprasad G Bhat
Version 2:
Fixed the string formatting errors in v1.
Version 1:
The patch contains the fix for defect 1009880 reported at redhat bugzilla.
The root cause is, ever since the subcpusets(vcpu,emulator) were introduced, the paren cpuset cannot be modified to remove the nodes that are in use by the subcpusets.
The fix is to break the memory node modification into three steps as to assign new nodes into the parent first. Change the nodes in the child nodes. Then remove the old nodes on the parent node.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
---
src/qemu/qemu_driver.c | 129 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 129 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e8bc04d..2435b75 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8171,7 +8171,11 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
}
} else if (STREQ(param->field, VIR_DOMAIN_NUMA_NODESET)) {
virBitmapPtr nodeset = NULL;
+ virBitmapPtr old_nodeset = NULL;
+ virBitmapPtr temp_nodeset = NULL;
char *nodeset_str = NULL;
+ char *old_nodeset_str = NULL;
+ char *temp_nodeset_str = NULL;
if (virBitmapParse(params[i].value.s,
0, &nodeset,
@@ -8181,6 +8185,10 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
+ size_t j;
+ virCgroupPtr cgroup_vcpu = NULL;
+ virCgroupPtr cgroup_emulator = NULL;
+
if (vm->def->numatune.memory.mode !=
VIR_DOMAIN_NUMATUNE_MEM_STRICT) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
@@ -8200,7 +8208,128 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
continue;
}
+ if (virCgroupGetCpusetMems(priv->cgroup, &old_nodeset_str) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Failed to get current system nodeset values"));
+ virBitmapFree(nodeset);
+ VIR_FREE(nodeset_str);
+ ret = -1;
+ continue;
+ }
+
+ if (virBitmapParse(old_nodeset_str, 0, &old_nodeset,
+ VIR_DOMAIN_CPUMASK_LEN) < 0) {
+ virBitmapFree(nodeset);
+ VIR_FREE(nodeset_str);
+ VIR_FREE(old_nodeset_str);
+ ret = -1;
+ continue;
+ }
+
+ if ((temp_nodeset = virBitmapNewCopy(old_nodeset)) == NULL) {
+ virBitmapFree(nodeset);
+ VIR_FREE(nodeset_str);
+ virBitmapFree(old_nodeset);
+ VIR_FREE(old_nodeset_str);
+ ret = -1;
+ continue;
+ }
+ virBitmapFree(old_nodeset);
+ VIR_FREE(old_nodeset_str);
+
+ for (j = 0; j < caps->host.nnumaCell; j++) {
+ bool result;
+ if (virBitmapGetBit(nodeset, j, &result) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Failed to get cpuset bit values"));
+ ret = -1;
+ break;
+ }
+ if (result && (virBitmapSetBit(temp_nodeset, j) < 0)) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Failed to set temporary cpuset bit values"));
+ ret = -1;
+ break;
+ }
+ }
+
+ if (ret) {
+ virBitmapFree(nodeset);
+ VIR_FREE(nodeset_str);
+ virBitmapFree(temp_nodeset);
+ continue;
+ }
+
+ if (!(temp_nodeset_str = virBitmapFormat(temp_nodeset))) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Failed to format nodeset"));
+ virBitmapFree(nodeset);
+ VIR_FREE(nodeset_str);
+ virBitmapFree(temp_nodeset);
+ ret = -1;
+ continue;
+ }
+
+ if (virCgroupSetCpusetMems(priv->cgroup, temp_nodeset_str) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Failed to set cpuset values"));
+ virBitmapFree(nodeset);
+ VIR_FREE(nodeset_str);
+ virBitmapFree(temp_nodeset);
+ VIR_FREE(temp_nodeset_str);
+ ret = -1;
+ continue;
+ }
+
+ virBitmapFree(temp_nodeset);
+ VIR_FREE(temp_nodeset_str);
+
+ for (j = 0; j < priv->nvcpupids; j++) {
+ if (virCgroupNewVcpu(priv->cgroup, j, false, &cgroup_vcpu) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to get cpuset values for vcpu%zu"), j);
+ ret = -1;
+ break;
+ }
+ if (virCgroupSetCpusetMems(cgroup_vcpu, nodeset_str) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to set cpuset values for vcpu%zu"), j);
+ virCgroupFree(&cgroup_vcpu);
+ ret = -1;
+ break;
+ }
+ virCgroupFree(&cgroup_vcpu);
+ }
+
+ if (ret) {
+ virBitmapFree(nodeset);
+ VIR_FREE(nodeset_str);
+ continue;
+ }
+
+ if (virCgroupNewEmulator(priv->cgroup, false, &cgroup_emulator) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Failed to get cpuset values for emulator"));
+ virBitmapFree(nodeset);
+ VIR_FREE(nodeset_str);
+ ret = -1;
+ continue;
+ }
+
+ if (virCgroupSetCpusetMems(cgroup_emulator, nodeset_str) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Failed to set cpuset values for emulator"));
+ virBitmapFree(nodeset);
+ VIR_FREE(nodeset_str);
+ virCgroupFree(&cgroup_emulator);
+ ret = -1;
+ continue;
+ }
+ virCgroupFree(&cgroup_emulator);
+
if (virCgroupSetCpusetMems(priv->cgroup, nodeset_str) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Failed to set cpuset"));
virBitmapFree(nodeset);
VIR_FREE(nodeset_str);
ret = -1;
11 years
[libvirt] [libvirt-python PATCH] Make setup.py executable
by Martin Kletzander
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
setup.py | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 setup.py
diff --git a/setup.py b/setup.py
old mode 100644
new mode 100755
--
1.8.4.3
11 years