xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Oleksandr Grytsov <al1img@gmail.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: xen-devel@lists.xenproject.org,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Subject: Re: [PATCH v5 10/12] libxl: change nic to use generec add function
Date: Tue, 12 Sep 2017 14:35:38 +0300	[thread overview]
Message-ID: <CACvf2oVBxvH5FQpiWb_FySRfa9gzhsHtzRu_pn9Q4WGdhi4ysg@mail.gmail.com> (raw)
In-Reply-To: <20170912110846.ospvznutqib2nxi7@citrix.com>

On Tue, Sep 12, 2017 at 2:08 PM, Wei Liu <wei.liu2@citrix.com> wrote:
> On Tue, Sep 12, 2017 at 11:52:17AM +0100, Wei Liu wrote:
>> On Mon, Sep 11, 2017 at 08:15:00PM +0300, Oleksandr Grytsov wrote:
>> > From: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
>> >
>> > Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
>> > ---
>> >  tools/libxl/libxl.h                   |   9 +-
>> >  tools/libxl/libxl_checkpoint_device.c |   9 +-
>> >  tools/libxl/libxl_colo_save.c         |   4 +-
>> >  tools/libxl/libxl_dm.c                |   4 +-
>> >  tools/libxl/libxl_internal.h          |   2 -
>> >  tools/libxl/libxl_nic.c               | 191 +++++++---------------------------
>> >  tools/ocaml/libs/xl/xenlight_stubs.c  |   3 +-
>> >  tools/xl/xl_nic.c                     |   3 +-
>> >  8 files changed, 52 insertions(+), 173 deletions(-)
>> >
>> > diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
>> > index d5a3ab7..abe129e 100644
>> > --- a/tools/libxl/libxl.h
>> > +++ b/tools/libxl/libxl.h
>> > @@ -1850,9 +1850,14 @@ int libxl_device_nic_destroy(libxl_ctx *ctx, uint32_t domid,
>> >                               const libxl_asyncop_how *ao_how)
>> >                               LIBXL_EXTERNAL_CALLERS_ONLY;
>> >
>> > -libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx, uint32_t domid, int *num);
>> > +libxl_device_nic *libxl_device_nic_list(libxl_ctx *ctx,
>> > +                                        uint32_t domid, int *num)
>> > +                                        LIBXL_EXTERNAL_CALLERS_ONLY;
>> > +void libxl_device_nic_list_free(libxl_device_nic* list, int num)
>> > +                                LIBXL_EXTERNAL_CALLERS_ONLY;
>> >  int libxl_device_nic_getinfo(libxl_ctx *ctx, uint32_t domid,
>> > -                              libxl_device_nic *nic, libxl_nicinfo *nicinfo);
>> > +                             libxl_device_nic *nic, libxl_nicinfo *nicinfo)
>> > +                             LIBXL_EXTERNAL_CALLERS_ONLY;
>>
>> The annotation has caused the following failures:
>>
>> libxl_colo_save.c: In function ‘libxl__colo_save_setup’:
>> libxl_colo_save.c:126:14: error: call to ‘libxl_device_nic_list’ declared with attribute warning: may not be called from within libxl [-Werror]
>> nics = libxl_device_nic_list(CTX, cds->domid, &nb);
>>          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> libxl_colo_save.c:129:9: error: call to ‘libxl_device_nic_list_free’ declared with attribute warning: may not be called from within libxl [-Werror]
>> libxl_device_nic_list_free(nics, nb);
>>          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> However, I think that's a bug in colo.
>
> Thinking about this a bit more: the list_free functions (here and in
> other patches) shouldn't be annotated as external callers only.
>
> And you can replace the nic_list function here to call the framework
> directly.

The idea was that libxl_device_xxx_list and free are for external callers only
because they don't aware about device framework. Internal callers shall use
device framework instead. I wonder why I don't have error here on my
build environment. I will put device framework get/free list here.

I will create new patch set.

-- 
Best Regards,
Oleksandr Grytsov.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-09-12 11:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 17:14 [PATCH v5 00/12] libxl: add PV display device driver interface Oleksandr Grytsov
2017-09-11 17:14 ` [PATCH v5 01/12] libxl: add generic function to add device Oleksandr Grytsov
2017-09-12 10:20   ` Wei Liu
2017-09-11 17:14 ` [PATCH v5 02/12] libxl: add generic functions to get and free device list Oleksandr Grytsov
2017-09-12 10:20   ` Wei Liu
2017-09-11 17:14 ` [PATCH v5 03/12] libxl: add vdispl device Oleksandr Grytsov
2017-09-12 10:21   ` Wei Liu
2017-09-11 17:14 ` [PATCH v5 04/12] xl: add PV display device commands Oleksandr Grytsov
2017-09-11 17:14 ` [PATCH v5 05/12] docs: add PV display driver information Oleksandr Grytsov
2017-09-11 17:14 ` [PATCH v5 06/12] libxl: change p9 to use generec add function Oleksandr Grytsov
2017-09-12 10:23   ` Wei Liu
2017-09-11 17:14 ` [PATCH v5 07/12] libxl: change vkb " Oleksandr Grytsov
2017-09-12 10:23   ` Wei Liu
2017-09-11 17:14 ` [PATCH v5 08/12] libxl: change vfb " Oleksandr Grytsov
2017-09-11 17:14 ` [PATCH v5 09/12] libxl: change disk to use generic getting list functions Oleksandr Grytsov
2017-09-12 10:28   ` Wei Liu
2017-09-11 17:15 ` [PATCH v5 10/12] libxl: change nic to use generec add function Oleksandr Grytsov
2017-09-12 10:28   ` Wei Liu
2017-09-12 10:52   ` Wei Liu
2017-09-12 11:08     ` Wei Liu
2017-09-12 11:35       ` Oleksandr Grytsov [this message]
2017-09-12 13:01         ` Oleksandr Grytsov
2017-09-11 17:15 ` [PATCH v5 11/12] libxl: change vtpm " Oleksandr Grytsov
2017-09-11 17:15 ` [PATCH v5 12/12] libxl: remove unneeded DEVICE_ADD macro Oleksandr Grytsov
2017-09-12 10:39 ` [PATCH v5 00/12] libxl: add PV display device driver interface Wei Liu

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=CACvf2oVBxvH5FQpiWb_FySRfa9gzhsHtzRu_pn9Q4WGdhi4ysg@mail.gmail.com \
    --to=al1img@gmail.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=oleksandr_grytsov@epam.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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).