[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: preliminary patch towards XEN virtual disk naming



On Sun, 2008-04-06 at 15:18 +0200, Ferenc Wagner wrote:
> Ferenc Wagner <wferi@niif.hu> writes:
> 
> > So here's something to discuss.  This is how it used to look like:
> 
> OMG, something totally unrelated sneaked into the attached patch,
> consider this instead:

Thanks Ferenc, I've commented on #474556.

Do you have plans to work on D-I for Xen extensively? If so we should
sync up.

> 
> >  * libparted should also recognize the device type, which isn't much
> >    of a problem (based on a cursory look at the sources).  But that
> >    would just duplicate the info on the line at best.  Probably
> >    something else is needed...  But what?
> 
> Current git parted alread recognizes such devices as "Xen Virtual
> Block Device".  Which is basically the content of the above template.
> What's customary in this case?

I've been wondering that myself.

Ian.

-- 
Ian Campbell

The man who raises a fist has run out of ideas.
		-- H. G. Wells, "Time After Time"
Index: packages/partman/partman-base/debian/changelog
===================================================================
--- packages/partman/partman-base/debian/changelog	(revision 51905)
+++ packages/partman/partman-base/debian/changelog	(working copy)
@@ -19,8 +19,11 @@
     components have now been uploaded.
   * Change "initialise" to American English spelling (-ize).
 
- -- Frans Pop <fjp@debian.org>  Fri, 07 Mar 2008 21:13:18 +0100
+  [ Ian Campbell ]
+  * Support Xen Virtual Disk devices.
 
+-- Frans Pop <fjp@debian.org>  Fri, 07 Mar 2008 21:13:18 +0100
+
 partman-base (116) unstable; urgency=low
 
   [ Stephen R. Marenka ]
Index: packages/partman/partman-base/debian/partman-base.templates
===================================================================
--- packages/partman/partman-base/debian/partman-base.templates	(revision 51905)
+++ packages/partman/partman-base/debian/partman-base.templates	(working copy)
@@ -336,6 +336,16 @@
 # :sl5:
 _Description: DASD %s (%s), partition #%s
 
+Template: partman/test/xvd_disk
+Type: text
+# For example: Xen Virtual Disk 0 (xvda)
+_Description: Xen Virtual Disk %s (%s)
+
+Template: partman/test/xvd_partition
+Type: text
+# For example: Xen Virtual Disk 0, partition 1 (xvda)
+_Description: Xen Virtual Disk %s, partition %s (%s)
+
 Template: partman/text/cancel_menu
 Type: text
 # :sl1:
Index: packages/partman/partman-base/lib/base.sh
===================================================================
--- packages/partman/partman-base/lib/base.sh	(revision 51905)
+++ packages/partman/partman-base/lib/base.sh	(working copy)
@@ -605,6 +605,21 @@
 	    fi
 	    printf "$RET" "$(($drive / 2 + 1))" "$part" "$linux"
 	    ;;
+	/dev/xvd[a-z])
+	    drive=$(printf '%d' "'$(echo $1 | sed 's,^/dev/xvd\([a-z]\).*,\1,')")
+	    drive=$(($drive - 97))
+	    linux=${1#/dev/}
+	    db_metaget partman/test/xvd_disk description
+	    printf "$RET" "${drive}" "${linux}"
+	    ;;
+	/dev/xvd[a-z][0-9]*)
+	    drive=$(printf '%d' "'$(echo $1 | sed 's,^/dev/xvd\([a-z]\).*,\1,')")
+	    drive=$(($drive - 97))
+	    part=$(echo $1 | sed 's,^/dev/xvd[a-z]\([0-9][0-9]*\).*,\1,')
+	    linux=${1#/dev/}
+	    db_metaget partman/test/xvd_partition description
+	    printf "$RET" "${drive}" "${part}" "${linux}"
+	    ;;
 	/dev/scsi/host*/bus*/target*/lun*/disc)
 	    host=`echo $1 | sed 's,/dev/scsi/host\(.*\)/bus.*/target.*/lun.*/disc,\1,'`
 	    bus=`echo $1 | sed 's,/dev/scsi/host.*/bus\(.*\)/target.*/lun.*/disc,\1,'`

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: