From: Michal Privoznik Date: Tue, 9 Sep 2025 14:01:18 +0000 (+0200) Subject: ch: Drop deadcode from chDomainDetachDeviceLive() X-Git-Tag: v11.8.0-rc1~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7b70c1868c0fce43539356e661923182e5d2fa0a;p=thirdparty%2Flibvirt.git ch: Drop deadcode from chDomainDetachDeviceLive() 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 Reviewed-by: Ján Tomko --- diff --git a/src/ch/ch_hotplug.c b/src/ch/ch_hotplug.c index b06fdbe5a8..aa723dd123 100644 --- a/src/ch/ch_hotplug.c +++ b/src/ch/ch_hotplug.c @@ -263,7 +263,6 @@ chDomainDetachDeviceLive(virDomainObj *vm, virDomainDeviceDef detach = { .type = match->type }; virDomainDeviceInfo *info = NULL; virCHDomainObjPrivate *priv = vm->privateData; - int idx = 0; switch (match->type) { case VIR_DOMAIN_DEVICE_DISK: @@ -339,13 +338,6 @@ chDomainDetachDeviceLive(virDomainObj *vm, 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; }