qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] memory-region: Report if region is read-only


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH v2] memory-region: Report if region is read-only or write-only on info mtree
Date: Sat, 4 Feb 2012 15:04:36 +0000

On Sat, Feb 4, 2012 at 14:57, Jan Kiszka <address@hidden> wrote:
> From: Jan Kiszka <address@hidden>
>
> Helpful to understand guest configurations of things like the i440FX's
> PAM or the state of ROM devices.
>
> Signed-off-by: Jan Kiszka <address@hidden>
> ---
>
> Changes in v2:
>  - encode R and W separately
>  - print ROMD memory region state as well
>
>  memory.c |   14 +++++++++++---
>  1 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/memory.c b/memory.c
> index 5e77d8a..3095391 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -1609,23 +1609,31 @@ static void mtree_print_mr(fprintf_function 
> mon_printf, void *f,
>             ml->printed = false;
>             QTAILQ_INSERT_TAIL(alias_print_queue, ml, queue);
>         }
> -        mon_printf(f, TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d): alias 
> %s @%s "
> -                   TARGET_FMT_plx "-" TARGET_FMT_plx "\n",
> +        mon_printf(f, TARGET_FMT_plx "-" TARGET_FMT_plx
> +                   " (prio %d, %c%c): alias %s @%s " TARGET_FMT_plx
> +                   "-" TARGET_FMT_plx "\n",
>                    base + mr->addr,
>                    base + mr->addr
>                    + (target_phys_addr_t)int128_get64(mr->size) - 1,
>                    mr->priority,
> +                   mr->readable ? 'R' : '-',
> +                   !mr->readonly && (!mr->rom_device || !mr->readable) ? 'W'
> +                                                                       : '-',

Why || !mr->readable? Applying de Morgan, this would equal to
!mr->readonly && !(mr->rom_device && mr->readable) or by applying
twice, !(mr->readonly || mr->rom_device && mr->readable), neither of
which makes much sense.

>                    mr->name,
>                    mr->alias->name,
>                    mr->alias_offset,
>                    mr->alias_offset
>                    + (target_phys_addr_t)int128_get64(mr->size) - 1);
>     } else {
> -        mon_printf(f, TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d): %s\n",
> +        mon_printf(f,
> +                   TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d, %c%c): 
> %s\n",
>                    base + mr->addr,
>                    base + mr->addr
>                    + (target_phys_addr_t)int128_get64(mr->size) - 1,
>                    mr->priority,
> +                   mr->readable ? 'R' : '-',
> +                   !mr->readonly && (!mr->rom_device || !mr->readable) ? 'W'
> +                                                                       : '-',
>                    mr->name);
>     }
>
> --
> 1.7.3.4

reply via email to

[Prev in Thread] Current Thread [Next in Thread]