On Tue, Feb 11, 2025 at 11:28:55PM -0500, Laine Stump wrote:
> It can't fail.
>
I'm looking forward to this being the message in all the other commits =D
> Signed-off-by: Laine Stump <laine(a)redhat.com>
> ---
> src/conf/domain_conf.c | 4 ++--
> src/conf/domain_conf.h | 2 +-
> src/libxl/libxl_driver.c | 3 +--
> src/lxc/lxc_driver.c | 3 +--
> src/qemu/qemu_driver.c | 5 +----
> 5 files changed, 6 insertions(+), 11 deletions(-)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 0a7c3588e2..4a248cbafe 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -6699,7 +6699,6 @@ qemuDomainAttachDeviceConfig(virDomainDef *vmdef,
> virDomainXMLOption *xmlopt)
> {
> virDomainDiskDef *disk;
> - virDomainNetDef *net;
> virDomainSoundDef *sound;
> virDomainHostdevDef *hostdev;
> virDomainLeaseDef *lease;
> @@ -6726,9 +6725,7 @@ qemuDomainAttachDeviceConfig(virDomainDef *vmdef,
> break;
>
> case VIR_DOMAIN_DEVICE_NET:
> - net =
dev->data.net;
> - if (virDomainNetInsert(vmdef, net))
> - return -1;
> + virDomainNetInsert(vmdef,
dev->data.net);
>
dev->data.net = NULL;
or `virDomainNetInsert(vmdef, g_steal_pointer(dev->data.net))`
Ah yes. I'd been too narrowed in to think about that. I like that much
better (there were a few of those cases, weren't there? It's been a
couple weeks since I did all these, so my memory is hazy).