[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCHv4 3/5] pseries: Move CPU compatibility property to
From: |
Greg Kurz |
Subject: |
Re: [Qemu-ppc] [PATCHv4 3/5] pseries: Move CPU compatibility property to machine |
Date: |
Thu, 1 Jun 2017 17:44:15 +0200 |
On Thu, 1 Jun 2017 22:24:47 +1000
David Gibson <address@hidden> wrote:
[...]
> >
> > Yeah. This basically does:
> >
> > inpieces[i + 1] = inpieces[i];
> >
> > and we end up overwriting the terminal NULL pointer with a non-NULL
> > pointer.
> >
> > What about simplifying the loop to:
> >
> > /* inpieces[0] is the actual model string */
> > i = 1;
> > while (inpieces[i]) {
> > if (g_str_has_prefix(inpieces[i], "compat=")) {
> > /* in case of multiple compat= optipons */
> > g_free(compat_str);
> > compat_str = inpieces[i];
> > /* Excise compat options from list */
> > inpieces[i] = inpieces[i + 1];
> > }
> > i++;
> > }
>
> No.. that would duplicate the entry after the compat=, instead of
> properly excising it. I've already fixed this for my next draft.
>
D'oh you're right... sorry for the noise :)
pgpMKBD6T4Lwy.pgp
Description: OpenPGP digital signature