* [Qemu-devel] [patch] remove unused function arg in qemu_iohandler_poll() and qemu_iohandler_fill()
@ 2011-11-01 5:11 Jun Koi
2011-11-01 15:05 ` Anthony Liguori
2011-11-02 7:40 ` Paolo Bonzini
0 siblings, 2 replies; 6+ messages in thread
From: Jun Koi @ 2011-11-01 5:11 UTC (permalink / raw)
To: qemu-devel
This patch removes unused function argument xfds from
qemu_iohandler_poll() and qemu_iohandler_fill()
Signed-off-by: Jun Koi <junkoi2004@gmail.com>
diff --git a/iohandler.c b/iohandler.c
index 5640d49..9963790 100644
--- a/iohandler.c
+++ b/iohandler.c
@@ -89,7 +89,7 @@ int qemu_set_fd_handler(int fd,
return qemu_set_fd_handler2(fd, NULL, fd_read, fd_write, opaque);
}
-void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set
*writefds, fd_set *xfds)
+void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set *writefds)
{
IOHandlerRecord *ioh;
@@ -111,7 +111,7 @@ void qemu_iohandler_fill(int *pnfds, fd_set
*readfds, fd_set *writefds, fd_set *
}
}
-void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, fd_set
*xfds, int ret)
+void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, int ret)
{
if (ret > 0) {
IOHandlerRecord *pioh, *ioh;
diff --git a/main-loop.c b/main-loop.c
index 60e9748..7cbb0b0 100644
--- a/main-loop.c
+++ b/main-loop.c
@@ -446,7 +446,7 @@ int main_loop_wait(int nonblocking)
#ifdef CONFIG_SLIRP
slirp_select_fill(&nfds, &rfds, &wfds, &xfds);
#endif
- qemu_iohandler_fill(&nfds, &rfds, &wfds, &xfds);
+ qemu_iohandler_fill(&nfds, &rfds, &wfds);
glib_select_fill(&nfds, &rfds, &wfds, &xfds, &tv);
if (timeout > 0) {
@@ -460,7 +460,7 @@ int main_loop_wait(int nonblocking)
}
glib_select_poll(&rfds, &wfds, &xfds, (ret < 0));
- qemu_iohandler_poll(&rfds, &wfds, &xfds, ret);
+ qemu_iohandler_poll(&rfds, &wfds, ret);
#ifdef CONFIG_SLIRP
slirp_select_poll(&rfds, &wfds, &xfds, (ret < 0));
#endif
diff --git a/main-loop.h b/main-loop.h
index 8a716b1..f753c6a 100644
--- a/main-loop.h
+++ b/main-loop.h
@@ -341,8 +341,8 @@ void qemu_mutex_unlock_iothread(void);
/* internal interfaces */
-void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set
*writefds, fd_set *xfds);
-void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, fd_set
*xfds, int rc);
+void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set *writefds);
+void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, int rc);
void qemu_bh_schedule_idle(QEMUBH *bh);
int qemu_bh_poll(void);
(END)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [patch] remove unused function arg in qemu_iohandler_poll() and qemu_iohandler_fill()
2011-11-01 5:11 [Qemu-devel] [patch] remove unused function arg in qemu_iohandler_poll() and qemu_iohandler_fill() Jun Koi
@ 2011-11-01 15:05 ` Anthony Liguori
2011-11-02 1:46 ` Jun Koi
2011-11-02 7:40 ` Paolo Bonzini
1 sibling, 1 reply; 6+ messages in thread
From: Anthony Liguori @ 2011-11-01 15:05 UTC (permalink / raw)
To: Jun Koi; +Cc: qemu-devel
On 11/01/2011 12:11 AM, Jun Koi wrote:
> This patch removes unused function argument xfds from
> qemu_iohandler_poll() and qemu_iohandler_fill()
>
> Signed-off-by: Jun Koi<junkoi2004@gmail.com>
>
>
> diff --git a/iohandler.c b/iohandler.c
> index 5640d49..9963790 100644
> --- a/iohandler.c
> +++ b/iohandler.c
> @@ -89,7 +89,7 @@ int qemu_set_fd_handler(int fd,
> return qemu_set_fd_handler2(fd, NULL, fd_read, fd_write, opaque);
> }
>
> -void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set
> *writefds, fd_set *xfds)
Your mailer is munging the patch. Please use git-send-email to avoid this.
Regards,
Anthony Liguori
> +void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set *writefds)
> {
> IOHandlerRecord *ioh;
>
> @@ -111,7 +111,7 @@ void qemu_iohandler_fill(int *pnfds, fd_set
> *readfds, fd_set *writefds, fd_set *
> }
> }
>
> -void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, fd_set
> *xfds, int ret)
> +void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, int ret)
> {
> if (ret> 0) {
> IOHandlerRecord *pioh, *ioh;
> diff --git a/main-loop.c b/main-loop.c
> index 60e9748..7cbb0b0 100644
> --- a/main-loop.c
> +++ b/main-loop.c
> @@ -446,7 +446,7 @@ int main_loop_wait(int nonblocking)
> #ifdef CONFIG_SLIRP
> slirp_select_fill(&nfds,&rfds,&wfds,&xfds);
> #endif
> - qemu_iohandler_fill(&nfds,&rfds,&wfds,&xfds);
> + qemu_iohandler_fill(&nfds,&rfds,&wfds);
> glib_select_fill(&nfds,&rfds,&wfds,&xfds,&tv);
>
> if (timeout> 0) {
> @@ -460,7 +460,7 @@ int main_loop_wait(int nonblocking)
> }
>
> glib_select_poll(&rfds,&wfds,&xfds, (ret< 0));
> - qemu_iohandler_poll(&rfds,&wfds,&xfds, ret);
> + qemu_iohandler_poll(&rfds,&wfds, ret);
> #ifdef CONFIG_SLIRP
> slirp_select_poll(&rfds,&wfds,&xfds, (ret< 0));
> #endif
> diff --git a/main-loop.h b/main-loop.h
> index 8a716b1..f753c6a 100644
> --- a/main-loop.h
> +++ b/main-loop.h
> @@ -341,8 +341,8 @@ void qemu_mutex_unlock_iothread(void);
>
> /* internal interfaces */
>
> -void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set
> *writefds, fd_set *xfds);
> -void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, fd_set
> *xfds, int rc);
> +void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set *writefds);
> +void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, int rc);
>
> void qemu_bh_schedule_idle(QEMUBH *bh);
> int qemu_bh_poll(void);
> (END)
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [patch] remove unused function arg in qemu_iohandler_poll() and qemu_iohandler_fill()
2011-11-01 15:05 ` Anthony Liguori
@ 2011-11-02 1:46 ` Jun Koi
2011-11-02 10:38 ` Stefan Hajnoczi
0 siblings, 1 reply; 6+ messages in thread
From: Jun Koi @ 2011-11-02 1:46 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 648 bytes --]
On Tue, Nov 1, 2011 at 11:05 PM, Anthony Liguori <anthony@codemonkey.ws> wrote:
> On 11/01/2011 12:11 AM, Jun Koi wrote:
>>
>> This patch removes unused function argument xfds from
>> qemu_iohandler_poll() and qemu_iohandler_fill()
>>
>> Signed-off-by: Jun Koi<junkoi2004@gmail.com>
>>
>
> Your mailer is munging the patch. Please use git-send-email to avoid this.
>
pls find the patch in attachment.
thanks,
Jun
Signed-off-by: Jun Koi<junkoi2004@gmail.com>
$ diffstat patch-remove-xfds.diff
iohandler.c | 4 ++--
main-loop.c | 4 ++--
main-loop.h | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
[-- Attachment #2: patch-remove-xfds.diff --]
[-- Type: text/x-patch, Size: 2057 bytes --]
diff --git a/iohandler.c b/iohandler.c
index 5640d49..9963790 100644
--- a/iohandler.c
+++ b/iohandler.c
@@ -89,7 +89,7 @@ int qemu_set_fd_handler(int fd,
return qemu_set_fd_handler2(fd, NULL, fd_read, fd_write, opaque);
}
-void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set *writefds, fd_set *xfds)
+void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set *writefds)
{
IOHandlerRecord *ioh;
@@ -111,7 +111,7 @@ void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set *writefds, fd_set *
}
}
-void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds, int ret)
+void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, int ret)
{
if (ret > 0) {
IOHandlerRecord *pioh, *ioh;
diff --git a/main-loop.c b/main-loop.c
index 60e9748..7cbb0b0 100644
--- a/main-loop.c
+++ b/main-loop.c
@@ -446,7 +446,7 @@ int main_loop_wait(int nonblocking)
#ifdef CONFIG_SLIRP
slirp_select_fill(&nfds, &rfds, &wfds, &xfds);
#endif
- qemu_iohandler_fill(&nfds, &rfds, &wfds, &xfds);
+ qemu_iohandler_fill(&nfds, &rfds, &wfds);
glib_select_fill(&nfds, &rfds, &wfds, &xfds, &tv);
if (timeout > 0) {
@@ -460,7 +460,7 @@ int main_loop_wait(int nonblocking)
}
glib_select_poll(&rfds, &wfds, &xfds, (ret < 0));
- qemu_iohandler_poll(&rfds, &wfds, &xfds, ret);
+ qemu_iohandler_poll(&rfds, &wfds, ret);
#ifdef CONFIG_SLIRP
slirp_select_poll(&rfds, &wfds, &xfds, (ret < 0));
#endif
diff --git a/main-loop.h b/main-loop.h
index 8a716b1..f753c6a 100644
--- a/main-loop.h
+++ b/main-loop.h
@@ -341,8 +341,8 @@ void qemu_mutex_unlock_iothread(void);
/* internal interfaces */
-void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set *writefds, fd_set *xfds);
-void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds, int rc);
+void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set *writefds);
+void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, int rc);
void qemu_bh_schedule_idle(QEMUBH *bh);
int qemu_bh_poll(void);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [patch] remove unused function arg in qemu_iohandler_poll() and qemu_iohandler_fill()
2011-11-02 1:46 ` Jun Koi
@ 2011-11-02 10:38 ` Stefan Hajnoczi
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2011-11-02 10:38 UTC (permalink / raw)
To: Jun Koi; +Cc: qemu-devel
On Wed, Nov 2, 2011 at 1:46 AM, Jun Koi <junkoi2004@gmail.com> wrote:
> On Tue, Nov 1, 2011 at 11:05 PM, Anthony Liguori <anthony@codemonkey.ws> wrote:
>> On 11/01/2011 12:11 AM, Jun Koi wrote:
>>>
>>> This patch removes unused function argument xfds from
>>> qemu_iohandler_poll() and qemu_iohandler_fill()
>>>
>>> Signed-off-by: Jun Koi<junkoi2004@gmail.com>
>>>
>>
>> Your mailer is munging the patch. Please use git-send-email to avoid this.
>>
>
> pls find the patch in attachment.
The GMail web interface always wraps newlines. There is no way to
turn it off. Patches should be sent inline and not as attachments
(see http://wiki.qemu.org/Contribute/SubmitAPatch). Attachments
cannot be replied to with review comments easily.
In the future please use Anthony's suggestion and use
git-send-email(1). There is information available on how to set it up
with GMail SMTP servers, it's pretty easy:
http://morefedora.blogspot.com/2009/02/configuring-git-send-email-to-use-gmail.html
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [patch] remove unused function arg in qemu_iohandler_poll() and qemu_iohandler_fill()
2011-11-01 5:11 [Qemu-devel] [patch] remove unused function arg in qemu_iohandler_poll() and qemu_iohandler_fill() Jun Koi
2011-11-01 15:05 ` Anthony Liguori
@ 2011-11-02 7:40 ` Paolo Bonzini
2011-11-02 8:05 ` Jun Koi
1 sibling, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2011-11-02 7:40 UTC (permalink / raw)
To: qemu-devel, Jun Koi
On 11/01/2011 06:11 AM, Jun Koi wrote:
> This patch removes unused function argument xfds from
> qemu_iohandler_poll() and qemu_iohandler_fill()
I don't think the patch us particularly useful; the arguments are
designed to match select. The fact that iohandlers do not support xfds
(unlike e.g. glib and slirp poll/fill) is not important to the _client_
of this code.
Thanks,
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [patch] remove unused function arg in qemu_iohandler_poll() and qemu_iohandler_fill()
2011-11-02 7:40 ` Paolo Bonzini
@ 2011-11-02 8:05 ` Jun Koi
0 siblings, 0 replies; 6+ messages in thread
From: Jun Koi @ 2011-11-02 8:05 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Wed, Nov 2, 2011 at 3:40 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 11/01/2011 06:11 AM, Jun Koi wrote:
>>
>> This patch removes unused function argument xfds from
>> qemu_iohandler_poll() and qemu_iohandler_fill()
>
> I don't think the patch us particularly useful; the arguments are designed
> to match select. The fact that iohandlers do not support xfds (unlike e.g.
> glib and slirp poll/fill) is not important to the _client_ of this code.
>
do you mean the code looks "more beautiful" if we just leave xfds
there? is that a good reason?
this causes a little bit on performance, because we have to push an
unused argument into the stack every time we call those funcs.
while the impact is minimal, do we really need to suffer that for the
beauty of code?
thanks,
J
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-11-02 10:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-01 5:11 [Qemu-devel] [patch] remove unused function arg in qemu_iohandler_poll() and qemu_iohandler_fill() Jun Koi
2011-11-01 15:05 ` Anthony Liguori
2011-11-02 1:46 ` Jun Koi
2011-11-02 10:38 ` Stefan Hajnoczi
2011-11-02 7:40 ` Paolo Bonzini
2011-11-02 8:05 ` Jun Koi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).