Index: src/xend_internal.c =================================================================== RCS file: /data/cvs/libvirt/src/xend_internal.c,v retrieving revision 1.261 diff -u -r1.261 xend_internal.c --- src/xend_internal.c 7 May 2009 07:27:49 -0000 1.261 +++ src/xend_internal.c 8 May 2009 09:41:42 -0000 @@ -3765,6 +3765,13 @@ * @maplen: length of cpumap in bytes * * Dynamically change the real CPUs which can be allocated to a virtual CPU. + * TODO: When we use libvirt, + * the XenD cpu affinity works on after cset 19579. + * But we cannot detect the XenD version precisely. + * This is because XenD does not have precise version info I/F. + * We need to request precise XenD version detection I/F + * to the Xen community. + * After that, we need to discriminate the XenD version. * * Returns 0 for success; -1 (with errno) on error */ @@ -3772,7 +3779,7 @@ xenDaemonDomainPinVcpu(virDomainPtr domain, unsigned int vcpu, unsigned char *cpumap, int maplen) { - char buf[VIR_UUID_BUFLEN], mapstr[sizeof(cpumap_t) * 64] = "["; + char buf[VIR_UUID_BUFLEN], mapstr[sizeof(cpumap_t) * 64] = ""; int i, j; if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL) @@ -3788,7 +3795,7 @@ snprintf(buf, sizeof(buf), "%d,", (8 * i) + j); strcat(mapstr, buf); } - mapstr[strlen(mapstr) - 1] = ']'; + mapstr[strlen(mapstr) - 1] = '\0'; snprintf(buf, sizeof(buf), "%d", vcpu); return(xend_op(domain->conn, domain->name, "op", "pincpu", "vcpu", buf, "cpumap", mapstr, NULL));