[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] use virReportOOMError, not VIR_ERR_NO_MEMORY



On Tue, Jan 27, 2009 at 04:57:58PM +0100, Jim Meyering wrote:
> I've changed over 200 uses of <some_error_function> with the
> VIR_ERR_NO_MEMORY flag to call virReportOOMError with whatever
> "conn"-like argument (if any) was in the original call.
> 
> I don't claim to have tested these changes (OOM is a pain to simulate,
> and besides, testing so many failure points would take more
> infrastructure than we have right now).

We do ability to test OOM handling on any of our current test
cases, via the --enable-test-oom configure option, and then
setting VIR_TEST_OOM=1 when running a test. I don't run it
automatically though, since it kills performance of my personal
server doing the nightly builds. Basically any time we add more
unit test cases, we should automatically improve OOM testing
coverage.


> >From 099536470ae2cbe9503ed471d391e403fb2587a4 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering redhat com>
> Date: Tue, 27 Jan 2009 12:20:06 +0100
> Subject: [PATCH 1/3] error-reporting calls using VIR_ERR_NO_MEMORY: use virReportOOMError instead
> 
> * src/uml_conf.c (VIR_FROM_THIS): Define to VIR_FROM_UML.
> * src/xs_internal.c (VIR_FROM_THIS): Define to VIR_FROM_XEN.
> * src/xml.c (VIR_FROM_THIS): Define to VIR_FROM_XML.
> * src/stats_linux.c (VIR_FROM_THIS): Define to VIR_FROM_STATS_LINUX.
> * src/datatypes.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
> * src/lxc_conf.c (VIR_FROM_THIS): Define to VIR_FROM_LXC.
> * src/libvirt.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
> * src/node_device_conf.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
> * src/openvz_conf.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
> * src/openvz_driver.c (VIR_FROM_THIS): Define to VIR_FROM_OPENVZ.
> * src/conf.c (VIR_FROM_THIS): Define to VIR_FROM_CONF.
> Note: this loses config_filename:config_lineno diagnostics,
> but that's ok.
> * src/node_device.c (VIR_FROM_THIS): Define to VIR_FROM_NODEDEV.
> * src/sexpr.c (VIR_FROM_THIS): Define to VIR_FROM_SEXPR.

ACK

> >From a223b8f6064e867d304df9a0a1498ef2940631ef Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering redhat com>
> Date: Tue, 27 Jan 2009 15:58:07 +0100
> Subject: [PATCH 2/3] qparams.c: Use virReportOOMError(NULL), not qparam_report_oom()
> 
> * src/qparams.c (VIR_FROM_THIS): Define to VIR_FROM_NONE.
> (qparam_report_oom): Remove definition.
> Replace all uses.

ACK

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]