WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] xl: avoid creating domains with duplicate names

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xl: avoid creating domains with duplicate names
From: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Date: Thu, 27 Jan 2011 11:24:11 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Thu, 27 Jan 2011 03:24:47 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=aoZCYWR/XeyO/Ax2BoAK83yeYrkfJ5094QUZViDpDAM=; b=Po7riNrCzwjvR79HCIVExq5AH+3mIbgpz8Fev2EPacljKQadUChlzXmRWFjAJ/tXa0 c+pwmGZzp/U0PaepLJS8N9cRbLQPOLbZe6q+qocNyzKkMOCjgT+ot9wLfN3JbzftoyQg XXhk1nPqMZhcMLMMznqtP0gdDk5SrYk3agXR8=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=elUy5HmphBtoUyvmMbdp8csdGBpvZ7qTwBy712007bPVzjEedL28nF097aQmxQnwiD bou+DcqsyqQfHQSub1Xf9qPczSJe/pzp+EXqcOuHJ+XQ/sWKSrFZNlDvBm5Jsp+Y8Lv8 ELv/waDyiIhf0PSIP9B7IRe2kWRemONgi8vH8=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19776.3691.403757.674254@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <alpine.DEB.2.00.1101251513450.7277@kaball-desktop> <19775.5294.633111.397575@xxxxxxxxxxxxxxxxxxxxxxxx> <alpine.DEB.2.00.1101261031120.7277@kaball-desktop> <19776.3311.59844.705280@xxxxxxxxxxxxxxxxxxxxxxxx> <19776.3691.403757.674254@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Looks like this patch is causing failures in guest-localmigrate:

2011-01-27 03:06:09 Z executing ssh ... root@xxxxxxxxxxxx xl migrate
debian.guest.osstest localhost
migration target: Ready to receive domain.
Saving to migration stream new xl format (info 0x0/0x0/774)
Loading new save file incoming migration stream (new xl fmt info 0x0/0x0/774)
 Savefile contains xl domain config
A domain with name "debian.guest.osstest" already exists.
xc: error: write: p2m_size (32 = Broken pipe): Internal error
libxl: error: libxl_dom.c:444:libxl__domain_suspend_common saving
domain: Broken pipe
migration sender: libxl_domain_suspend failed (rc=-3)
libxl: info: libxl_exec.c:70:libxl_report_child_exitstatus migration
target process [20216] exited with error status 1
Migration failed, resuming at sender.

Do we need to special-case local migration?

 -George

On Wed, Jan 26, 2011 at 12:07 PM, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> wrote:
> I wrote:
>> OK, thanks, I'll take that as an ack.  I have applied my patch and
>> will post a revised version of yours on a moment.
>
> TBH I think this restriction should be in libxl (in
> libxl_domain_rename), rather than in xl.  But that would require too
> intrusive a set of changes at this stage.
>
>
> xl: avoid creating domains with duplicate names
>
> Do not create the domain if another domain with the same name is already
> running.
>
> This is another error-checking function at rather too high a level:
> this should be moved into libxl_domain_rename in 4.2.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
>
> diff -r 67d5b8004947 tools/libxl/xl_cmdimpl.c
> --- a/tools/libxl/xl_cmdimpl.c  Wed Jan 26 11:58:45 2011 +0000
> +++ b/tools/libxl/xl_cmdimpl.c  Wed Jan 26 12:02:37 2011 +0000
> @@ -583,6 +583,7 @@ static void parse_config_data(const char
>     XLU_ConfigList *vbds, *nics, *pcis, *cvfbs, *net2s, *cpuids;
>     int pci_power_mgmt = 0;
>     int pci_msitranslate = 1;
> +    uint32_t domid_e;
>     int e;
>
>     libxl_domain_create_info *c_info = &d_config->c_info;
> @@ -612,6 +613,15 @@ static void parse_config_data(const char
>
>     if (xlu_cfg_replace_string (config, "name", &c_info->name))
>         c_info->name = strdup("test");
> +    e = libxl_name_to_domid(&ctx, c_info->name, &domid_e);
> +    if (!e) {
> +        fprintf(stderr, "A domain with name \"%s\" already exists.\n", 
> c_info->name);
> +        exit(1);
> +    }
> +    if (e != ERROR_INVAL) {
> +        fprintf(stderr, "Unexpected error checking for existing domain"
> +                " (error=%d)", e);
> +    }
>
>     if (!xlu_cfg_get_string (config, "uuid", &buf) ) {
>         if ( libxl_uuid_from_string(&c_info->uuid, buf) ) {
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel