From 03f9dfbb5183b3ade354a63dc16e8afb5f6d8652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 16 Nov 2021 14:46:39 +0100 Subject: [PATCH] conf: device: compare drive address fields separately MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 3210c8b04 introduced a separate field 'diskbus' for internal use by the commandline formatter. Adjust the check for address equality to compare the relevant fields separately instead of the whole struct. This means that the changes of the 'diskbus' field added in commit 03ed14d2d4 no longer affect the outcome of the address equality check. https://bugzilla.redhat.com/show_bug.cgi?id=2023605 Fixes: 3210c8b047534f7e1d3ccde7ea3bcf11e7c92ad9 Fixes: 03ed14d2d4a4e51568b1ee5a6e6c9c3371bb4d34 Signed-off-by: Ján Tomko Reviewed-by: Peter Krempa --- src/conf/device_conf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index e587d90c59..cb523d3a0d 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -119,7 +119,10 @@ virDomainDeviceInfoAddressIsEqual(const virDomainDeviceInfo *a, break; case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE: - if (memcmp(&a->addr.drive, &b->addr.drive, sizeof(a->addr.drive))) + if (a->addr.drive.controller != b->addr.drive.controller || + a->addr.drive.unit != b->addr.drive.unit || + a->addr.drive.bus != b->addr.drive.bus || + a->addr.drive.target != b->addr.drive.target) return false; break;