[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
  • 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
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.