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

[Xen-devel] [PATCH] Add uuid check to domain creation

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Add uuid check to domain creation
From: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Date: Thu, 06 Jul 2006 21:29:08 +0900
Delivery-date: Thu, 06 Jul 2006 05:30:19 -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
Hi,

This patch prevents uuid double use. A check_uuid() in this patch 
checks on uuid of the VM configuration definition. If specified 
uuid is already used with the others VM, the xm create command 
does not create the VM. The xm create command error occurs.

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

Best regards,
 Kan

---------
When I found the problem of uuid, operations were as follows.

I created VM with the following VM configuration definitions.
(I specified the same uuid.)

uuid1.conf:
 kernel = "/boot/vmlinuz-2.6-xenU"
 memory = 256
 name = "vm1"
 disk = [ 'file:/xen/xen-test/image/rhel4_1.img,sda1,w' ]
 vif = [ '' ]
 root = "/dev/sda1 ro"
 uuid = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"

uuid2.conf:
 kernel = "/boot/vmlinuz-2.6-xenU"
 memory = 256
 name = "vm2"
 disk = [ 'file:/xen/xen-test/image/rhel4_2.img,sda1,w' ]
 vif = [ '' ]
 root = "/dev/sda1 ro"
 uuid = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"


The result was as follows.
 - The same uuid is used in domain 1 and domain 2.
 - The domain name of domain 1 was changed from vm1 to vm2.

# xm create /home/kanno/uuid1.conf
Using config file "/home/kanno/uuid1.conf".
Started domain vm1
# xm create /home/kanno/uuid2.conf
Using config file "/home/kanno/uuid2.conf".
Error: an integer is required
# xm list -l
(domain
    (domid 0)
    (uuid 00000000-0000-0000-0000-000000000000)
    (vcpus 2)
    (cpu_weight 1.0)
    (memory 1024)
    (maxmem 1024)
    (features )
    (name Domain-0)
    (on_poweroff destroy)
    (on_reboot restart)
    (on_crash restart)
    (state r-----)
    (shutdown_reason poweroff)
    (cpu_time 34.941371157)
    (online_vcpus 2)
)
(domain
    (domid 1)
    (uuid aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa)
    (vcpus 1)
    (cpu_weight 1.0)
    (memory 256)
    (maxmem 256)
    (features )
    (name vm2)
    (on_poweroff destroy)
    (on_reboot restart)
    (on_crash restart)
    (image (linux (kernel /boot/vmlinuz-2.6-xenU) (root '/dev/sda1 ro')))
    (device (vif (backend 0) (script vif-bridge) (mac 00:16:3e:17:14:cb)))
    (device
        (vbd
            (backend 0)
            (dev sda1)
            (uname file:/xen/xen-test/image/rhel4_1.img)
            (mode w)
        )
    )
    (state -b----)
    (shutdown_reason poweroff)
    (cpu_time 3.610959097)
    (online_vcpus 1)
    (up_time 78.2889318466)
    (start_time 1151666985.97)
    (store_mfn 1048657)
    (console_mfn 1048656)
)
(domain
    (domid 2)
    (uuid aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa)
    (vcpus 1)
    (cpu_weight 1.0)
    (memory 256)
    (maxmem 256)
    (features )
    (name vm2)
    (on_poweroff destroy)
    (on_reboot restart)
    (on_crash restart)
    (image (linux (kernel /boot/vmlinuz-2.6-xenU) (root '/dev/sda1 ro')))
    (device (vif (backend 0) (script vif-bridge) (mac 00:16:3e:7e:ee:5c)))
    (device
        (vbd
            (backend 0)
            (dev sda1)
            (uname file:/xen/xen-test/image/rhel4_2.img)
            (mode w)
        )
    )
    (state --p---)
    (shutdown_reason poweroff)
    (cpu_time 0.0)
    (online_vcpus 1)
    (up_time 14.7986199856)
    (start_time 1151667049.47)
    (store_mfn 737361)
    (console_mfn 737360)
)

Attachment: uuid_check.patch
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Add uuid check to domain creation, Masaki Kanno <=