[libvirt] [PATCH v4 2/3] numatune: add check for numatune nodeset range

Martin Kletzander mkletzan at redhat.com
Tue Nov 4 06:11:21 UTC 2014


On Tue, Nov 04, 2014 at 01:57:52AM +0000, Chen, Fan wrote:
>On Mon, 2014-11-03 at 14:18 +0100, Martin Kletzander wrote:
>> On Thu, Oct 30, 2014 at 01:44:18PM +0800, Chen Fan wrote:
>> >diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c
>> >index bff3b0f..7218747 100644
>> >--- a/tests/qemuxml2argvmock.c
>> >+++ b/tests/qemuxml2argvmock.c
>> >@@ -21,6 +21,7 @@
>> > #include <config.h>
>> >
>> > #include "internal.h"
>> >+#include "virnuma.h"
>> > #include <time.h>
>> >
>> > time_t time(time_t *t)
>> >@@ -30,3 +31,11 @@ time_t time(time_t *t)
>> >         *t = ret;
>> >     return ret;
>> > }
>> >+
>> >+int
>> >+virNumaGetMaxNode(void)
>> >+{
>> >+   const int maxnodesNum = 7;
>> >+
>> >+   return maxnodesNum;
>> >+}
>>
>> Why not just "return 7;" ???
>
>I just think magic number may be not proper.
>

Probably a matter of taste, I'd use a comment in that case, but proper
compiler should optimize it even without that const, so no problem
here ;)

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141104/10f390d3/attachment-0001.sig>


More information about the libvir-list mailing list