diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d2206085fd..08b8e28c4e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2733,11 +2733,10 @@ virDomainChrSourceDefClear(virDomainChrSourceDef *def) } /* Almost deep copies the contents of src into dest. Some parts are not copied - * though. - * Returns -1 and report error on failure. */ -int + * though. */ +void virDomainChrSourceDefCopy(virDomainChrSourceDef *dest, - virDomainChrSourceDef *src) + const virDomainChrSourceDef *src) { virDomainChrSourceDefClear(dest); @@ -2800,8 +2799,6 @@ virDomainChrSourceDefCopy(virDomainChrSourceDef *dest, case VIR_DOMAIN_CHR_TYPE_LAST: break; } - - return 0; } static void diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8f47adfc8f..3768d82fef 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3348,8 +3348,8 @@ void virDomainSmartcardDefFree(virDomainSmartcardDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainSmartcardDef, virDomainSmartcardDefFree); void virDomainChrDefFree(virDomainChrDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainChrDef, virDomainChrDefFree); -int virDomainChrSourceDefCopy(virDomainChrSourceDef *dest, - virDomainChrSourceDef *src) +void virDomainChrSourceDefCopy(virDomainChrSourceDef *dest, + const virDomainChrSourceDef *src) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); void virDomainSoundCodecDefFree(virDomainSoundCodecDef *def); ssize_t virDomainSoundDefFind(const virDomainDef *def, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b8c70da566..fa6a5e5e7d 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2129,9 +2129,8 @@ qemuProcessFindCharDevicePTYsMonitor(virDomainObj *vm, chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL) { /* yes, the first console is just an alias for serials[0] */ i = 1; - if (virDomainChrSourceDefCopy(chr->source, - ((vm->def->serials[0])->source)) < 0) - return -1; + virDomainChrSourceDefCopy(chr->source, + ((vm->def->serials[0])->source)); } }