Univention Bugzilla – Attachment 9769 Details for
Bug 48268
Show CPU over-commitment in UVMM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH libvirt-python] virNodeInfo.memory is in KiB
0001-virNodeInfo.memory-is-in-KiB.patch (text/plain), 1.83 KB, created by
Philipp Hahn
on 2018-12-05 13:08 CET
(
hide
)
Description:
[PATCH libvirt-python] virNodeInfo.memory is in KiB
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2018-12-05 13:08 CET
Size:
1.83 KB
patch
obsolete
>From f8c60e0a444509939f1e53b7b9ad7745d3cf553e Mon Sep 17 00:00:00 2001 >Message-Id: <f8c60e0a444509939f1e53b7b9ad7745d3cf553e.1544011212.git.hahn@univention.de> >From: Philipp Hahn <hahn@univention.de> >Date: Wed, 5 Dec 2018 12:55:42 +0100 >Subject: [PATCH libvirt-python] virNodeInfo.memory is in KiB >To: libvir-list@redhat.com >Cc: Michal Privoznik <mprivozn@redhat.com>, > Daniel Veillard <veillard@redhat.com> > >but the Python library does an extra left shift of 10 bits returning MiB >instead: > >> # cat y.c >> #include <stdlib.h> >> #include <stdio.h> >> #include <libvirt.h> >> int main(void) { >> virConnectPtr conn = virConnectOpen("qemu:///system"); >> virNodeInfo info; >> int rv = virNodeGetInfo(conn, &info); >> printf("%ld\n", info.memory); >> return rv; >> } >> # gcc y.c -I/usr/include/libvirt -lvirt >> # ./a.out >> 4041088 > >> # python -c 'import libvirt;c=libvirt.open("qemu:///system");print(c.getInfo()[1])' >> 3946 > >Fixes: 197153c6 >Signed-off-by: Philipp Hahn <hahn@univention.de> >--- > libvirt-override.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/libvirt-override.c b/libvirt-override.c >index f7b2f6b..616fa1c 100644 >--- a/libvirt-override.c >+++ b/libvirt-override.c >@@ -2740,7 +2740,7 @@ libvirt_virNodeGetInfo(PyObject *self ATTRIBUTE_UNUSED, > VIR_PY_LIST_SET_GOTO(py_retval, 0, > libvirt_constcharPtrWrap(&info.model[0]), error); > VIR_PY_LIST_SET_GOTO(py_retval, 1, >- libvirt_longWrap((long) info.memory >> 10), error); >+ libvirt_longWrap((long) info.memory), error); > VIR_PY_LIST_SET_GOTO(py_retval, 2, libvirt_intWrap((int) info.cpus), error); > VIR_PY_LIST_SET_GOTO(py_retval, 3, libvirt_intWrap((int) info.mhz), error); > VIR_PY_LIST_SET_GOTO(py_retval, 4, libvirt_intWrap((int) info.nodes), error); >-- >2.11.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 48268
: 9769