All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <levinsasha928@gmail.com>
To: penberg@kernel.org
Cc: mingo@elte.hu, gorcunov@gmail.com, asias.hejun@gmail.com,
	kvm@vger.kernel.org, Sasha Levin <levinsasha928@gmail.com>
Subject: [RFC 00/12] Overhaul of error handling and module init/uninit
Date: Mon, 19 Dec 2011 15:58:22 +0200	[thread overview]
Message-ID: <1324303114-5948-1-git-send-email-levinsasha928@gmail.com> (raw)

This patch series is really a work in progress, but is mature enough to
cover most of the different modules we have in the tool, and receive
comments regarding the work done so far and any future work.

There were three main goals while doing this work:
1. Less die(), more clean exits. We are not interested in hitting a die()
during regular program flow. die() should be reserved to extreme cases where
we are not able to report the error back.

2. Adding actual error handling where it was missing. Starting from simple
things like checking malloc()s, through making functions report their failures
(this meant switching lots of functions from 'void' to 'int' since they can
actually fail), and all the way to being able to handle errors by
uninitializing and exiting gracefully.

3. Getting initialization and uninitialization of modules somewhat
standard. The main purpose here is to be able to either add __init functions
or to be able to call all initialization functions from a single place without
code duplication.

Sasha Levin (12):
  kvm tools: Split kvm_cmd_run into init, work and uninit
  kvm tools: Fixes for symbol resolving module
  kvm tools: Fixes for IRQ module
  kvm tools: Fixes for UI modules
  kvm tools: Fixes for ioport module
  kvm tools: Fixes for ioeventfd module
  kvm tools: Fixes for serial module
  kvm tools: Fixes for mptable module
  kvm tools: Fixes for ioeventfd module
  kvm tools: Fixes for disk image module
  kvm tools: Fixes for rtc module
  kvm tools: Fixes for ioeventfd module

 tools/kvm/builtin-run.c                 |  197 +++++++++++++++++++++++++------
 tools/kvm/disk/blk.c                    |   13 ++-
 tools/kvm/disk/core.c                   |   76 ++++++++-----
 tools/kvm/disk/qcow.c                   |    2 +-
 tools/kvm/disk/raw.c                    |    9 +-
 tools/kvm/framebuffer.c                 |    9 ++-
 tools/kvm/hw/pci-shmem.c                |    7 +-
 tools/kvm/hw/rtc.c                      |   27 ++++-
 tools/kvm/hw/serial.c                   |   43 ++++++-
 tools/kvm/hw/vesa.c                     |   17 ++-
 tools/kvm/include/kvm/8250-serial.h     |    3 +-
 tools/kvm/include/kvm/disk-image.h      |    2 +-
 tools/kvm/include/kvm/framebuffer.h     |    1 +
 tools/kvm/include/kvm/ioeventfd.h       |    8 +-
 tools/kvm/include/kvm/ioport.h          |    5 +-
 tools/kvm/include/kvm/irq.h             |    3 +-
 tools/kvm/include/kvm/kvm.h             |    9 +-
 tools/kvm/include/kvm/pci.h             |    5 +-
 tools/kvm/include/kvm/rbtree-interval.h |    1 +
 tools/kvm/include/kvm/rtc.h             |    5 +-
 tools/kvm/include/kvm/sdl.h             |    7 +-
 tools/kvm/include/kvm/symbol.h          |    7 +-
 tools/kvm/include/kvm/virtio-blk.h      |    5 +-
 tools/kvm/include/kvm/virtio-pci.h      |    1 +
 tools/kvm/include/kvm/virtio-rng.h      |    4 +-
 tools/kvm/include/kvm/virtio-trans.h    |    1 +
 tools/kvm/include/kvm/vnc.h             |   10 ++-
 tools/kvm/ioeventfd.c                   |  158 +++++++++++++++++--------
 tools/kvm/ioport.c                      |   69 ++++++++++-
 tools/kvm/kvm.c                         |  101 +++++++++++-----
 tools/kvm/mmio.c                        |    8 +-
 tools/kvm/pci.c                         |   58 +++++++---
 tools/kvm/powerpc/kvm.c                 |    9 ++-
 tools/kvm/symbol.c                      |   59 +++++++--
 tools/kvm/ui/sdl.c                      |   31 ++++-
 tools/kvm/ui/vnc.c                      |   22 +++-
 tools/kvm/util/rbtree-interval.c        |   11 +-
 tools/kvm/virtio/blk.c                  |   37 ++++--
 tools/kvm/virtio/pci.c                  |   46 ++++++-
 tools/kvm/virtio/rng.c                  |   27 ++++-
 tools/kvm/virtio/trans.c                |    4 +-
 tools/kvm/x86/include/kvm/mptable.h     |    3 +-
 tools/kvm/x86/irq.c                     |   52 ++++++--
 tools/kvm/x86/kvm-cpu.c                 |   10 +-
 tools/kvm/x86/kvm.c                     |   18 +++-
 tools/kvm/x86/mptable.c                 |   20 +++-
 46 files changed, 926 insertions(+), 294 deletions(-)

-- 
1.7.8


             reply	other threads:[~2011-12-19 13:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-19 13:58 Sasha Levin [this message]
2011-12-19 13:58 ` [RFC 01/12] kvm tools: Split kvm_cmd_run into init, work and uninit Sasha Levin
2011-12-19 21:26   ` Pekka Enberg
2011-12-20 10:09     ` Sasha Levin
2011-12-20  8:55       ` Asias He
2011-12-19 13:58 ` [RFC 02/12] kvm tools: Fixes for symbol resolving module Sasha Levin
2011-12-19 13:58 ` [RFC 03/12] kvm tools: Fixes for IRQ module Sasha Levin
2011-12-19 13:58 ` [RFC 04/12] kvm tools: Fixes for UI modules Sasha Levin
2011-12-19 13:58 ` [RFC 05/12] kvm tools: Fixes for ioport module Sasha Levin
2011-12-19 13:58 ` [RFC 06/12] kvm tools: Fixes for ioeventfd module Sasha Levin
2011-12-19 13:58 ` [RFC 07/12] kvm tools: Fixes for serial module Sasha Levin
2011-12-19 13:58 ` [RFC 08/12] kvm tools: Fixes for mptable module Sasha Levin
2011-12-19 13:58 ` [RFC 09/12] kvm tools: Fixes for ioeventfd module Sasha Levin
2011-12-19 13:58 ` [RFC 10/12] kvm tools: Fixes for disk image module Sasha Levin
2011-12-19 13:58 ` [RFC 11/12] kvm tools: Fixes for rtc module Sasha Levin
2011-12-19 13:58 ` [RFC 12/12] kvm tools: Fixes for ioeventfd module Sasha Levin
2011-12-19 21:29 ` [RFC 00/12] Overhaul of error handling and module init/uninit Pekka Enberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324303114-5948-1-git-send-email-levinsasha928@gmail.com \
    --to=levinsasha928@gmail.com \
    --cc=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.