Skip to content
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

CP-11936: Automatically plug block-based RAW VDIs via blkback #251

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

franciozzy
Copy link
Contributor

This patch causes block-based (LV) RAW VDIs to be automatically plugged by
blkback. This is achieved as follows:

During VDI.attach, we detect that the SR handles LVM and that the VDI driver
is 'aio'. In that case, we write 'backend-kind: vbd' to xenstore_data, which
causes the toolstack to use the /local/domain/0/backend/vbd/ path instead of
.../vbd3/. This is the preferred method following CP-11511. By writing to
.../vbd/, blkback wakes up instead of tapback.

During VDI.activate, we create the /dev/sm/backend/ node using the maj/min
numbers of the actual VDI (LV) instead of those of the blktap2 device. This
causes the udev hotplug scripts to write the /physical-device/ entry with
information of the LV, creating the blkfront-blkback-vdi datapath without
blktap2 or tapdisk3 in the middle.

Note that a tapdisk3 and a blktap2 will still exist in dom0, providing all
necessary backend infrastructure resources for other operations.

Signed-off-by: Felipe Franciosi felipe@paradoxo.org

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 31.65% when pulling 3830450 on franciozzy:CP11936 into 6b2d6df on xapi-project:master.

@franciozzy franciozzy changed the title CA-11936: Automatically plug block-based RAW VDIs via blkback CP-11936: Automatically plug block-based RAW VDIs via blkback Apr 9, 2015
This patch causes block-based (LV) RAW VDIs to be automatically plugged by
blkback. This is achieved as follows:

During VDI.attach, we detect that the SR handles LVM and that the VDI driver
is 'aio'. In that case, we write 'backend-kind: vbd' to xenstore_data, which
causes the toolstack to use the /local/domain/0/backend/vbd/ path instead of
.../vbd3/. This is the preferred method following CP-11511. By writing to
.../vbd/, blkback wakes up instead of tapback.

During VDI.activate, we create the /dev/sm/backend/ node using the maj/min
numbers of the actual VDI (LV) instead of those of the blktap2 device. This
causes the udev hotplug scripts to write the /physical-device/ entry with
information of the LV, creating the blkfront-blkback-vdi datapath without
blktap2 or tapdisk3 in the middle.

Note that a tapdisk3 and a blktap2 will still exist in dom0, providing all
necessary backend infrastructure resources for other operations.

Signed-off-by: Felipe Franciosi <felipe@paradoxo.org>
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 31.65% when pulling c0cfc55 on franciozzy:CP11936 into 6b2d6df on xapi-project:master.

@chandrikas
Copy link
Contributor

Reviewed and tested. Looks good to merge @franciozzy

@franciozzy
Copy link
Contributor Author

Placed in the PQ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants