]> git.ipfire.org Git - thirdparty/libvirt.git/commit
ch: Actually remove device in chDomainDetachDeviceLive()
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 9 Sep 2025 15:10:36 +0000 (17:10 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 10 Sep 2025 09:44:24 +0000 (11:44 +0200)
commit3bd17ffe972af03924fda476e2ebfe89f53a8f4f
tree4742e449f902b1f077e86c2b9eb6bf6e1c1cbf3a
parent20d5c61cb47a0c83e8b3928dcd9c3d8c9778873f
ch: Actually remove device in chDomainDetachDeviceLive()

Inside of chDomainDetachDeviceLive() there are two variables that
are important in this case: 'match' and 'detach'. The first one
contains device definition as parsed from user provided XML, the
other contains pointer to the device definition inside
virDomainDef (as returned by chDomainFindDisk()).

Now, when chDomainRemoveDevice() is called, it looks up the
device inside virDomainDef and removes it (using pointer
comparison). Well, that means 'detach' must be passed as an
argument instead of 'match'.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/ch/ch_hotplug.c