From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Subject: Re: [PATCH v1 12/12] libxl: add device backend listener in order to launch backends Date: Wed, 6 Nov 2013 14:02:13 +0100 Message-ID: <527A3DD5.8090203@citrix.com> References: <1380705874-58491-1-git-send-email-roger.pau@citrix.com> <1380705874-58491-13-git-send-email-roger.pau@citrix.com> <21105.15127.428243.701439@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Ve2kU-0006H3-7o for xen-devel@lists.xenproject.org; Wed, 06 Nov 2013 13:02:18 +0000 In-Reply-To: <21105.15127.428243.701439@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: xen-devel@lists.xenproject.org, Ian Campbell List-Id: xen-devel@lists.xenproject.org On 30/10/13 18:00, Ian Jackson wrote: > Roger Pau Monne writes ("[PATCH v1 12/12] libxl: add device backend listener in order to launch backends"): >> + LIBXL_SLIST_FOREACH(ddev, &dguest->devices, next) { >> + if (memcmp(ddev->dev, dev, sizeof(*dev)) == 0) >> + return ddev; > > I'm afraid that you can't memcmp a struct like this. structs are > allowed to have padding which may contain junk. All the libxl__device structures have been allocated with libxl__zalloc, which should make the padding be 0 in all cases, but I agree it would be better to do it in a more formal way.