]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Perform disk config validity checking for attach-device config
authorJohn Ferlan <jferlan@redhat.com>
Tue, 29 Jul 2014 13:21:05 +0000 (09:21 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 21 Aug 2014 11:06:35 +0000 (07:06 -0400)
commit33188c9fcb7babe80ecac6267b17a32c87bb7e60
treeceaee12dfab0c1d20c3a2d247407891a10e39a46
parentb470a38fa99a9567dc4a832d93f4aaf6cc782e0b
Perform disk config validity checking for attach-device config

https://bugzilla.redhat.com/show_bug.cgi?id=1078126

Using 'virsh attach-device --config' (or --persistent) to attach a
file backed lun device will succeed; however, subsequent domain restarts
will result in failure because the configuration of a file backed lun
is not supported.

Although allowing 'illegal configurations' is something that can be
allowed, it may not be practical in this case. Generally, when attaching
a device to a domain means the domain must be running. A way around
this is using the --config (or --persistent) option. When an attach
is done to a running domain, a temporary configuration is modified
first followed by the live update. The live update will make a number
of disk validity checks when building the qemu command to attach the
disk. If any fail, then change is rejected.

Rather than allow a potentially illegal combination, adjust the code
in the configuration path to make the same checks as the running path
will make with respect to disk validity checks. This way we avoid
having the potential for some subsequent start/reboot to fail because
an illegal combination was allowed.

NB: The live path still checks the configuration since it is possible
to just do --live guest modification...
src/qemu/qemu_command.c
src/qemu/qemu_command.h
src/qemu/qemu_driver.c