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

4.0rc1 qvm-block doesn't work with dom0 loop devices #3084

Closed
3hhh opened this Issue Sep 7, 2017 · 10 comments

Comments

Projects
None yet
6 participants
@3hhh

3hhh commented Sep 7, 2017

In 4.0rc1 qvm-block cannot attach loop devices created in dom0 to AppVMs. This did work in 3.2.

This is particularly annoying as the -A option was removed from qvm-block in 4.0rc1.

Example:
Create a loop device in dom0, e.g. /dev/loop55.

qvm-block a testVM dom0:loop55
qvm-block: error: backend vm 'dom0' doesn't expose device 'loop55'

qvm-block a testVM dom0:/dev/loop55 results in the same error.

Attaching loop devices created in e.g. sys-usb to other VMs does work.

@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh Sep 7, 2017

(Halfway) working procedure for sys-usb: #3073

3hhh commented Sep 7, 2017

(Halfway) working procedure for sys-usb: #3073

@andrewdavidwong andrewdavidwong added this to the Release 4.0 milestone Sep 8, 2017

@kushaldas

This comment has been minimized.

Show comment
Hide comment
@kushaldas

kushaldas Sep 8, 2017

I am also seeing the same error in my 4.0rc1 install. Was trying to attach an image file using a loop device to one domain.

kushaldas commented Sep 8, 2017

I am also seeing the same error in my 4.0rc1 install. Was trying to attach an image file using a loop device to one domain.

@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh Sep 8, 2017

xl block-attach works with dom0 loop devices by the way (can be used as a workaround in the meantime).

3hhh commented Sep 8, 2017

xl block-attach works with dom0 loop devices by the way (can be used as a workaround in the meantime).

@kushaldas

This comment has been minimized.

Show comment
Hide comment
@kushaldas

kushaldas Sep 9, 2017

@3hhh Thanks for the tip. I also tried after updating dom0 to current testing, still same error. I will try xl block-attach today.

kushaldas commented Sep 9, 2017

@3hhh Thanks for the tip. I also tried after updating dom0 to current testing, still same error. I will try xl block-attach today.

@taonik

This comment has been minimized.

Show comment
Hide comment
@taonik

taonik Sep 11, 2017

I'm in the same situation.
I've tried xl block-attach, but it complains no vdev specified in '/dev/loopX'

taonik commented Sep 11, 2017

I'm in the same situation.
I've tried xl block-attach, but it complains no vdev specified in '/dev/loopX'

@3hhh

This comment has been minimized.

Show comment
Hide comment
@3hhh

3hhh Sep 11, 2017

Then you forgot the vdev...

xl block-attach testVM phy:loop55 xvdz w

xvdz is the vdev that will appear in testVM

3hhh commented Sep 11, 2017

Then you forgot the vdev...

xl block-attach testVM phy:loop55 xvdz w

xvdz is the vdev that will appear in testVM

@taonik

This comment has been minimized.

Show comment
Hide comment
@taonik

taonik Sep 12, 2017

It works, but then it fails to detach the block: no suitable backend for disk xvdz.
It seems to be an old problem (qvm-block -A).

taonik commented Sep 12, 2017

It works, but then it fails to detach the block: no suitable backend for disk xvdz.
It seems to be an old problem (qvm-block -A).

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Sep 12, 2017

Member

Generally using xl block-attach and xl block-detach mixed with libvirt (as used by qvm-block and others) is a bad idea, because libvirt keeps own view of the system internally.

Member

marmarek commented Sep 12, 2017

Generally using xl block-attach and xl block-detach mixed with libvirt (as used by qvm-block and others) is a bad idea, because libvirt keeps own view of the system internally.

@qubesos-bot

This comment has been minimized.

Show comment
Hide comment
@qubesos-bot

qubesos-bot Sep 12, 2017

Automated announcement from builder-github

The package qubes-core-dom0-linux-4.0.4-1.fc25 has been pushed to the r4.0 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

qubesos-bot commented Sep 12, 2017

Automated announcement from builder-github

The package qubes-core-dom0-linux-4.0.4-1.fc25 has been pushed to the r4.0 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

marmarek added a commit to marmarek/qubes-linux-utils that referenced this issue Sep 12, 2017

udev: major cleanup in block devices handling
1. Do not detach device forcefully when it's removed. This breaks
libvirt (which thinks the device is still there). After this change, it
is possible to detach device using libvirt, even if it was already
removed physically from backend domain (unless it is dom0 - in which
case it is still broken). So, this is partial fix for
QubesOS/qubes-issues#1082.

2. Do not trigger "change" udev event when only QubesDB state needs to
be updated - this leads to massive udev events queue, and heavy I/O
usage - for example scanning all LVM many times. In some cases it even
caused infinite event queue.

3. Do not use QUBES_EXPOSED udev property - it was needed a while back
before QubesDB, because concurrent xenstore accesses are expensive
(because of transactions). It isn't the problem on QubesDB.

4. Cache information about device-mapper, so it is possible to
reconstruct it at device remove - when the actual device cannot be
queried anymore. This is specifically about list of lower layer devices
used.

5. Allow excluding loop devices pointing at a file in directory marked
with ".qubes-exclude-block-devices" file. This is more generic than
hardcoding /var/lib/qubes.

QubesOS/qubes-issues#3084
Fixes QubesOS/qubes-issues#3073
QubesOS/qubes-issues#1082

marmarek added a commit to marmarek/qubes-linux-utils that referenced this issue Sep 15, 2017

udev: fix loop devices exclusion based on directory flagfile
Getting loop device backing file path was broken:
${NAME%p*} for not-partitioned devices will cut the actual device name.
Use full name instead. This probably breaks handling partitioned
devices, but such devices should not appear in a directory flagged to be
ignored (VM images)

QubesOS/qubes-issues#3084

marmarek added a commit to marmarek/qubes-core-admin-linux that referenced this issue Sep 15, 2017

Mark /var/lib/qubes to not expose loop devices pointing inside
DM_UDEV_DISABLE_DISK_RULES_FLAG flag sometimes isn't properly
propagated, so just to be sure, add a flag file
/var/lib/qubes/.qubes-exclude-block-devices to exclude that directory.

Fixes 5c84a0b "udev: don't exclude loop devices pointing outside of
/var/lib/qubes"

QubesOS/qubes-issues#3084
@qubesos-bot

This comment has been minimized.

Show comment
Hide comment
@qubesos-bot

qubesos-bot Oct 17, 2017

Automated announcement from builder-github

The package qubes-core-dom0-linux-4.0.6-1.fc25 has been pushed to the r4.0 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

qubesos-bot commented Oct 17, 2017

Automated announcement from builder-github

The package qubes-core-dom0-linux-4.0.6-1.fc25 has been pushed to the r4.0 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment