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! --0-559275562-1106091976=:24827 Content-Type: text/html; charset=us-ascii <DIV>Hello,</DIV> <DIV> </DIV> <DIV>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?</DIV> <DIV> </DIV> <DIV>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.</DIV> <DIV> </DIV> <DIV>Thanks,</DIV> <DIV> </DIV> <DIV>Eric</DIV><p> <hr size=1>Do you Yahoo!?<br> Meet the <a href="http://my.yahoo.com">all-new My Yahoo!</a> Try it today! --0-559275562-1106091976=:24827-- ------------------------------------------------------- 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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
> 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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/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.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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel