From: Peter Xu <peterx@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: "Daniil Tatianin" <d-tatianin@yandex-team.ru>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Stefan Weil" <sw@weilnetz.de>, "Fabiano Rosas" <farosas@suse.de>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
qemu-devel@nongnu.org
Subject: Re: [PATCH v5 1/4] os: add an ability to lock memory on_fault
Date: Wed, 12 Feb 2025 10:41:46 -0500 [thread overview]
Message-ID: <Z6zBOrzRe1J4hmzm@x1.local> (raw)
In-Reply-To: <Z6y-jdFOCVz8mEXo@redhat.com>
On Wed, Feb 12, 2025 at 03:30:21PM +0000, Daniel P. Berrangé wrote:
> > diff --git a/include/system/os-win32.h b/include/system/os-win32.h
> > index b82a5d3ad9..cd61d69e10 100644
> > --- a/include/system/os-win32.h
> > +++ b/include/system/os-win32.h
> > @@ -123,8 +123,9 @@ static inline bool is_daemonized(void)
> > return false;
> > }
> >
> > -static inline int os_mlock(void)
> > +static inline int os_mlock(bool on_fault)
> > {
> > + (void)on_fault;
>
> Is this really needed ? Our compiler flags don't enable warnings
> about unused variables.
>
> If they did, this would not be the way to hide them. Instead you
> would use the "G_GNUC_UNUSED" annotation against the parameter.
> eg
>
> static inline int os_mlock(bool on_fault G_GNUC_UNUSED)
To be on the safe side.. I'll try to keep the marker if no one disagrees.
So that's:
diff --git a/include/system/os-win32.h b/include/system/os-win32.h
index cd61d69e10..bc623061d8 100644
--- a/include/system/os-win32.h
+++ b/include/system/os-win32.h
@@ -123,9 +123,8 @@ static inline bool is_daemonized(void)
return false;
}
-static inline int os_mlock(bool on_fault)
+static inline int os_mlock(bool on_fault G_GNUC_UNUSED)
{
- (void)on_fault;
return -ENOSYS;
}
>
> > return -ENOSYS;
> > }
--
Peter Xu
next prev parent reply other threads:[~2025-02-12 15:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 14:39 [PATCH v5 0/4] overcommit: introduce mem-lock-onfault Daniil Tatianin
2025-02-12 14:39 ` [PATCH v5 1/4] os: add an ability to lock memory on_fault Daniil Tatianin
2025-02-12 14:47 ` Vladimir Sementsov-Ogievskiy
2025-02-12 14:48 ` Philippe Mathieu-Daudé
2025-02-12 14:51 ` Daniil Tatianin
2025-02-12 14:55 ` Philippe Mathieu-Daudé
2025-02-12 15:23 ` Peter Xu
2025-02-12 15:27 ` Daniil Tatianin
2025-02-12 15:46 ` Philippe Mathieu-Daudé
2025-02-12 15:30 ` Daniel P. Berrangé
2025-02-12 15:41 ` Peter Xu [this message]
2025-02-12 16:17 ` Daniil Tatianin
2025-02-12 16:42 ` Peter Xu
2025-02-12 16:46 ` Daniil Tatianin
2025-02-12 14:39 ` [PATCH v5 2/4] system/vl: extract overcommit option parsing into a helper Daniil Tatianin
2025-02-12 14:39 ` [PATCH v5 3/4] system: introduce a new MlockState enum Daniil Tatianin
2025-02-12 14:39 ` [PATCH v5 4/4] overcommit: introduce mem-lock=on-fault Daniil Tatianin
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=Z6zBOrzRe1J4hmzm@x1.local \
--to=peterx@redhat.com \
--cc=berrange@redhat.com \
--cc=d-tatianin@yandex-team.ru \
--cc=farosas@suse.de \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/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.