All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@novell.com>
To: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Cc: xen-devel@lists.xensource.com, mats@planetcatfish.com
Subject: Re: [PATCH] Fix xm block/network-detach command
Date: Fri, 03 Aug 2007 14:48:36 -0600	[thread overview]
Message-ID: <46B394A4.5060708@novell.com> (raw)

Masaki Kanno wrote:
> Hi,
>
> This patch fixes a few problem of xm block/network-detach command. 
>
> At first, when I tested xm block/network-detach command to a inactive 
> managed domain, I saw the following error messages. 
>
> # xm new /xen/vm1.conf
> Using config file "/xen/vm1.conf".
> # xm list --long vm1
> (domain
>  <snip>
>     (device
>         (vif
>             (mac 00:16:3e:75:96:d8)
>             (uuid ebd29601-41ac-75de-87cd-2ae051fa8719)
>         )
>     )
>     (device
>         (vbd
>             (uuid 7572ae87-5706-217a-3fa5-f68496e147c1)
>             (bootable 1)
>             (driver paravirtualised)
>             (dev hda1)
>             (uname file:/xen/rhel4u2.root.img-vm1)
>             (mode w)
>         )
>     )
> )
> # xm block-detach vm1 hda1
> Error: Device hda1 not connected
> Usage: xm block-detach <Domain> <DevId> [-f|--force]
>
> Destroy a domain's virtual block device.
> # xm network-detach vm1 0
> Error: (22, 'Invalid argument, while reading None/device/vif/0/backend')
> Usage: xm network-detach <Domain> <DevId> [-f|--force]
>
> Destroy a domain's virtual network device.
>
>
> I was able to fix the problem of inactive managed domains by writing 
> a small patch.

This brings up a broader question concerning managed domains. What is
the behavior when changing config of a managed domain?

a)
- persist change to store and modify domain if live

b)
- explicitly change live config
- explicitly change stored config

Some of the xm commands support a). That would be behavior of
block-detach with this patch.

It appears Xen API supports b) given the *_live, plug, and unplug
operations defined in the spec. I have noticed this to be the case for
some resource types, but doubt it is consistent across all resource
types - let alone both Xen API and legacy sxpr interfaces.

IMO, since xen itself now supports managed domains it should be possible
to independently change live and stored config. I should be able to feed
a starving domain but have it revert to default (define by me) settings
when reset. That said I think it will be considerable work, particularly
testing, to ensure this behavior across all resource types and xend
interfaces.

>   However, I found a other problem in xm block/network-
> detach command when I tested xm block/network-detach command more. 
> The other problem is the same as the problem that Mats reported in 
> the following. 
>
> http://lists.xensource.com/archives/html/xen-devel/2007-08/msg00040.html
>   

That patch did not cause any problems with save.

> This patch fixes the other problem as follows. 
>  - To remove device info, it waits for the backend path of the device 
>    to be removed. 
>  - It removes device info from domain info. 
>  - It saves domain info to the config.sxp of the managed domain. 
>   

This changes behavior between block-attach and block-detach. In
block-detach, the device is removed from store and unplugged from domain
if live. For block-attach, the operation fails if domain is inactive. If
domain is active, device is plugged but not persisted to store.

We need to agree on behavior when changing config of managed domains and
then set out on the (perhaps time consuming) path of realizing that
behavior.

Thoughts?
Jim

             reply	other threads:[~2007-08-03 20:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-03 20:48 Jim Fehlig [this message]
2007-08-06 11:52 ` [PATCH] Fix xm block/network-detach command Masaki Kanno
2007-08-07  0:52 ` Jim Fehlig
2007-08-07 10:38   ` Masaki Kanno
2007-08-07 10:40     ` Keir Fraser
  -- strict thread matches above, loose matches on Subject: below --
2007-08-03  5:20 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=46B394A4.5060708@novell.com \
    --to=jfehlig@novell.com \
    --cc=kanno.masaki@jp.fujitsu.com \
    --cc=mats@planetcatfish.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.