xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Juergen Gross <jgross@suse.com>
Cc: wei.liu2@citrix.com, stefano.stabellini@eu.citrix.com,
	George.Dunlap@eu.citrix.com, ian.jackson@eu.citrix.com,
	cyliu@suse.com, xen-devel@lists.xen.org
Subject: Re: [PATCH v2 2/3] libxl: add new pvusb backend "qusb" provided by qemu
Date: Tue, 29 Mar 2016 10:24:54 -0400	[thread overview]
Message-ID: <20160329142454.GF10298@char.us.oracle.com> (raw)
In-Reply-To: <56FA0A32.8080807@suse.com>

> >> +static int usbback_is_loaded(libxl__gc *gc)
> >> +{
> >> +    int r;
> >> +    struct stat st;
> >> +
> >> +    r = lstat(SYSFS_USBBACK_DRIVER, &st);
> >> +
> >> +    if (r == 0)
> >> +        return 1;
> >> +    if (r < 0 && errno == ENOENT)
> >> +        return 0;
> > 
> > I believe the CODING STYLE in libxl asks for you to use { } for these
> > ones.
> 
> No, it doesn't:
> 
> Quote from tools/libxl/CODING_STYLE:
> 
> 5. Block structure
> 
> Every indented statement is braced apart from blocks that contain just
> one statement.

You are right. I am so used to 'if (..) else'!
> 
> > 
> >> +    LOGE(ERROR, "Accessing %s", SYSFS_USBBACK_DRIVER);
> > 
> > Why is this an error?
> 
> What else? We can't determine whether the driver is loaded or not.
> ENOENT is tested above, so it must be something weird.

Or it could be EPERM.
> 
> > 
> >> +    return -1;

Which results in the code assuming (the caller of this function)
it is an kernel driver. Is that OK? Or should we bail out completly?

> >> +}
> >> +
> > 
> > Otherwise looks OK to me.
> 
> Thanks,
> 
> Juergen
> 

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

  reply	other threads:[~2016-03-29 14:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22  7:29 [PATCH v2 0/3] libxl: add support for qemu base pvusb backend Juergen Gross
2016-03-22  7:29 ` [PATCH v2 1/3] libxl: make libxl__need_xenpv_qemu() operate on domain config Juergen Gross
2016-03-22  7:29 ` [PATCH v2 2/3] libxl: add new pvusb backend "qusb" provided by qemu Juergen Gross
2016-03-28 14:55   ` Konrad Rzeszutek Wilk
2016-03-29  4:53     ` Juergen Gross
2016-03-29 14:24       ` Konrad Rzeszutek Wilk [this message]
2016-03-29 14:28         ` Juergen Gross
2016-03-22  7:29 ` [PATCH v2 3/3] libxl: add domain config parameter to force start of qemu Juergen Gross
2016-03-28 14:50   ` Konrad Rzeszutek Wilk
2016-03-29  4:44     ` Juergen Gross
2016-03-29 14:27       ` Konrad Rzeszutek Wilk
2016-03-29 14:32         ` Juergen Gross
2016-03-22 15:31 ` [PATCH v2 0/3] libxl: add support for qemu base pvusb backend Juergen Gross

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=20160329142454.GF10298@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=cyliu@suse.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jgross@suse.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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).