* Creating partitions on domain U
@ 2005-01-18 23:46 Eric Tessler
2005-01-19 0:56 ` Mark Williamson
2005-01-19 2:05 ` Jerome Brown
0 siblings, 2 replies; 10+ messages in thread
From: Eric Tessler @ 2005-01-18 23:46 UTC (permalink / raw)
To: xen-devel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 467 bytes --]
Hello,
Does a guest (domain U) have the ability to create partitions on a virtual disk drive (/dev/hda1)? For example, can I use parted/fdisk to create my own partitions on a VBD from within domain U?
Also, does the XEN front-end block driver support any IOCTLs? I looked in the code and it explicitely fails all IOCTLs received from the kernel.
Thanks,
Eric
---------------------------------
Do you Yahoo!?
Meet the all-new My Yahoo! Try it today!
[-- Attachment #2: Type: text/html, Size: 617 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Creating partitions on domain U
2005-01-18 23:46 Creating partitions on domain U Eric Tessler
@ 2005-01-19 0:56 ` Mark Williamson
2005-01-19 2:05 ` Jerome Brown
1 sibling, 0 replies; 10+ messages in thread
From: Mark Williamson @ 2005-01-19 0:56 UTC (permalink / raw)
To: xen-devel; +Cc: Eric Tessler
> Does a guest (domain U) have the ability to create partitions on a virtual
> disk drive (/dev/hda1)? For example, can I use parted/fdisk to create my
> own partitions on a VBD from within domain U?
Yup, should work fine, with the caveat that it's a bit more fiddly viewing
these "partitions" in dom0 (unless the VBD corresponds to a whole disk)
because it won't be expecting to see partitions in a file / another
partition. I don't know what dom0 would make of partitions in LVM volumes.
> Also, does the XEN front-end block driver support any IOCTLs? I looked in
> the code and it explicitely fails all IOCTLs received from the kernel.
Generic block device IOCTLs will be provided by the kernel (whereas in 2.4 the
driver had to do more of this work itself). Anything else (e.g.
CD-ROM-specific ioctls) isn't supported.
Cheers,
Mark
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Creating partitions on domain U
2005-01-18 23:46 Creating partitions on domain U Eric Tessler
2005-01-19 0:56 ` Mark Williamson
@ 2005-01-19 2:05 ` Jerome Brown
2005-01-19 9:31 ` Henning Glawe
1 sibling, 1 reply; 10+ messages in thread
From: Jerome Brown @ 2005-01-19 2:05 UTC (permalink / raw)
To: xen-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Eric Tessler wrote:
| Hello,
|
| Does a guest (domain U) have the ability to create partitions on a
| virtual disk drive (/dev/hda1)? For example, can I use parted/fdisk to
| create my own partitions on a VBD from within domain U?
I assume it does, though I haven't tried it. However I would say to
export the device as the whole disk (eg /dev/hda) as opposed to a
partition (eg /dev/hda1), as parted/fdisk are likely to complain about
trying to partion a partion.
- --
Jerome Brown
Technology Architect
Hub.Net
P: +64 3 961-5116
M: +64 29 453 7663
F: +64 3 961-5129
E: jerome@hub.net.nz
W: http://www.hub.net.nz/
O: Level 4, 818 Colombo St, Christchurch, New Zealand
S: PO Box 1879, Christchurch, New Zealand
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFB7cBU4vUJX2iGcHMRArKXAJ4jb5/5Ia3CVkxfQJGRZPDtY0i+WACdHEUz
EtTOMAGJ8v5CBZ55L3NQrDA=
=fYOM
-----END PGP SIGNATURE-----
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Creating partitions on domain U
2005-01-19 2:05 ` Jerome Brown
@ 2005-01-19 9:31 ` Henning Glawe
0 siblings, 0 replies; 10+ messages in thread
From: Henning Glawe @ 2005-01-19 9:31 UTC (permalink / raw)
To: xen-devel
On Wed, Jan 19, 2005 at 03:05:08PM +1300, Jerome Brown wrote:
> | Does a guest (domain U) have the ability to create partitions on a
> | virtual disk drive (/dev/hda1)? For example, can I use parted/fdisk to
> | create my own partitions on a VBD from within domain U?
>
> I assume it does, though I haven't tried it. However I would say to
> export the device as the whole disk (eg /dev/hda) as opposed to a
> partition (eg /dev/hda1), as parted/fdisk are likely to complain about
> trying to partion a partion.
even that doesn't work: maybe they partition the device (after heavily
complaining about unsupportet ioctls; maybe it's the get-geometry ioctl that
isn't correctly implemented, because also "sfdisk -g /dev/hda" fails).
After partitioning, the kernel-re-read-partitiontable ioctl fails.
shutting down domU and "fdisk -lf $vbdlocation" shows it has been
partitioned.
booting the domU machine again leads to the following situation: the kernel
doesn't see any partitions.
/proc/partitions shows a strange mapping of minor 0 to /dev/hda0 instead of
/dev/hda, no minors are assigned to any partition (but once again, fdisk
/dev/hda sees the partitions).
--
c u
henning
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: Creating partitions on domain U
@ 2005-01-19 10:58 Ian Pratt
2005-01-19 12:36 ` Ian Pratt
0 siblings, 1 reply; 10+ messages in thread
From: Ian Pratt @ 2005-01-19 10:58 UTC (permalink / raw)
To: Henning Glawe, xen-devel
> even that doesn't work: maybe they partition the device (after heavily
> complaining about unsupportet ioctls; maybe it's the
> get-geometry ioctl that
> isn't correctly implemented, because also "sfdisk -g /dev/hda" fails).
Looking at drivers/xen/blkfron/blkfront.c it looks like blkif_ioctl has
been fixed for 2.4 but not for 2.6. I don't see why this isn't in common
code.
Please could you try pulling blkif_ioctl out into the common code
section and deleting the 2.6 specific one.
Thanks,
Ian
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Creating partitions on domain U
2005-01-19 10:58 Ian Pratt
@ 2005-01-19 12:36 ` Ian Pratt
2005-01-19 22:50 ` Ryan Harper
0 siblings, 1 reply; 10+ messages in thread
From: Ian Pratt @ 2005-01-19 12:36 UTC (permalink / raw)
To: Ian Pratt; +Cc: Henning Glawe, xen-devel, Ian.Pratt
> > even that doesn't work: maybe they partition the device (after heavily
> > complaining about unsupportet ioctls; maybe it's the
> > get-geometry ioctl that
> > isn't correctly implemented, because also "sfdisk -g /dev/hda" fails).
>
> Looking at drivers/xen/blkfron/blkfront.c it looks like blkif_ioctl has
> been fixed for 2.4 but not for 2.6. I don't see why this isn't in common
> code.
It turns out that there are a few changes between 2.4 and 2.6
which make sharing the function a bit messy.
Please can you give the attached completely untested patch a
go. If it works, I'll apply it to 2.0-testing.
Thanks,
Ian
--- a/linux-2.6.10-xen-sparse/drivers/xen/blkfront/blkfront.c 2005-01-17 08:11:29.000000000 +0000
+++ b/linux-2.6.10-xen-sparse/drivers/xen/blkfront/blkfront.c 2005-01-19 12:32:51.000000000 +0000
@@ -219,27 +219,113 @@
return 0;
}
-
int blkif_ioctl(struct inode *inode, struct file *filep,
unsigned command, unsigned long argument)
{
- /* struct gendisk *gd = inode->i_bdev->bd_disk; */
+ dev_t dev = inode->i_rdev;
+ struct hd_geometry *geo = (struct hd_geometry *)argument;
+ struct gendisk *gd;
+ struct hd_struct *part;
+ int i, dpart;
+ unsigned short cylinders;
+ byte heads, sectors;
+ /* NB. No need to check permissions. That is done for us. */
+
DPRINTK_IOCTL("command: 0x%x, argument: 0x%lx, dev: 0x%04x\n",
- command, (long)argument, inode->i_rdev);
+ command, (long) argument, dev);
- switch (command) {
+ gd = get_gendisk(dev,&dpart);
+ part = gd->part[MINOR(dev)];
+
+ switch ( command )
+ {
+ case BLKGETSIZE:
+ DPRINTK_IOCTL(" BLKGETSIZE: %x %lx\n", BLKGETSIZE, part->nr_sects);
+ return put_user(part->nr_sects, (unsigned long *) argument);
+
+ case BLKGETSIZE64:
+ DPRINTK_IOCTL(" BLKGETSIZE64: %x %llx\n", BLKGETSIZE64,
+ (u64)part->nr_sects * 512);
+ return put_user((u64)part->nr_sects * 512, (u64 *) argument);
+
+ case BLKRRPART: /* re-read partition table */
+ DPRINTK_IOCTL(" BLKRRPART: %x\n", BLKRRPART);
+ return blkif_revalidate(dev);
+
+ case BLKSSZGET:
+ /* return hardsect_size[MAJOR(dev)][MINOR(dev)]; FIX ME */
+ break;
+
+ case BLKBSZGET: /* get block size */
+ DPRINTK_IOCTL(" BLKBSZGET: %x\n", BLKBSZGET);
+ break;
+
+ case BLKBSZSET: /* set block size */
+ DPRINTK_IOCTL(" BLKBSZSET: %x\n", BLKBSZSET);
+ break;
+
+ case BLKRASET: /* set read-ahead */
+ DPRINTK_IOCTL(" BLKRASET: %x\n", BLKRASET);
+ break;
+
+ case BLKRAGET: /* get read-ahead */
+ DPRINTK_IOCTL(" BLKRAFET: %x\n", BLKRAGET);
+ break;
case HDIO_GETGEO:
- /* return ENOSYS to use defaults */
+ DPRINTK_IOCTL(" HDIO_GETGEO: %x\n", HDIO_GETGEO);
+ if (!argument) return -EINVAL;
+
+ /* We don't have real geometry info, but let's at least return
+ values consistent with the size of the device */
+
+ heads = 0xff;
+ sectors = 0x3f;
+ cylinders = part->nr_sects / (heads * sectors);
+
+ if (put_user(0x00, (unsigned long *) &geo->start)) return -EFAULT;
+ if (put_user(heads, (byte *)&geo->heads)) return -EFAULT;
+ if (put_user(sectors, (byte *)&geo->sectors)) return -EFAULT;
+ if (put_user(cylinders, (unsigned short *)&geo->cylinders)) return -EFAULT;
+
+ return 0;
+
+#if 0 /* This is no longer used in 2.6 */
+ case HDIO_GETGEO_BIG:
+ DPRINTK_IOCTL(" HDIO_GETGEO_BIG: %x\n", HDIO_GETGEO_BIG);
+ if (!argument) return -EINVAL;
+
+ /* We don't have real geometry info, but let's at least return
+ values consistent with the size of the device */
+
+ heads = 0xff;
+ sectors = 0x3f;
+ cylinders = part->nr_sects / (heads * sectors);
+
+ if (put_user(0x00, (unsigned long *) &geo->start)) return -EFAULT;
+ if (put_user(heads, (byte *)&geo->heads)) return -EFAULT;
+ if (put_user(sectors, (byte *)&geo->sectors)) return -EFAULT;
+ if (put_user(cylinders, (unsigned int *) &geo->cylinders)) return -EFAULT;
+
+ return 0;
+#endif
+
+ case CDROMMULTISESSION:
+ DPRINTK("FIXME: support multisession CDs later\n");
+ for ( i = 0; i < sizeof(struct cdrom_multisession); i++ )
+ if ( put_user(0, (byte *)(argument + i)) ) return -EFAULT;
+ return 0;
+
+ case SCSI_IOCTL_GET_BUS_NUMBER:
+ DPRINTK("FIXME: SCSI_IOCTL_GET_BUS_NUMBER ioctl in XL blkif");
return -ENOSYS;
default:
- printk(KERN_ALERT "ioctl %08x not supported by Xen blkdev\n",
- command);
+ printk(KERN_ALERT "ioctl %08x not supported by XL blkif\n", command);
return -ENOSYS;
}
-
+
return 0;
}
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Creating partitions on domain U
2005-01-19 12:36 ` Ian Pratt
@ 2005-01-19 22:50 ` Ryan Harper
0 siblings, 0 replies; 10+ messages in thread
From: Ryan Harper @ 2005-01-19 22:50 UTC (permalink / raw)
To: Ian Pratt; +Cc: xen-devel
* Ian Pratt <Ian.Pratt@cl.cam.ac.uk> [2005-01-19 09:57]:
> Please can you give the attached completely untested patch a
> go. If it works, I'll apply it to 2.0-testing.
Some compile issues:
drivers/built-in.o(.text+0x84396): In function `blkif_ioctl':
: undefined reference to `blkif_revalidate'
make[3]: *** [.tmp_vmlinux1] Error 1
make[3]: Leaving directory `/home/rharper/work/xen/testing/20050119/xen-2.0-testing/linux-2.6.10-xen0'
make[2]: *** [build] Error 2
make[2]: Leaving directory `/home/rharper/work/xen/testing/20050119/xen-2.0-testing'
make[1]: *** [linux-2.6-xen0-build] Error 2
make[1]: Leaving directory `/home/rharper/work/xen/testing/20050119/xen-2.0-testing'
make: *** [linux26] Error 2
Ryan Harper
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: Creating partitions on domain U
@ 2005-01-19 23:22 Ian Pratt
2005-01-20 0:32 ` Adam Heath
0 siblings, 1 reply; 10+ messages in thread
From: Ian Pratt @ 2005-01-19 23:22 UTC (permalink / raw)
To: Ryan Harper, Ian Pratt; +Cc: xen-devel
For the moment, just comment out the references to blkif_revalidate.
Adam: this explains why resize wasn't working for you under 2.6.
Ian
> -----Original Message-----
> From: rharper [mailto:rharper@us.ibm.com] On Behalf Of Ryan Harper
> Sent: 19 January 2005 22:50
> To: Ian Pratt
> Cc: xen-devel@lists.sourceforge.net
> Subject: Re: [Xen-devel] Creating partitions on domain U
>
> * Ian Pratt <Ian.Pratt@cl.cam.ac.uk> [2005-01-19 09:57]:
> > Please can you give the attached completely untested patch a
> > go. If it works, I'll apply it to 2.0-testing.
>
> Some compile issues:
>
> drivers/built-in.o(.text+0x84396): In function `blkif_ioctl':
> : undefined reference to `blkif_revalidate'
> make[3]: *** [.tmp_vmlinux1] Error 1
> make[3]: Leaving directory
> `/home/rharper/work/xen/testing/20050119/xen-2.0-testing/linux
> -2.6.10-xen0'
> make[2]: *** [build] Error 2
> make[2]: Leaving directory
> `/home/rharper/work/xen/testing/20050119/xen-2.0-testing'
> make[1]: *** [linux-2.6-xen0-build] Error 2
> make[1]: Leaving directory
> `/home/rharper/work/xen/testing/20050119/xen-2.0-testing'
> make: *** [linux26] Error 2
>
> Ryan Harper
>
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: Creating partitions on domain U
2005-01-19 23:22 Ian Pratt
@ 2005-01-20 0:32 ` Adam Heath
0 siblings, 0 replies; 10+ messages in thread
From: Adam Heath @ 2005-01-20 0:32 UTC (permalink / raw)
To: Ian Pratt; +Cc: Ryan Harper, Ian Pratt, xen-devel@lists.sourceforge.net
On Wed, 19 Jan 2005, Ian Pratt wrote:
> For the moment, just comment out the references to blkif_revalidate.
>
> Adam: this explains why resize wasn't working for you under 2.6.
But I never got a compile error.
How much work do you estimate it would take to fix? I'm not above kernel
hacking.
>
> Ian
>
> > -----Original Message-----
> > From: rharper [mailto:rharper@us.ibm.com] On Behalf Of Ryan Harper
> > Sent: 19 January 2005 22:50
> > To: Ian Pratt
> > Cc: xen-devel@lists.sourceforge.net
> > Subject: Re: [Xen-devel] Creating partitions on domain U
> >
> > * Ian Pratt <Ian.Pratt@cl.cam.ac.uk> [2005-01-19 09:57]:
> > > Please can you give the attached completely untested patch a
> > > go. If it works, I'll apply it to 2.0-testing.
> >
> > Some compile issues:
> >
> > drivers/built-in.o(.text+0x84396): In function `blkif_ioctl':
> > : undefined reference to `blkif_revalidate'
> > make[3]: *** [.tmp_vmlinux1] Error 1
> > make[3]: Leaving directory
> > `/home/rharper/work/xen/testing/20050119/xen-2.0-testing/linux
> > -2.6.10-xen0'
> > make[2]: *** [build] Error 2
> > make[2]: Leaving directory
> > `/home/rharper/work/xen/testing/20050119/xen-2.0-testing'
> > make[1]: *** [linux-2.6-xen0-build] Error 2
> > make[1]: Leaving directory
> > `/home/rharper/work/xen/testing/20050119/xen-2.0-testing'
> > make: *** [linux26] Error 2
> >
> > Ryan Harper
> >
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xen-devel
>
>
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: Creating partitions on domain U
@ 2005-01-20 0:46 Ian Pratt
0 siblings, 0 replies; 10+ messages in thread
From: Ian Pratt @ 2005-01-20 0:46 UTC (permalink / raw)
To: Adam Heath; +Cc: Ryan Harper, Ian Pratt, xen-devel
> > For the moment, just comment out the references to blkif_revalidate.
> >
> > Adam: this explains why resize wasn't working for you under 2.6.
>
> But I never got a compile error.
No, the compile error was with the patch that added support for ioctls
to 2.6, and highlighted the fact that the revalidate routine wasn't even
implemented for 2.6.
> How much work do you estimate it would take to fix? I'm not
> above kernel
> hacking.
Not a huge deal. It's just a case of taking the code that's in 2.4
blkfront directory (some of which is already n 2.6 but commented out),
and make it compile and work under 2.6.
Some of the fixes are obvious (extra parameter to get_gendisk), but some
of the changes require a little more thought.
Ian
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-01-20 0:46 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-18 23:46 Creating partitions on domain U Eric Tessler
2005-01-19 0:56 ` Mark Williamson
2005-01-19 2:05 ` Jerome Brown
2005-01-19 9:31 ` Henning Glawe
-- strict thread matches above, loose matches on Subject: below --
2005-01-19 10:58 Ian Pratt
2005-01-19 12:36 ` Ian Pratt
2005-01-19 22:50 ` Ryan Harper
2005-01-19 23:22 Ian Pratt
2005-01-20 0:32 ` Adam Heath
2005-01-20 0:46 Ian Pratt
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.