At the end of chDomainDetachDeviceLive() there's a code that
tries to remove the disk that's being detached from the domain
definition. Well, it's a leftover from the original patch which I
forgot to remove when rewriting it to use chDomainRemoveDevice().
The disk is removed there so this code has no chance in removing
it again. Drop the code.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
virDomainDeviceDef detach = { .type = match->type };
virDomainDeviceInfo *info = NULL;
virCHDomainObjPrivate *priv = vm->privateData;
- int idx = 0;
switch (match->type) {
case VIR_DOMAIN_DEVICE_DISK:
if (chDomainRemoveDevice(vm, &detach) < 0)
return -1;
- if (match->type == VIR_DOMAIN_DEVICE_DISK) {
- idx = chFindDiskId(vm->def, match->data.disk->dst);
- if (idx >= 0) {
- virDomainDiskRemove(vm->def, idx);
- }
- }
-
return 0;
}