On Wed, Jan 23, 2013 at 11:12:35AM +0100, Peter Krempa wrote:
On 01/23/13 11:04, Daniel P. Berrange wrote:
>>diff --git a/src/test/test_driver.c b/src/test/test_driver.c
>>index 6909fa4..038f627 100644
>>--- a/src/test/test_driver.c
>>+++ b/src/test/test_driver.c
>>@@ -559,6 +559,9 @@ static int testOpenDefault(virConnectPtr conn) {
>> }
>> for (u = 0 ; u < 16 ; u++) {
>> privconn->cells[u % 2].cpus[(u / 2)].id = u;
>>+ privconn->cells[u % 2].cpus[(u / 2)].socket_id = -1;
>>+ privconn->cells[u % 2].cpus[(u / 2)].core_id = -1;
>>+ privconn->cells[u % 2].cpus[(u / 2)].siblings = NULL;
>> }
>
>This is wrong because these fields are unsigned int.
Hm, yeah, I forgot to update this. Anyways, the data doesn't pose
problem here as the output isn't enhanced until siblings is
non-NULL.
This code gets fixed in 7/7.
In that case you can delete this entire chunk - VIR_ALLOC
ensures everything is initialized to 0, so the "= NULL" is
not doing anything
>
>>diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
>>index 57d8325..434f558 100644
>>--- a/src/xen/xend_internal.c
>>+++ b/src/xen/xend_internal.c
>>@@ -1161,6 +1161,7 @@ sexpr_to_xend_topology(const struct sexpr *root,
>> ignore_value(virBitmapGetBit(cpuset, cpu, &used));
>> if (used) {
>> cpuInfo[n].id = cpu;
>>+ cpuInfo[n].siblings = NULL;
>
>As mentioned before, this should be initializing based on the nodeinfo.
>Here you've allowed socket_id + core_id to all initialize to 0 which
>is wrong.
Also here, the siblings are NULL so the new output isn't used at
all. I added the condition so that the new code could be avoided
until I prepare means to test the XEN support.
Again this initialization to NULL is redundant
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|