Enable partitions for lguest block device
The lguest block device only requests one minor, which means partitions don't work (eg "root=/dev/lgba1"). Let's follow the crowd and ask for 16. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
56616ebd0e
commit
9ef7ad2296
@ -308,9 +308,12 @@ static int lguestblk_probe(struct lguest_device *lgdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* This allocates a "struct gendisk" where we pack all the information
|
/* This allocates a "struct gendisk" where we pack all the information
|
||||||
* about the disk which the rest of Linux sees. We ask for one minor
|
* about the disk which the rest of Linux sees. The argument is the
|
||||||
* number; I do wonder if we should be asking for more. */
|
* number of minor devices desired: we need one minor for the main
|
||||||
bd->disk = alloc_disk(1);
|
* disk, and one for each partition. Of course, we can't possibly know
|
||||||
|
* how many partitions are on the disk (add_disk does that).
|
||||||
|
*/
|
||||||
|
bd->disk = alloc_disk(16);
|
||||||
if (!bd->disk) {
|
if (!bd->disk) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto out_unregister_blkdev;
|
goto out_unregister_blkdev;
|
||||||
|
Reference in New Issue
Block a user