xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Atom2 <ariel.atom2@web2web.at>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: xen-users@lists.xenproject.org,
	xen-devel <xen-devel@lists.xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [Xen-users] substantial shutdown delay for PV guests with PCI -passthrough
Date: Thu, 20 Mar 2014 03:31:41 +0100	[thread overview]
Message-ID: <532A530D.1050504@web2web.at> (raw)
In-Reply-To: <21289.48007.604643.322509@mariner.uk.xensource.com>

[-- Attachment #1: Type: text/plain, Size: 5510 bytes --]

Sorry for my delay in answering - this is a resend as the first e-Mail 
with uncompressed attachments did not go through.

Am 19.03.14 16:45, schrieb Ian Jackson:
> Atom2 writes ("Re: [Xen-users] substantial shutdown delay for PV guests with PCI -passthrough"):
>> nope, I am using xl; there is no xend or xm installed on the machine or
>> involved anyhow (I assumed with xend you referred back to xm instead of xl).
>
> Can you try this patch ?
>
> Thanks,
> Ian.
Hi Ian,
the patch unfortunately doesn't apply to my sources - some comments to 
the reasons why further below.

Just FYI: the version I am using is 4.3.1-r5; I have attached the 
relevant source files referred to by your patches.

Thanks and regards,
Atom2
>
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 30b0b06..1583498 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -2728,7 +2728,7 @@ static void local_device_attach_cb(libxl__egc *egc, libxl__ao_device *aodev)
>       if (rc < 0)
>           goto out;
>       be_path = libxl__device_backend_path(gc, &device);
> -    rc = libxl__wait_for_backend(gc, be_path, "4");
> +    rc = libxl__wait_for_backend_deprecated(gc, be_path, "4", (char*)0);
>       if (rc < 0)
>           goto out;
>
This one would apply with an offset of 43 lines - it should therefore be 
o.k I guess.
> diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
> index fa99f77..11a9885 100644
> --- a/tools/libxl/libxl_device.c
> +++ b/tools/libxl/libxl_device.c
> @@ -1208,12 +1208,14 @@ int libxl__wait_for_device_model_deprecated(libxl__gc *gc,
>                                        check_callback, check_callback_userdata);
>   }
>
> -int libxl__wait_for_backend(libxl__gc *gc, const char *be_path,
> -                            const char *state)
> +int libxl__wait_for_backend_deprecated(libxl__gc *gc, const char *be_path,
> +                                       ...)
>   {
>       int watchdog = 100;
>       const char *p, *path = GCSPRINTF("%s/state", be_path);
> +    const char *want;
>       int rc;
> +    va_list al;
>
>       while (watchdog-- > 0) {
>           rc = libxl__xs_read_checked(gc, XBT_NULL, path, &p);
> @@ -1224,8 +1226,14 @@ int libxl__wait_for_backend(libxl__gc *gc, const char *be_path,
>               return ERROR_FAIL;
>           }
>
> -        if (!strcmp(p, state))
> -            return 0;
> +        va_start(al,be_path);
> +        while ((want = va_arg(al, char*))) {
> +            if (!strcmp(p, want)) {
> +                va_end(al);
> +                return 0;
> +            }
> +        }
> +        va_end(al);
>
>           usleep(100000);
>       }
This one does not apply, not the least because there is no function 
libxl__wait_for_device_model_deprecated in the source. Furthermore the 
definition and the body of libxl__wait_for_backend looks differently to 
what the patch seems to expect - please see attached source file.
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index b3a200d..bdcce35 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -1025,8 +1025,8 @@ _hidden char *libxl__device_frontend_path(libxl__gc *gc, libxl__device *device);
>   _hidden int libxl__parse_backend_path(libxl__gc *gc, const char *path,
>                                         libxl__device *dev);
>   _hidden int libxl__device_destroy(libxl__gc *gc, libxl__device *dev);
> -_hidden int libxl__wait_for_backend(libxl__gc *gc, const char *be_path,
> -                                    const char *state);
> +_hidden int libxl__wait_for_backend_deprecated(libxl__gc *gc,
> +                   const char *be_path, ...) __attribute__((sentinel));
>   _hidden int libxl__nic_type(libxl__gc *gc, libxl__device *dev,
>                               libxl_nic_type *nictype);
>
This one fails because the definition of libxl__wait_for_backend(...) is 
different (see above) - please see attached source file.
> diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
> index 44d0453..43ffd57 100644
> --- a/tools/libxl/libxl_pci.c
> +++ b/tools/libxl/libxl_pci.c
> @@ -126,7 +126,7 @@ static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, libxl_d
>           return ERROR_FAIL;
>
>       if (!starting && domtype == LIBXL_DOMAIN_TYPE_PV) {
> -        if (libxl__wait_for_backend(gc, be_path, "4") < 0)
> +        if (libxl__wait_for_backend_deprecated(gc, be_path, "4", (char*)0) < 0)
>               return ERROR_FAIL;
>       }
>
> @@ -169,7 +169,8 @@ static int libxl__device_pci_remove_xenstore(libxl__gc *gc, uint32_t domid, libx
>           return ERROR_FAIL;
>
>       if (domtype == LIBXL_DOMAIN_TYPE_PV) {
> -        if (libxl__wait_for_backend(gc, be_path, "4") < 0) {
> +        if (libxl__wait_for_backend_deprecated(gc, be_path, "4", "6", (char*)0)
> +            < 0) {
>               LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "pci backend at %s is not ready", be_path);
>               return ERROR_FAIL;
>           }
> @@ -198,7 +199,8 @@ retry_transaction:
>               goto retry_transaction;
>
>       if (domtype == LIBXL_DOMAIN_TYPE_PV) {
> -        if (libxl__wait_for_backend(gc, be_path, "4") < 0) {
> +        if (libxl__wait_for_backend_deprecated(gc, be_path, "4", "6", (char*)0)
> +            < 0) {
>               LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "pci backend at %s is not ready", be_path);
>               return ERROR_FAIL;
>           }
>
The last one does apply cleanly - even without any offset.

[-- Attachment #2: libxl_device.c.7z --]
[-- Type: application/octet-stream, Size: 8161 bytes --]

[-- Attachment #3: libxl_internal.h.7z --]
[-- Type: application/octet-stream, Size: 28765 bytes --]

[-- Attachment #4: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2014-03-20  2:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5325B828.1060303@web2web.at>
     [not found] ` <1395050430.4122.29.camel@kazak.uk.xensource.com>
     [not found]   ` <53273B3C.40707@web2web.at>
2014-03-18 10:15     ` [Xen-users] substantial shutdown delay for PV guests with PCI -passthrough Ian Campbell
2014-03-18 13:01       ` Atom2
2014-03-18 15:07         ` Ian Campbell
2014-03-19  0:25           ` Atom2
2014-03-19 11:26             ` Ian Campbell
2014-03-19 13:00               ` Konrad Rzeszutek Wilk
2014-03-19 14:03                 ` Atom2
2014-03-19 15:45                   ` Ian Jackson
2014-03-20  2:31                     ` Atom2 [this message]
2014-03-20 11:52                       ` Ian Jackson
2014-03-20 13:53                         ` Pasi Kärkkäinen
2014-03-20 15:28                           ` Ian Jackson
2014-03-20 19:34                           ` Atom2
2014-03-20 19:32                         ` Atom2
2014-03-21 18:11                           ` Ian Jackson
2014-03-21 19:39                             ` Atom2
2014-04-02 14:44                               ` Ian Jackson
2014-04-02 15:17                                 ` Atom2
2014-04-18 21:47                                   ` Atom2
2014-04-19  0:12                                     ` Konrad Rzeszutek Wilk
2014-04-19 18:59                                       ` Atom2
2014-04-22 10:44                                         ` George Dunlap
2014-04-22 12:02                                           ` Atom2

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=532A530D.1050504@web2web.at \
    --to=ariel.atom2@web2web.at \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xen-users@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).