public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: "He, Qing" <qing.he-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel <kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: Re: [RFC] lapic3: cleanup for save/restore data structure of in-kernel irqchips
Date: Thu, 02 Aug 2007 14:58:25 +0300	[thread overview]
Message-ID: <46B1C6E1.2050508@qumranet.com> (raw)
In-Reply-To: <37E52D09333DE2469A03574C88DBF40F048ED1-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>

He, Qing wrote:
> Hi,
> 	The argument of in-kernel irqchip save/restore IOCTL uses a
> separate data structure (struct kvm_irqchip and struct kvm_ioctl_pic in
> include/linux/kvm.h) different from functional data structure (struct
> kvm_pic_state and struct kvm_ioapic in driver/kvm/irq.h), this is
> because while most data are used at both side, there are certain
> internal data in functional data structure which should not be exposed
> to the user.
> 	Current code has some duplication between these two, and these
> duplicated parts are copied back and forth when save and restore. This
> seems a maintenance pain.
>   

I'm not sure consolidating helps with maintenance in this case:

- if there are no changes, there is no maintenance.
- if we change the kernel side, we can't change the userspace interface 
side because it will break existing code.  we have to write a new data 
structure for the interface and maintain the new and the old in parallel.

> 	I have come to two different possible solutions, but there are
> some coding style concerns:
> 	1. use macro definitions to sort out the common part,. The
> problem is that this is not so elegant and I hardly find anything
> similar in kernel code.
> 	2. organize the common part into a new struct, and include this
> struct into ioctl argument and functional data structure. The problem of
> this approach is that we have to re-write many codes to make things like
> `s->irr' changing to `s->state.irr'.
>
>   

I guess the later is preferable.  But I'm not sure it's worthwhile due 
to the issue above.



-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

  parent reply	other threads:[~2007-08-02 11:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-02 11:47 [RFC] lapic3: cleanup for save/restore data structure of in-kernel irqchips He, Qing
     [not found] ` <37E52D09333DE2469A03574C88DBF40F048ED1-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-08-02 11:58   ` Avi Kivity [this message]
     [not found]     ` <46B1C6E1.2050508-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-03  2:55       ` He, Qing
     [not found]         ` <37E52D09333DE2469A03574C88DBF40F048EDA-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-08-03 14:57           ` Avi Kivity
     [not found]             ` <46B34265.1040307-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-04  1:34               ` Dong, Eddie

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=46B1C6E1.2050508@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=qing.he-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox