提交 9246ce88 编写于 作者: F Felipe Franciosi 提交者: Stefano Stabellini

Allow xen guests to plug disks of 1 TiB or more

The current xen backend driver implementation uses int64_t variables
to store the size of the corresponding backend disk/file. It also uses
an int64_t variable to store the block size of that image. When writing
the number of sectors (file_size/block_size) to xenstore, however, it
passes these values as 32 bit signed integers. This will cause an
overflow for any disk of 1 TiB or more.

This patch changes the xen backend driver to use a 64 bit integer write
xenstore function.
Signed-off-by: NFelipe Franciosi <felipe@paradoxo.org>
Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
上级 10bb3c62
......@@ -825,8 +825,8 @@ static int blk_connect(struct XenDevice *xendev)
/* Fill in number of sector size and number of sectors */
xenstore_write_be_int(&blkdev->xendev, "sector-size", blkdev->file_blk);
xenstore_write_be_int(&blkdev->xendev, "sectors",
blkdev->file_size / blkdev->file_blk);
xenstore_write_be_int64(&blkdev->xendev, "sectors",
blkdev->file_size / blkdev->file_blk);
if (xenstore_read_fe_int(&blkdev->xendev, "ring-ref", &blkdev->ring_ref) == -1) {
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册