From: "Daniel P. Berrange" <berrange@redhat.com>
To: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Cc: Jim Fehlig <jfehlig@novell.com>, xen-devel@lists.xensource.com
Subject: Re: PATCH: Fix name uniqueness check
Date: Fri, 5 Oct 2007 14:35:16 +0100 [thread overview]
Message-ID: <20071005133516.GA17095@redhat.com> (raw)
In-Reply-To: <96C8070F466E36kanno.masaki@jp.fujitsu.com>
[-- Attachment #1: Type: text/plain, Size: 2106 bytes --]
On Fri, Oct 05, 2007 at 02:19:16PM +0900, Masaki Kanno wrote:
> Tue, 2 Oct 2007 15:47:12 +0100, "Daniel P. Berrange" wrote:
>
> >On Tue, Oct 02, 2007 at 10:11:01PM +0900, Masaki Kanno wrote:
> >> Hi Dan,
> >>
> >> Thanks for your effort and your patch.
> >> I think that the allow/reject rules are wonderful. But, I have a few
> >> comments.
> >>
> >>
> >> I agree the rule of the following case.
> >> But, the behavior is (redefine+rename+create), isn't it?
> >
> >Yes, that is actually what it ends up doing, replacing the config for the
> >matching UUID causes a rename.
> >
> >> When I tested the following case, the result was as follows.
> >> I think that we should reject xm new command if same UUID vm is active.
> >
> >I hadn't noticed that, but its easy to special case this particular
> >case / scenario to be rejected. Or we could fix it to correctly rename
> >the existing running VM which might be more user friendly.
> >
> >Either option is a small add-on patch to my previous submissions.
>
> Sorry for delay with replies to your message.
>
> I am worried about changing the configuration of existing running VM.
> But, my worry is vague, and does not have great grounds.
> If UUID is same, maybe we will become possible to change the name of
> the VM and all the configuration of the VM by xm new command, I guess.
>
> If only the config.sxp of the VM is changed by xm new command, and if
> the definition of the config.sxp is reflected after xm shutdown command,
> my worry will be resolved.
Kan, give this patch a try which simply updates the name_label field for
the exsting VM. With this minimal rename it avoids the risk of the same VM
being started twice as you demonstrated
Signed-off-by: Daniel P. Berrange <berrange@redhat.com
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
[-- Attachment #2: xen-active-rename.patch --]
[-- Type: text/plain, Size: 949 bytes --]
diff -r 5f95b278cdbd tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Wed Oct 03 18:15:30 2007 -0400
+++ b/tools/python/xen/xend/XendDomainInfo.py Fri Oct 05 09:33:22 2007 -0400
@@ -229,12 +235,16 @@ def createDormant(domconfig):
@return: A up and running XendDomainInfo instance
@raise XendError: Errors with configuration.
"""
-
+ from xen.xend import XendDomain
+ othervm = XendDomain.instance().domain_lookup_nr(domconfig["uuid"])
log.debug("XendDomainInfo.createDormant(%s)", scrub_password(domconfig))
# domid does not make sense for non-running domains.
domconfig.pop('domid', None)
vm = XendDomainInfo(domconfig)
+ # If there was an existing VM with UUID make sure it is renamed
+ if othervm is not None and othervm.domid is not None:
+ othervm.info["name_label"] = vm.info["name_label"]
return vm
def domain_by_name(name):
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2007-10-05 13:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-27 16:50 PATCH: Fix name uniqueness check Daniel P. Berrange
2007-09-27 17:16 ` Jim Fehlig
2007-09-27 17:39 ` Daniel P. Berrange
2007-09-27 19:42 ` Jim Fehlig
2007-09-27 20:40 ` Daniel P. Berrange
2007-10-01 5:36 ` Keir Fraser
2007-10-01 13:57 ` Daniel P. Berrange
2007-10-01 18:18 ` Daniel P. Berrange
2007-10-01 22:12 ` Daniel P. Berrange
2007-10-02 13:11 ` Masaki Kanno
2007-10-02 14:47 ` Daniel P. Berrange
2007-10-05 5:19 ` Masaki Kanno
2007-10-05 13:35 ` Daniel P. Berrange [this message]
2007-10-05 14:26 ` Masaki Kanno
2007-09-28 3:59 ` Masaki Kanno
2007-09-28 4:56 ` Masaki Kanno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071005133516.GA17095@redhat.com \
--to=berrange@redhat.com \
--cc=jfehlig@novell.com \
--cc=kanno.masaki@jp.fujitsu.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.