[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v6 03/27] qobject: introduce qobject_get_try_str()
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [RFC v6 03/27] qobject: introduce qobject_get_try_str() |
Date: |
Wed, 10 Jan 2018 15:52:57 +0800 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Tue, Jan 09, 2018 at 04:50:39PM -0600, Eric Blake wrote:
> On 12/19/2017 02:45 AM, Peter Xu wrote:
> > A quick way to fetch string from qobject when it's a QString.
> >
> > Reviewed-by: Fam Zheng <address@hidden>
> > Reviewed-by: Stefan Hajnoczi <address@hidden>
> > Signed-off-by: Peter Xu <address@hidden>
> > ---
> > include/qapi/qmp/qstring.h | 1 +
> > qobject/qstring.c | 11 +++++++++++
> > 2 files changed, 12 insertions(+)
> >
> > diff --git a/include/qapi/qmp/qstring.h b/include/qapi/qmp/qstring.h
> > index a145c8ca00..6517d8e377 100644
> > --- a/include/qapi/qmp/qstring.h
> > +++ b/include/qapi/qmp/qstring.h
> > @@ -28,6 +28,7 @@ QString *qstring_from_substr(const char *str, int start,
> > int end);
> > size_t qstring_get_length(const QString *qstring);
> > const char *qstring_get_str(const QString *qstring);
> > const char *qstring_get_try_str(const QString *qstring);
> > +const char *qobject_get_try_str(const QObject *qstring);
>
> The naming is consistent, so I won't reject the patch, but 'try_get_str'
> reads better than 'get_try_str'. Of course, fixing the code base to
> read well AND be consistent is a much bigger task, and I'm not asking
> you to tackle it.
I agree.
>
>
> >
> > +/**
> > + * qobject_get_try_str(): Return a pointer of the backstore string
>
> The word "backstore" doesn't appear anywhere in qemu.git, and flags as a
> typo. I'd prefer:
>
> Return a pointer to the corresponding string
I'll take this one. Thanks,
>
> or maybe "backing string"
--
Peter Xu