Skip to content

Mounting block devices as virtio devices doesn't work correctly #1316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kzys opened this issue Oct 7, 2019 · 1 comment
Closed

Mounting block devices as virtio devices doesn't work correctly #1316

kzys opened this issue Oct 7, 2019 · 1 comment
Assignees
Labels
Priority: High Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled Type: Bug Indicates an unexpected problem or unintended behavior

Comments

@kzys
Copy link
Contributor

kzys commented Oct 7, 2019

While investigating firecracker-microvm/firecracker-containerd#253, we have found a small gap regarding virtio block device support on Firecracker.

Currently Firecracker is using std::fs::metadata() to check the size of a virtio block device, which ultimately calls stat() on Unix.

However firecracker-containerd is using a loopback device as the backing file for a virtio block device. On a lookback device, the size from stat() is always zero.

Can Firecracker support our usecase by inspecting the size of the file more deeply? You probably can use BLKGETSIZE64 ioctl.

Thanks,

@kzys kzys changed the title Support loopback devices as Mouting block devices as virtio devices doesn't work correctly Oct 7, 2019
@alxiord alxiord added Feature: Emulation Priority: Low Indicates that an issue or pull request should be resolved behind issues or pull requests labelled ` Priority: High Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled Type: Bug Indicates an unexpected problem or unintended behavior and removed Priority: Low Indicates that an issue or pull request should be resolved behind issues or pull requests labelled ` labels Oct 8, 2019
@alxiord
Copy link

alxiord commented Oct 8, 2019

Hi @kzys, thank you for the report and investigation! This looks like a bug, and will be addressed as soon as possible. However, if in the meantime you have a fix ready, PRs are welcome!

@iulianbarbu iulianbarbu self-assigned this Oct 9, 2019
@sandreim sandreim changed the title Mouting block devices as virtio devices doesn't work correctly Mounting block devices as virtio devices doesn't work correctly Oct 9, 2019
kzys added a commit to kzys/firecracker that referenced this issue Nov 5, 2019
When a virtio device is backed by a block device, the actual size of
the block device file doesn't represent the size as a virtio device.

Fixes firecracker-microvm#1316
kzys added a commit to kzys/firecracker that referenced this issue Nov 5, 2019
When a virtio device is backed by a block device, the actual size of
the block device file doesn't represent the size as a virtio device.

Fixes firecracker-microvm#1316

Signed-off-by: Kazuyoshi Kato <[email protected]>
kzys added a commit to kzys/firecracker that referenced this issue Nov 6, 2019
kzys added a commit to kzys/firecracker that referenced this issue Nov 6, 2019
When a virtio device is backed by a block device, the actual size of
the block device file doesn't represent the size as a virtio device.

Fixes firecracker-microvm#1316

Signed-off-by: Kazuyoshi Kato <[email protected]>
@iulianbarbu iulianbarbu assigned kzys and unassigned iulianbarbu Nov 6, 2019
kzys added a commit to kzys/firecracker that referenced this issue Nov 12, 2019
When a virtio device is backed by a block device, the actual size of
the block device file doesn't represent the size as a virtio device.

Fixes firecracker-microvm#1316

Signed-off-by: Kazuyoshi Kato <[email protected]>
kzys added a commit to kzys/firecracker that referenced this issue Nov 12, 2019
When a virtio device is backed by a block device, the actual size of
the block device file doesn't represent the size as a virtio device.

Fixes firecracker-microvm#1316

Signed-off-by: Kazuyoshi Kato <[email protected]>
kzys added a commit to kzys/firecracker that referenced this issue Nov 14, 2019
When a virtio device is backed by a block device, the actual size of
the block device file doesn't represent the size as a virtio device.

Fixes firecracker-microvm#1316

Signed-off-by: Kazuyoshi Kato <[email protected]>
mi-yu pushed a commit to mi-yu/firecracker that referenced this issue Dec 3, 2019
When a virtio device is backed by a block device, the actual size of
the block device file doesn't represent the size as a virtio device.

Fixes firecracker-microvm#1316

Signed-off-by: Kazuyoshi Kato <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High Indicates than an issue or pull request should be resolved ahead of issues or pull requests labelled Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants