From: Ian Jackson Subject: Re: [PATCH v15 2/7] remus: introduce remus device Date: Thu, 10 Jul 2014 17:35:25 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="_509c722e-f9f2-431d-826c-8227f95f3111_" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Hongyang Yang Cc: laijs@cn.fujitsu.com, wency@cn.fujitsu.com, andrew.cooper3@citrix.com, yunhong.jiang@intel.com, eddie.dong@intel.com, xen-devel@lists.xen.org, rshriram@cs.ubc.ca, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org --_509c722e-f9f2-431d-826c-8227f95f3111_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xen-devel-bounces@lists.xen.org On-Behalf-Of: Ian.Jackson@eu.citrix.com Subject: Re: [Xen-devel] [PATCH v15 2/7] remus: introduce remus device Message-Id: <21438.52873.790154.902193@mariner.uk.xensource.com> Recipient: ibudiman@overstock.com --_509c722e-f9f2-431d-826c-8227f95f3111_ Content-Type: message/rfc822 Received: from omx01.overstock.com (10.4.108.254) by outlook.overstock.com (10.4.46.136) with Microsoft SMTP Server id 14.3.158.1; Thu, 10 Jul 2014 11:35:25 -0600 Received: from localhost (unknown [127.0.0.1]) by omx01.overstock.com (Postfix) with ESMTP id 6FEDB200012 for ; Thu, 10 Jul 2014 11:35:25 -0600 (MDT) X-Quarantine-ID: X-Virus-Scanned: by amavisd-new at overstock.com X-Spam-Flag: YES X-Spam-Score: 5.01 X-Spam-Level: ***** X-Spam-Status: Yes, score=5.01 tagged_above=2.5 required=3.5 tests=[AWL=0.033, FH_DATE_PAST_20XX=2.075, RDNS_NONE=0.1, UNPARSEABLE_RELAY=0.001, UNRESOLVED_TEMPLATE=2.801] Received: from omx01.overstock.com ([127.0.0.1]) by localhost (omx01.overstock.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XPpsCK2E+fKr for ; Thu, 10 Jul 2014 11:35:25 -0600 (MDT) Received: from mail217-ch1-R.bigfish.com (unknown [173.241.154.126]) by omx01.overstock.com (Postfix) with ESMTP id 2C4F5200011 for ; Thu, 10 Jul 2014 11:35:25 -0600 (MDT) Received: from mail217-ch1 (localhost [127.0.0.1]) by mail217-ch1-R.bigfish.com (Postfix) with ESMTP id DC4591E016A for ; Thu, 10 Jul 2014 17:35:24 +0000 (UTC) X-Forefront-Antispam-Report: CIP:50.57.142.19;KIP:(null);UIP:(null);IPV:NLI;H:lists.xen.org;RD:lists.xen.org;EFVD:NLI X-SpamScore: 19 X-BigFish: vps19(zzbb2dI98dI9371I1432I4015Izz1f42h272I1ee6h1de0h2073h2146h1202h1e76h2189h1d1ah1d2ah1fc6h208ch1fdahzz1de098h17326ah8275dh1de097h186068hz2dh74hfI11Ieh2a8h839h944h1220h1239h1288h12a5h12a9h137ah139eh13b6h13eah1441h1504h1537h15beh162dh1631h16a6h1758h1898h18b6h18bch18e1h1946h19b5h19ceh1b0ah2222h224fh1d0ch1d2eh1d3fh1dffh1e00h1e1dh1e23h1ea5h1fe8h1ff5h20bbh2218h2216h226dh22d0h24afh2327h2438h2461h2487h24ach24d7h2516h2545h255eh25f6h2605h262fh268bh26d3h27e2h282bh2847h28b0h29d0h2b05h1b5bi224cir) X-CustomSpam: This message was filtered by custom spam filter option - Sender SPF none X-FFO-Routing-Override: overstock.com%overstock-41607.customer.frontbridge.com; Received: from mail217-ch1 (localhost.localdomain [127.0.0.1]) by mail217-ch1 (MessageSwitch) id 1405013721833580_23520; Thu, 10 Jul 2014 17:35:21 +0000 (UTC) Received: from CH1EHSMHS025.bigfish.com (snatpool3.int.messaging.microsoft.com [10.43.68.227]) by mail217-ch1.bigfish.com (Postfix) with ESMTP id BDAFB3C0052 for ; Thu, 10 Jul 2014 17:35:21 +0000 (UTC) Received: from lists.xen.org (50.57.142.19) by CH1EHSMHS025.bigfish.com (10.43.70.25) with Microsoft SMTP Server (TLS) id 14.16.227.3; Thu, 10 Jul 2014 17:35:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X5IEU-0006jk-NA; Thu, 10 Jul 2014 17:34:10 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X5IET-0006jT-IQ for xen-devel@lists.xen.org; Thu, 10 Jul 2014 17:34:09 +0000 Received: from [85.158.137.68:35764] by server-11.bemta-3.messagelabs.com id 3F/FC-12889-09ECEB35; Thu, 10 Jul 2014 17:34:08 +0000 X-Env-Sender: Ian.Jackson@citrix.com X-Msg-Ref: server-13.tower-31.messagelabs.com!1405013646!15231588!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26666 invoked from network); 10 Jul 2014 17:34:08 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-13.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 10 Jul 2014 17:34:08 -0000 X-IronPort-AV: E=Sophos;i="5.01,638,1400025600"; d="scan'208";a="151475844" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 10 Jul 2014 17:34:06 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Thu, 10 Jul 2014 13:34:05 -0400 Received: from mariner.uk.xensource.com ([10.80.2.22]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1X5IEO-0002Ze-VX; Thu, 10 Jul 2014 18:34:04 +0100 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.80) (envelope-from ) id 1X5IEN-0005OV-91; Thu, 10 Jul 2014 18:34:03 +0100 From: Ian Jackson MIME-Version: 1.0 Message-ID: <21438.52873.790154.902193@mariner.uk.xensource.com> Date: Thu, 10 Jul 2014 18:34:01 +0100 To: Hongyang Yang In-Reply-To: <53BDF80F.7030307@cn.fujitsu.com> References: <1404721584-17862-1-git-send-email-yanghy@cn.fujitsu.com> <1404721584-17862-3-git-send-email-yanghy@cn.fujitsu.com> <21437.31542.967350.687109@mariner.uk.xensource.com> <53BDF80F.7030307@cn.fujitsu.com> X-Mailer: VM 8.1.0 under 23.4.1 (i486-pc-linux-gnu) X-DLP: MIA2 CC: , , , , , , , Subject: Re: [Xen-devel] [PATCH v15 2/7] remus: introduce remus device X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: Errors-To: xen-devel-bounces@lists.xen.org Return-Path: xen-devel-bounces@lists.xen.org X-MS-Exchange-Organization-OriginalArrivalTime: 10 Jul 2014 17:35:25.2438 (UTC) X-MS-Exchange-Forest-ArrivalHubServer: OCCASHUB01.overstock.com X-MS-Exchange-Organization-OriginalClientIPAddress: 10.4.108.254 X-MS-Exchange-Organization-OriginalServerIPAddress: 10.4.46.136 X-MS-Exchange-Organization-AuthSource: OCCASHUB01.overstock.com X-MS-Exchange-Organization-AuthAs: Anonymous X-MS-Exchange-Organization-MessageDirectionality: Incoming X-MS-Exchange-Organization-Cross-Premises-Headers-Processed: OCCASHUB01.overstock.com X-MS-Exchange-Organization-OriginalSize: 9721 X-MS-Exchange-Forest-MessageScope: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Organization-MessageScope: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Organization-HygienePolicy: Standard X-MS-Exchange-Organization-Recipient-Limit-Verified: True X-MS-Exchange-Forest-RulesExecuted: OCCASHUB01 X-MS-Exchange-Organization-Rules-Execution-History: Internal Domains Not Junk%%%Drop Lunch :) Emails%%%Outgoing Disclaimer%%%Block to Specific Domains%%%RestrictExternalEmail%%%EDW Reports Disclaimer Hongyang Yang writes ("Re: [PATCH v15 2/7] remus: introduce remus device"): > On 07/10/2014 01:26 AM, Ian Jackson wrote: > > Sorry to mention this now, but I think it would be clearer if all > > these libxl__remus_device_* functions which manipulate _all_ the > > devices for a domain used the plural of "device", ie > > libxl__remus_devices_setup, etc. > > Ok Thanks. You may find git-filter-branch helpful to do this easily. (Be careful not to blow your leg off.) > >> + rds->num_devices++; > >> + /* > >> + * we add devices that have been setuped to the array no matter > >> + * the setup process succeed or failed because we need to ensure > >> + * the device been teardown while setup failed. If any of the > >> + * device setup failed, we will quit remus, but before we exit, > >> + * we will teardown the devices that have been added to **dev > >> + */ > >> + rds->dev[rds->num_set_up++] = dev; > >> + if (rc) { > >> + /* setup failed */ > >> + rs->saved_rc = ERROR_FAIL; > >> + } > > > > This doesn't look right. If the setup fails, presumably we shouldn't > > put the device in the array ? If we do it will presumably be torn > > down later. > > the netbuf script was designed as below: > 1. when setup failed, the script won't teardown the device itself. > 2. the teardown op is ok to be excute many times. Aha. Right. I think you should state exactly that, probably in a comment here and also in the script itself. This can replace the comment you have above, which is rather vague. > In the remus device layer, if one device setup failed(whether script > exit or the script get killed or something), we will quit > remus, but before that, we will teardown all device that has been set > up, whether it's correctly set up or not. So if we don't put the > device in the array, we will get a leaked device, that has not been > teardown. That makes sense. > > I still don't understand why libxl__remus_device_state is not part of > > libxl__remus_state. > > libxl__remus_device_state is part of libxl__remus_state: > +struct libxl__remus_state { ... > + libxl__remus_device_state dev_state; > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I meant: why is it a separate structure, rather than the contents simply being included there ? Thanks for your other replies. You don't seem to have replied to everything I said, including some questions I asked. Do you intend to, later, perhaps ? Thanks, Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --_509c722e-f9f2-431d-826c-8227f95f3111_ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --_509c722e-f9f2-431d-826c-8227f95f3111_--