From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Pau Monne Subject: Re: [PATCH v9 16/17] libxl: convert libxl_device_vkb_add to an async operation Date: Fri, 20 Jul 2012 12:00:01 +0100 Message-ID: <50093A31.3010404@citrix.com> References: <1342172696-88347-1-git-send-email-roger.pau@citrix.com> <1342172696-88347-17-git-send-email-roger.pau@citrix.com> <20488.14185.962905.269760@mariner.uk.xensource.com> <5008389F.4060401@citrix.com> <20489.14294.391006.844801@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20489.14294.391006.844801@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.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Jackson wrote: > Roger Pau Monne writes ("Re: [PATCH v9 16/17] libxl: convert libxl_device_vkb_add to an async operation"): >> Ian Jackson wrote: > ... >>> This is rather unfriendly - doesn't it amount to aborting on an >>> invalid domain configuration. And I'm not sure I understand the >>> logic, which is new in your patch. >> This was part of the previous code, but this was done inside of a switch >> instead of an if. Since it's not possible to specify vkb devices in the >> config file (at least xl.cfg(5) doesn't mention anything about vkbs), >> I'm quite sure d_config->vkbs == NULL and d_config->num_vkbs == 0 always >> or something has gone extremely wrong, just added the abort to be sure. > > People who write other code which calls libxl might try to pass vkbds, > but then the code would crash. And if they didn't test it with HVM > domains, they wouldn't notice that their code had a crash bug. > > I think it should cause the creation to fail with ERROR_INVAL. I've been thinking about this and I think that maybe we should only perform this piece of code if num_vkbs is 0, so we make sure there's at least one vkb device, but not fail if num_vkbs > 0.