Re: [PATCH v5 02/16] qemu: Introduce qemuDomainDeviceDefValidateControllerAttributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/06/2018 12:47 AM, John Ferlan wrote:
> Move the checks that various attributes are not set on any controller
> other than SCSI controller using virtio-scsi model into the common
> controller validate checks.
> 
> Need to also add a qemuDomainResetSCSIControllerModel call in order
> to ensure we get the "right" SCSI model if it's not set by default
> since it wouldn't be set during post parse processing.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/qemu/qemu_command.c | 24 ------------------------
>  src/qemu/qemu_domain.c  | 41 +++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 41 insertions(+), 24 deletions(-)


The only problem I have with this approach is that while previously
we've checked for QEMU caps at domain start time, now we check for them
at define time. So I guess in general it's not a safe thing to do.

For instance, I'd be against moving all checks done at cmd line time to
DefPostParse as they introduce TOCTOU problem. However, some checks
(mostly semantic ones) can be done in post parse callbacks. For example,
trying to plug a disk onto ISA bus will fail regardless of qemu caps.
However, whether qemu supports VIRTIO_SCSI or not should not matter at
define time as this might change after domain is defined.

However, SCSI controllers have been around for quite some time, so
unless somebody is upgrading from ancient qemu, we are safe.

ACK

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux