From f993b860604b9524c2c8230c36fb8b91b0c321bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Jourdois?= Date: Sat, 30 Oct 2010 16:11:55 +0200 Subject: [PATCH 1/4] Temporary fix for disk device checks The check for disk devices was completly broken, fix it temporarily. This check is also kinda wrong, but is still an improvement over the current test, so submit it waiting for a better idea. --- TODO | 13 +++++++++++++ bin/xen-create-image | 4 ++-- etc/xen-tools.conf | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 972d5ca..20fad5e 100644 --- a/TODO +++ b/TODO @@ -28,6 +28,19 @@ Bugs to fix and features to add for 5.0 are examples, and shouldn't cover every single scenario. They are also easy to write. +* Think again about disk_device checks : + + Newer Xen provides "xvda", older provided "sda". The current check for + valid values of disk_device (used for root device in domU /etc/fstab) + does only allow those values. + This forbids any deployment of LVM/RAID _inside_ domU, which cannot + be created by xen-tools anyway. So the current check is fine with the + current possibilities of xen-tools, but could become a limitation. + - Is it possible/wanted to "query" xend for default device names ? + - Is it possible to create /dev/mapper devices with xend conf ? + - Can we just avoid to ask for this value and not specify the device + in /etc/fstab (and use /dev/root, /dev/by-uuid, or anything ?) + * xen-create-image --dist=... / sources.list generation should be more fine-grained xen-tools should offer the possibility to enable/disable diff --git a/bin/xen-create-image b/bin/xen-create-image index af4d4f5..06b8e92 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -1553,8 +1553,8 @@ sub checkOption message => "must be a serial device (tty*, hvc* or xvc*).\n", }, diskDev => { - check => qr/^(?:\/dev\/)?(?:tty|hvc)[0-9]+$/, - message => "must be a disk device (tty*, hvc*).\n", + check => qr/^(?:\/dev\/)?(?:xvd|sd)[a-z][0-9]+$/, + message => "must be a disk device (xvd*, sd*).\n", }, ipv4 => { check => qr/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, diff --git a/etc/xen-tools.conf b/etc/xen-tools.conf index cdb9e75..d606c9d 100644 --- a/etc/xen-tools.conf +++ b/etc/xen-tools.conf @@ -298,7 +298,7 @@ btrfs_options = defaults # # If you're using the lenny or later version of the Xen guest kernel you will # need to make sure that you use 'hvc0' for the guest serial device, -# and 'xvdX' instead of 'sdX' for serial devices. +# and 'xvdX' instead of 'sdX' for disk devices. # # You may specify the things to use here: # From 31ce92ed7ab0b8da4e89f6b9e91152b86752085c Mon Sep 17 00:00:00 2001 From: Dmitry Nedospasov Date: Mon, 18 Apr 2011 22:55:00 +0200 Subject: [PATCH 2/4] Minor fix: disk_device check --- bin/xen-create-image | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/xen-create-image b/bin/xen-create-image index 06b8e92..1b436b9 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -1553,7 +1553,7 @@ sub checkOption message => "must be a serial device (tty*, hvc* or xvc*).\n", }, diskDev => { - check => qr/^(?:\/dev\/)?(?:xvd|sd)[a-z][0-9]+$/, + check => qr/^(?:\/dev\/)?(?:xvd|sd)[a-z]+$/, message => "must be a disk device (xvd*, sd*).\n", }, ipv4 => { From 7dd416a57a36c88579db58c426ec30609380ff36 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Tue, 19 Apr 2011 23:14:52 +0200 Subject: [PATCH 3/4] Document valid values for serialDev and diskDev more precise --- bin/xen-create-image | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/xen-create-image b/bin/xen-create-image index 1b436b9..35e10d0 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -1550,11 +1550,11 @@ sub checkOption }, serialDev => { check => qr/^(?:\/dev\/)?(?:tty|[xh]vc)[0-9]+$/, - message => "must be a serial device (tty*, hvc* or xvc*).\n", + message => "must be a serial device (tty[0-9]+, hvc[0-9]+ or xvc[0-9]+).\n", }, diskDev => { check => qr/^(?:\/dev\/)?(?:xvd|sd)[a-z]+$/, - message => "must be a disk device (xvd*, sd*).\n", + message => "must be a disk device (xvd[a-z]+, sd[a-z]+).\n", }, ipv4 => { check => qr/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, From 8206a3c4be1aafe7a2b8d65d1b68522719d6fb65 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Tue, 19 Apr 2011 23:47:26 +0200 Subject: [PATCH 4/4] Mention fixed bug around disk_device in changelog --- debian/changelog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ea73ec4..b35b050 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ xen-tools (4.2.1+dev-1) UNRELEASED; urgency=low * New upstream snapshot + - Correctly checks and documents valid values for + disk_device. (Closes: #621499) - -- Axel Beckert Thu, 17 Mar 2011 02:56:41 +0100 + -- Axel Beckert Tue, 19 Apr 2011 23:19:35 +0200 xen-tools (4.2.1-1) unstable; urgency=low