Comment 2 for bug 1840872

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

This feels a bit like a trap due to:
commit 22dc3e94c24b4d9a6c28beda91b9b283eb9b0251
Author: Michal Privoznik <email address hidden>
Date: Thu Apr 11 15:40:51 2019 +0200

    Revert "domain_conf: check device address before attach"

    This reverts commit f1d6585300001c7b23b8796a0faa4411c3531996.

    Turns out, this caused a regression. There is this (perhaps less
    known) semantic of virDomainAttachDevice() where if the device
    the API is trying to attach is a CDROM/floppy that is already in
    the domain the attach request is handled as 'change the media in
    the drive'.

    We have a better fix anyways.

    Signed-off-by: Michal Privoznik <email address hidden>
    Tested-by: Daniel Henrique Barboza <email address hidden>
    Reviewed-by: Jim Fehlig <email address hidden>

Instead one should use:
commit 89237d534f0fe950d06a2081089154160c6c2224
Author: Michal Privoznik <email address hidden>
Date: Thu Apr 11 15:44:14 2019 +0200

    conf: Expose virDomainSCSIDriveAddressIsUsed

    This function checks if given drive address is already present in
    passed domain definition. Expose the function as it will be used
    shortly.

    Signed-off-by: Michal Privoznik <email address hidden>
    Tested-by: Daniel Henrique Barboza <email address hidden>
    Reviewed-by: Jim Fehlig <email address hidden>

commit ddc72f99027b063feaf34e5fda89916b6b2c8943
Author: Michal Privoznik <email address hidden>
Date: Thu Apr 11 15:45:27 2019 +0200

    qemu_hotplug: Check for duplicate drive addresses

    This tries to fix the same problem as f1d65853000 but it's doing
    so in a less invasive way.