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/
Home Products Support Community News


[Xen-devel] [PATCH] Fix xm block/network-detach command

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix xm block/network-detach command
From: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Date: Fri, 03 Aug 2007 14:20:37 +0900
Cc: jfehlig@xxxxxxxxxx, mats@xxxxxxxxxxxxxxxxx
Delivery-date: Thu, 02 Aug 2007 22:18:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

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
            (mac 00:16:3e:75:96:d8)
            (uuid ebd29601-41ac-75de-87cd-2ae051fa8719)
            (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.  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. 


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. 

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>

Best regards,

Attachment: xm_block_detach.patch
Description: Binary data

Xen-devel mailing list