From: Kamil Rytarowski <n54@gmx.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, pbonzini@redhat.com
Cc: qemu-devel@nongnu.org, Jonathan Perkin <jperkin@joyent.com>
Subject: Re: [Qemu-devel] [PATCH] memory: Rename queue to mrqueue (memory region queue)
Date: Tue, 5 Sep 2017 02:00:04 +0200 [thread overview]
Message-ID: <e6f29b58-f16b-47d0-4b2b-9f156f3a2ed1@gmx.com> (raw)
In-Reply-To: <9a59070b-aae9-f683-d7a6-6e167b48b8f4@gmx.com>
[-- Attachment #1: Type: text/plain, Size: 4648 bytes --]
+CC jperkin
On 05.09.2017 01:57, Kamil Rytarowski wrote:
> On 04.09.2017 02:39, Philippe Mathieu-Daudé wrote:
>> Hi Kamil,
>>
>> On 09/03/2017 01:33 PM, Kamil Rytarowski wrote:
>>> SunOS declares struct queue in <netinet/in.h>.
>>
>> I didn't check what is this define for, but I'd rather add in
>> include/sysemu/os-posix.h:
>>
>> #ifdef queue
>> #undef queue
>> #endif
>>
>> If no QEMU code rely on this netinet queue.
>>
>
> It's not a define, but a struct.
>
> I have made a mistake. The struct queue is located in <sys/stream.h>,
> which is included from <netinet/in.h>.
>
> sys/stream.h:typedef struct queue {
>
>>>
>>> This fixes build on SmartOS (Joyent).
>>>
>>> Patch cherry-picked from pkgsrc by jperkin (Joyent).
>>>
>>> Signed-off-by: Kamil Rytarowski <n54@gmx.com>
>>> ---
>>> memory.c | 22 +++++++++++-----------
>>> 1 file changed, 11 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/memory.c b/memory.c
>>> index c0adc35410..b9920a6540 100644
>>> --- a/memory.c
>>> +++ b/memory.c
>>> @@ -2701,10 +2701,10 @@ typedef struct MemoryRegionList MemoryRegionList;
>>> struct MemoryRegionList {
>>> const MemoryRegion *mr;
>>> - QTAILQ_ENTRY(MemoryRegionList) queue;
>>> + QTAILQ_ENTRY(MemoryRegionList) mrqueue;
>>> };
>>> -typedef QTAILQ_HEAD(queue, MemoryRegionList) MemoryRegionListHead;
>>> +typedef QTAILQ_HEAD(mrqueue, MemoryRegionList) MemoryRegionListHead;
>>> #define MR_SIZE(size) (int128_nz(size) ? (hwaddr)int128_get64( \
>>> int128_sub((size), int128_one())) : 0)
>>> @@ -2746,7 +2746,7 @@ static void mtree_print_mr(fprintf_function
>>> mon_printf, void *f,
>>> bool found = false;
>>> /* check if the alias is already in the queue */
>>> - QTAILQ_FOREACH(ml, alias_print_queue, queue) {
>>> + QTAILQ_FOREACH(ml, alias_print_queue, mrqueue) {
>>> if (ml->mr == mr->alias) {
>>> found = true;
>>> }
>>> @@ -2755,7 +2755,7 @@ static void mtree_print_mr(fprintf_function
>>> mon_printf, void *f,
>>> if (!found) {
>>> ml = g_new(MemoryRegionList, 1);
>>> ml->mr = mr->alias;
>>> - QTAILQ_INSERT_TAIL(alias_print_queue, ml, queue);
>>> + QTAILQ_INSERT_TAIL(alias_print_queue, ml, mrqueue);
>>> }
>>> mon_printf(f, TARGET_FMT_plx "-" TARGET_FMT_plx
>>> " (prio %d, %s): alias %s @%s " TARGET_FMT_plx
>>> @@ -2783,26 +2783,26 @@ static void mtree_print_mr(fprintf_function
>>> mon_printf, void *f,
>>> QTAILQ_FOREACH(submr, &mr->subregions, subregions_link) {
>>> new_ml = g_new(MemoryRegionList, 1);
>>> new_ml->mr = submr;
>>> - QTAILQ_FOREACH(ml, &submr_print_queue, queue) {
>>> + QTAILQ_FOREACH(ml, &submr_print_queue, mrqueue) {
>>> if (new_ml->mr->addr < ml->mr->addr ||
>>> (new_ml->mr->addr == ml->mr->addr &&
>>> new_ml->mr->priority > ml->mr->priority)) {
>>> - QTAILQ_INSERT_BEFORE(ml, new_ml, queue);
>>> + QTAILQ_INSERT_BEFORE(ml, new_ml, mrqueue);
>>> new_ml = NULL;
>>> break;
>>> }
>>> }
>>> if (new_ml) {
>>> - QTAILQ_INSERT_TAIL(&submr_print_queue, new_ml, queue);
>>> + QTAILQ_INSERT_TAIL(&submr_print_queue, new_ml, mrqueue);
>>> }
>>> }
>>> - QTAILQ_FOREACH(ml, &submr_print_queue, queue) {
>>> + QTAILQ_FOREACH(ml, &submr_print_queue, mrqueue) {
>>> mtree_print_mr(mon_printf, f, ml->mr, level + 1, cur_start,
>>> alias_print_queue);
>>> }
>>> - QTAILQ_FOREACH_SAFE(ml, &submr_print_queue, queue, next_ml) {
>>> + QTAILQ_FOREACH_SAFE(ml, &submr_print_queue, mrqueue, next_ml) {
>>> g_free(ml);
>>> }
>>> }
>>> @@ -2872,13 +2872,13 @@ void mtree_info(fprintf_function mon_printf,
>>> void *f, bool flatview)
>>> }
>>> /* print aliased regions */
>>> - QTAILQ_FOREACH(ml, &ml_head, queue) {
>>> + QTAILQ_FOREACH(ml, &ml_head, mrqueue) {
>>> mon_printf(f, "memory-region: %s\n",
>>> memory_region_name(ml->mr));
>>> mtree_print_mr(mon_printf, f, ml->mr, 1, 0, &ml_head);
>>> mon_printf(f, "\n");
>>> }
>>> - QTAILQ_FOREACH_SAFE(ml, &ml_head, queue, ml2) {
>>> + QTAILQ_FOREACH_SAFE(ml, &ml_head, mrqueue, ml2) {
>>> g_free(ml);
>>> }
>>> }
>>>
>
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-09-04 23:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-03 16:33 [Qemu-devel] [PATCH] memory: Rename queue to mrqueue (memory region queue) Kamil Rytarowski
2017-09-04 0:39 ` Philippe Mathieu-Daudé
2017-09-04 23:57 ` Kamil Rytarowski
2017-09-05 0:00 ` Kamil Rytarowski [this message]
2017-09-04 8:09 ` no-reply
2017-09-11 10:32 ` Paolo Bonzini
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=e6f29b58-f16b-47d0-4b2b-9f156f3a2ed1@gmx.com \
--to=n54@gmx.com \
--cc=f4bug@amsat.org \
--cc=jperkin@joyent.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).