From nobody Mon Feb 9 16:32:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1674466576; cv=none; d=zohomail.com; s=zohoarc; b=AeOM/EhZgH73YSPOTu6tDArQvGNPtXz3VGz5Hl/R2Sd3gUVES35ErXp+mrfCL6YX4BM2oxR3Fmoyt4jrbjU8THjuUgq6wKAto8K02G/z8aYzxflOk/CEhbx+3IWBM8N8pCXI9K+t3oHjpwCepGq+8iwSQfRqhEABg/Q8AvZaT0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674466576; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vV8lHC/xFlyABehuyMkZxsYw81V8o9LoEQQzYvRtfJY=; b=DmebJyZzN+WPAmVxJ8y4CVPDsHvnHDIeeYNLUpS0hbUT3LdHxAyXp5JqBR3WnBJAtNwaxuZpaHXJsDdvBqiSbHOZxfUmnPnQ1cao0539LG7Uz0+q48S6zN3M2oiH9nF2g5aDMHIUmJCqVdIEs9TnDgUd2GmGyaSqE1Qx4qzWaRM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1674466576213765.4223552424527; Mon, 23 Jan 2023 01:36:16 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-563-CWwM1vUKOYSzZNZPYsMLzQ-1; Mon, 23 Jan 2023 04:36:07 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4C2EC2806045; Mon, 23 Jan 2023 09:36:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D06A40ED76E; Mon, 23 Jan 2023 09:36:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0B02D194658C; Mon, 23 Jan 2023 09:36:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D944C1946A6C for ; Mon, 23 Jan 2023 09:36:01 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BB319492B03; Mon, 23 Jan 2023 09:36:01 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60D6A492D0F for ; Mon, 23 Jan 2023 09:36:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674466575; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vV8lHC/xFlyABehuyMkZxsYw81V8o9LoEQQzYvRtfJY=; b=gTV9cBi5euhjr45uddvQpMqnOJhuM54+Jug1CWsIl95dOz026LR6d1mH37X4XJmMsCzfDt IOYoX8aZzNpaXShaKgJfnXH80VGMYpkuJKhsrWT6hW8T5jcHvmF8hgZEbilk+NSp26Zk2T tpJynBO8eK+6V9b8Zx+sVGbCZLROa38= X-MC-Unique: CWwM1vUKOYSzZNZPYsMLzQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 8/8] vbox: Stop reporting RC in error messages Date: Mon, 23 Jan 2023 10:35:55 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1674466577956100001 Content-Type: text/plain; charset="utf-8"; x-default="true" As shown in the commit that introduced vboxReportError(), we are appending the retval of a failed VirtualBox API onto our error messages. Well, this is no longer needed because vboxReportError() already appends the VirtualBox error in plain text. Signed-off-by: Michal Privoznik --- src/vbox/vbox_common.c | 301 ++++++++++++++++++----------------------- 1 file changed, 132 insertions(+), 169 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index cf404ea9d7..0a83cc5a61 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -570,8 +570,8 @@ vboxSetStorageController(virDomainControllerDef *contro= ller, =20 if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to add storage controller (name: %s, bus= Type: %d), rc=3D%08x"), - debugName, vboxBusType, rc); + _("Failed to add storage controller (name: %s, bus= Type: %d)"), + debugName, vboxBusType); goto cleanup; } =20 @@ -581,7 +581,7 @@ vboxSetStorageController(virDomainControllerDef *contro= ller, vboxModel); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to change storage controller model, = rc=3D%08x"), rc); + _("Failed to change storage controller model")= ); goto cleanup; } } @@ -795,9 +795,8 @@ static int vboxConnectListDomains(virConnectPtr conn, i= nt *ids, int nids) =20 rc =3D gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GE= T_MACHINES); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get list of Domains, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get list of Domains")); goto cleanup; } =20 @@ -837,8 +836,8 @@ static int vboxConnectNumOfDomains(virConnectPtr conn) =20 rc =3D gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GE= T_MACHINES); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get number of Domains, rc=3D%08x"), (= unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get number of Domains")); goto cleanup; } =20 @@ -891,8 +890,8 @@ static virDomainPtr vboxDomainLookupByID(virConnectPtr = conn, int id) =20 rc =3D gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GE= T_MACHINES); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get list of machines, rc=3D%08x"), (u= nsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get list of machines")); return NULL; } =20 @@ -958,7 +957,7 @@ virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn, rc =3D gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GE= T_MACHINES); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get list of machines, rc=3D%08x"), (u= nsigned)rc); + _("Could not get list of machines")); return NULL; } =20 @@ -1030,7 +1029,7 @@ vboxDomainLookupByName(virConnectPtr conn, const char= *name) rc =3D gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GE= T_MACHINES); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get list of machines, rc=3D%08x"), (u= nsigned)rc); + _("Could not get list of machines")); return NULL; } =20 @@ -1270,8 +1269,8 @@ vboxAttachDrives(virDomainDef *def, struct _vboxDrive= r *data, IMachine *machine) =20 if (!medium) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to open the following disk/dvd/f= loppy to the machine: %s, rc=3D%08x"), - src, rc); + _("Failed to open the following disk/dvd/f= loppy to the machine: %s"), + src); ret =3D -1; goto cleanup; } @@ -1279,8 +1278,8 @@ vboxAttachDrives(virDomainDef *def, struct _vboxDrive= r *data, IMachine *machine) rc =3D gVBoxAPI.UIMedium.GetId(medium, &mediumUUID); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Can't get the UUID of the file to be at= tached as harddisk/dvd/floppy: %s, rc=3D%08x"), - src, rc); + _("Can't get the UUID of the file to be at= tached as harddisk/dvd/floppy: %s"), + src); ret =3D -1; goto cleanup; } @@ -1314,8 +1313,8 @@ vboxAttachDrives(virDomainDef *def, struct _vboxDrive= r *data, IMachine *machine) =20 if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not attach the file as harddisk/dvd/f= loppy: %s, rc=3D%08x"), - src, rc); + _("Could not attach the file as harddisk/dvd/f= loppy: %s"), + src); ret =3D -1; goto cleanup; } else { @@ -1977,7 +1976,7 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const ch= ar *xml, unsigned int flags =20 if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("could not define a domain, rc=3D%08x"), (unsign= ed)rc); + _("could not define a domain")); goto cleanup; } =20 @@ -1985,8 +1984,8 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const ch= ar *xml, unsigned int flags VIR_DIV_UP(def->mem.cur_balloon,= 1024)); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("could not set the memory size of the domain to:= %llu Kb, rc=3D%08x"), - def->mem.cur_balloon, (unsigned)rc); + _("could not set the memory size of the domain to:= %llu Kb"), + def->mem.cur_balloon); } =20 if (virDomainDefHasVcpusOffline(def)) { @@ -1996,8 +1995,8 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const ch= ar *xml, unsigned int flags rc =3D gVBoxAPI.UIMachine.SetCPUCount(machine, virDomainDefGetVcpusMax= (def)); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("could not set the number of virtual CPUs to: %u= , rc=3D%08x"), - virDomainDefGetVcpusMax(def), (unsigned)rc); + _("could not set the number of virtual CPUs to: %u= "), + virDomainDefGetVcpusMax(def)); } =20 rc =3D gVBoxAPI.UIMachine.SetCPUProperty(machine, CPUPropertyType_PAE, @@ -2005,9 +2004,9 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const ch= ar *xml, unsigned int flags VIR_TRISTATE_SWITCH_ON); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("could not change PAE status to: %s, rc=3D%08x"), + _("could not change PAE status to: %s"), (def->features[VIR_DOMAIN_FEATURE_PAE] =3D=3D VIR_= TRISTATE_SWITCH_ON) - ? _("Enabled") : _("Disabled"), (unsigned)rc); + ? _("Enabled") : _("Disabled")); } =20 gVBoxAPI.UIMachine.GetBIOSSettings(machine, &bios); @@ -2017,18 +2016,18 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const = char *xml, unsigned int flags VIR_TRISTATE_SWITCH_ON= ); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("could not change ACPI status to: %s, rc=3D%= 08x"), + _("could not change ACPI status to: %s"), (def->features[VIR_DOMAIN_FEATURE_ACPI] =3D=3D= VIR_TRISTATE_SWITCH_ON) - ? _("Enabled") : _("Disabled"), (unsigned)rc); + ? _("Enabled") : _("Disabled")); } rc =3D gVBoxAPI.UIBIOSSettings.SetIOAPICEnabled(bios, def->features[VIR_DO= MAIN_FEATURE_APIC] =3D=3D VIR_TRISTATE_SWITCH_= ON); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("could not change APIC status to: %s, rc=3D%= 08x"), + _("could not change APIC status to: %s"), (def->features[VIR_DOMAIN_FEATURE_APIC] =3D=3D= VIR_TRISTATE_SWITCH_ON) - ? _("Enabled") : _("Disabled"), (unsigned)rc); + ? _("Enabled") : _("Disabled")); } VBOX_RELEASE(bios); } @@ -2036,8 +2035,8 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const ch= ar *xml, unsigned int flags /* Register the machine before attaching other devices to it */ rc =3D gVBoxAPI.UIVirtualBox.RegisterMachine(data->vboxObj, machine); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("could not define a domain, rc=3D%08x"), (unsign= ed)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("could not define a domain")); goto cleanup; } =20 @@ -2081,7 +2080,7 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const ch= ar *xml, unsigned int flags rc =3D gVBoxAPI.UIMachine.SaveSettings(machine); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to save VM settings, rc=3D%08x"), rc); + _("Failed to save VM settings")); machineReady =3D false; } =20 @@ -2137,8 +2136,8 @@ static int vboxDomainUndefineFlags(virDomainPtr dom, = unsigned int flags) gVBoxAPI.deleteConfig(machine); ret =3D 0; } else { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("could not delete the domain, rc=3D%08x"), (unsi= gned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("could not delete the domain")); } =20 vboxIIDUnalloc(&iid); @@ -2317,8 +2316,8 @@ static int vboxDomainCreateWithFlags(virDomainPtr dom= , unsigned int flags) =20 rc =3D gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GE= T_MACHINES); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get list of machines, rc=3D%08x"), (u= nsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get list of machines")); return -1; } =20 @@ -2417,7 +2416,7 @@ static int vboxDomainIsActive(virDomainPtr dom) rc =3D gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GE= T_MACHINES); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get list of machines, rc=3D%08x"), (u= nsigned)rc); + _("Could not get list of machines")); return ret; } =20 @@ -2830,8 +2829,8 @@ static int vboxDomainSetMemory(virDomainPtr dom, unsi= gned long memory) ret =3D 0; } else { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("could not set the memory size of the domain= to: %lu Kb, rc=3D%08x"), - memory, (unsigned)rc); + _("could not set the memory size of the domain= to: %lu Kb"), + memory); } } gVBoxAPI.UISession.Close(data->vboxSession); @@ -2857,8 +2856,8 @@ static int vboxDomainGetInfo(virDomainPtr dom, virDom= ainInfoPtr info) =20 rc =3D gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GE= T_MACHINES); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get list of machines, rc=3D%08x"), (u= nsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get list of machines")); return -1; } =20 @@ -2985,8 +2984,8 @@ static int vboxDomainSetVcpusFlags(virDomainPtr dom, = unsigned int nvcpus, ret =3D 0; } else { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("could not set the number of cpus of the= domain to: %u, rc=3D%08x"), - CPUCount, (unsigned)rc); + _("could not set the number of cpus of the= domain to: %u"), + CPUCount); } VBOX_RELEASE(machine); } else { @@ -3286,8 +3285,8 @@ vboxDumpDisks(virDomainDef *def, struct _vboxDriver *= data, IMachine *machine) =20 rc =3D gVBoxAPI.UIMediumAttachment.GetMedium(mediumAttachment, &me= dium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get IMedium, rc=3D%08x"), rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get IMedium")); goto cleanup; } =20 @@ -3327,16 +3326,15 @@ vboxDumpDisks(virDomainDef *def, struct _vboxDriver= *data, IMachine *machine) rc =3D gVBoxAPI.UIMediumAttachment.GetMedium(mediumAttachment, &me= dium); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get IMedium, rc=3D%08x"), rc); + _("Could not get IMedium")); goto cleanup; } =20 rc =3D gVBoxAPI.UIMediumAttachment.GetController(mediumAttachment, &controllerName); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to get storage controller name, rc= =3D%08x"), - rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Failed to get storage controller name")); goto cleanup; } =20 @@ -3344,44 +3342,41 @@ vboxDumpDisks(virDomainDef *def, struct _vboxDriver= *data, IMachine *machine) controllerName, &controller); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get storage controller by name, r= c=3D%08x"), - rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get storage controller by name")); goto cleanup; } =20 rc =3D gVBoxAPI.UIMediumAttachment.GetType(mediumAttachment, &devi= ceType); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get device type, rc=3D%08x"), rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get device type")); goto cleanup; } rc =3D gVBoxAPI.UIMediumAttachment.GetPort(mediumAttachment, &devi= cePort); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get device port, rc=3D%08x"), rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get device port")); goto cleanup; } rc =3D gVBoxAPI.UIMediumAttachment.GetDevice(mediumAttachment, &de= viceSlot); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get device slot, rc=3D%08x"), rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get device slot")); goto cleanup; } rc =3D gVBoxAPI.UIStorageController.GetBus(controller, &storageBus= ); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get storage controller bus, rc=3D= %08x"), - rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get storage controller bus")); goto cleanup; } =20 if (medium) { rc =3D gVBoxAPI.UIMedium.GetLocation(medium, &mediumLocUtf16); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get medium storage location, = rc=3D%08x"), - rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get medium storage location")= ); goto cleanup; } =20 @@ -3391,8 +3386,8 @@ vboxDumpDisks(virDomainDef *def, struct _vboxDriver *= data, IMachine *machine) =20 rc =3D gVBoxAPI.UIMedium.GetReadOnly(medium, &readOnly); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get read only state, rc=3D%08= x"), rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get read only state")); goto cleanup; } } @@ -4218,9 +4213,8 @@ static int vboxConnectListDefinedDomains(virConnectPt= r conn, rc =3D gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get list of Defined Domains, rc=3D%08= x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get list of Defined Domains")); goto cleanup; } =20 @@ -4271,9 +4265,8 @@ static int vboxConnectNumOfDefinedDomains(virConnectP= tr conn) rc =3D gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GET_MACHINES); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get number of Defined Domains, rc=3D%= 08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get number of Defined Domains")); goto cleanup; } =20 @@ -4364,8 +4357,8 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr do= m, =20 if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("could not attach shared folder '%s', rc= =3D%08x"), - dev->data.fs->dst, (unsigned)rc); + _("could not attach shared folder '%s'"), + dev->data.fs->dst); ret =3D -1; } else { ret =3D 0; @@ -4482,8 +4475,8 @@ static int vboxDomainDetachDevice(virDomainPtr dom, c= onst char *xml) =20 if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("could not detach shared folder '%s', rc= =3D%08x"), - dev->data.fs->dst, (unsigned)rc); + _("could not detach shared folder '%s'"), + dev->data.fs->dst); } else { ret =3D 0; } @@ -4538,9 +4531,8 @@ static int vboxCloseDisksRecursively(virDomainPtr dom= , char *location) AccessMode_ReadWrite, &medium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to open HardDisk, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to open HardDisk")); goto cleanup; } rc =3D gVBoxAPI.UIMedium.GetChildren(medium, &childrenSize, &children); @@ -4572,9 +4564,8 @@ static int vboxCloseDisksRecursively(virDomainPtr dom= , char *location) } rc =3D gVBoxAPI.UIMedium.Close(medium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to close HardDisk, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to close HardDisk")); goto cleanup; } =20 @@ -4738,9 +4729,8 @@ vboxSnapshotRedefine(virDomainPtr dom, AccessMode_ReadWrite, &readWriteMedium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to open HardDisk, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to open HardDisk")); VBOX_UTF16_FREE(locationUtf); goto cleanup; } @@ -4791,9 +4781,8 @@ vboxSnapshotRedefine(virDomainPtr dom, } rc =3D gVBoxAPI.UIMedium.Close(readWriteMedium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to close HardDisk, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to close HardDisk")); goto cleanup; } } @@ -4845,8 +4834,7 @@ vboxSnapshotRedefine(virDomainPtr dom, &readOnlyMedium); if (NS_FAILED(rc)) { vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to open HardDisk, rc=3D%08x"), - (unsigned)rc); + _("Unable to open HardDisk")); VBOX_UTF16_FREE(locationUtf); goto cleanup; } @@ -4882,9 +4870,8 @@ vboxSnapshotRedefine(virDomainPtr dom, =20 rc =3D gVBoxAPI.UIMedium.GetId(parentReadOnlyMedium, &parentiid); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to get hard disk id, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to get hard disk id")); VIR_FREE(uuid); goto cleanup; } @@ -4893,9 +4880,8 @@ vboxSnapshotRedefine(virDomainPtr dom, =20 rc =3D gVBoxAPI.UIMedium.Close(readOnlyMedium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to close HardDisk, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to close HardDisk")); VIR_FREE(uuid); VIR_FREE(parentUuid); goto cleanup; @@ -4922,9 +4908,8 @@ vboxSnapshotRedefine(virDomainPtr dom, &aMediaSize, &aMedia); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to unregister machine, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to unregister machine")); goto cleanup; } VBOX_RELEASE(machine); @@ -4954,9 +4939,8 @@ vboxSnapshotRedefine(virDomainPtr dom, resultCodeUnion resultCode; rc =3D gVBoxAPI.UIMedium.DeleteStorage(medium, &progress); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to delete medium, rc=3D%08x"= ), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to delete medium")); VIR_FREE(locationUtf8); goto cleanup; } @@ -5088,9 +5072,8 @@ vboxSnapshotRedefine(virDomainPtr dom, &medium); VBOX_UTF16_FREE(locationUtf16); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to open HardDisk, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to open HardDisk")); goto cleanup; } } @@ -5121,9 +5104,8 @@ vboxSnapshotRedefine(virDomainPtr dom, AccessMode_ReadWrite, &medium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to open HardDisk, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to open HardDisk")); goto cleanup; } VBOX_UTF16_FREE(locationUtf16); @@ -5201,9 +5183,8 @@ vboxSnapshotRedefine(virDomainPtr dom, /* Close disk */ rc =3D gVBoxAPI.UIMedium.Close(medium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to close HardDisk, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to close HardDisk")); goto cleanup; } } @@ -5235,9 +5216,8 @@ vboxSnapshotRedefine(virDomainPtr dom, AccessMode_ReadWrite, &medium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to open HardDisk, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to open HardDisk")); VBOX_UTF16_FREE(locationUtf16); goto cleanup; } @@ -5245,9 +5225,8 @@ vboxSnapshotRedefine(virDomainPtr dom, =20 rc =3D gVBoxAPI.UIMedium.GetId(medium, &parentiid); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to get hardDisk Id, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to get hardDisk Id")); goto cleanup; } gVBoxAPI.UIID.vboxIIDToUtf8(data, &parentiid, &parentUuid); @@ -5264,9 +5243,8 @@ vboxSnapshotRedefine(virDomainPtr dom, VBOX_UTF16_FREE(newLocation); VBOX_UTF16_FREE(formatUtf16); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to create HardDisk, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to create HardDisk")); goto cleanup; } =20 @@ -5291,9 +5269,8 @@ vboxSnapshotRedefine(virDomainPtr dom, =20 rc =3D gVBoxAPI.UIMedium.GetId(newMedium, &iid); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to get medium uuid, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to get medium uuid")); goto cleanup; } gVBoxAPI.UIID.vboxIIDToUtf8(data, &iid, &uuid); @@ -5339,9 +5316,8 @@ vboxSnapshotRedefine(virDomainPtr dom, /* Closing the "fake" disk */ rc =3D gVBoxAPI.UIMedium.Close(newMedium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to close the new medium, rc=3D%0= 8x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to close the new medium")); goto cleanup; } } @@ -5388,16 +5364,14 @@ vboxSnapshotRedefine(virDomainPtr dom, AccessMode_ReadWrite, &medium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to open HardDisk, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to open HardDisk")); goto cleanup; } rc =3D gVBoxAPI.UIMedium.Close(medium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to close HardDisk, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to close HardDisk")); goto cleanup; } VBOX_UTF16_FREE(locationUtf16); @@ -5414,17 +5388,15 @@ vboxSnapshotRedefine(virDomainPtr dom, settingsFilePath, &machine); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to open Machine, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to open Machine")); goto cleanup; } =20 rc =3D gVBoxAPI.UIVirtualBox.RegisterMachine(data->vboxObj, machine); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to register Machine, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to register Machine")); goto cleanup; } =20 @@ -6972,17 +6944,15 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnaps= hotPtr snapshot) AccessMode_ReadWrite, &medium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to open HardDisk, rc=3D%08x"= ), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to open HardDisk")); goto cleanup; } =20 rc =3D gVBoxAPI.UIMedium.GetId(medium, &parentiid); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to get hardDisk Id, rc=3D%08= x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to get hardDisk Id")); goto cleanup; } gVBoxAPI.UIID.vboxIIDToUtf8(data, &parentiid, &parentUuid); @@ -6998,9 +6968,8 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapsho= tPtr snapshot) newLocation, &newMedium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to create HardDisk, rc=3D%08= x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to create HardDisk")); goto cleanup; } VBOX_UTF16_FREE(formatUtf16); @@ -7027,9 +6996,8 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapsho= tPtr snapshot) =20 rc =3D gVBoxAPI.UIMedium.GetId(newMedium, &iid); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to get medium uuid, rc=3D%08= x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to get medium uuid")); VIR_FREE(disk); goto cleanup; } @@ -7075,9 +7043,8 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapsho= tPtr snapshot) /* Closing the "fake" disk */ rc =3D gVBoxAPI.UIMedium.Close(newMedium); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to close the new medium, rc= =3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to close the new medium")); goto cleanup; } } @@ -7156,9 +7123,8 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapsho= tPtr snapshot) &aMediaSize, &aMedia); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to unregister machine, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to unregister machine")); goto cleanup; } VBOX_RELEASE(machine); @@ -7178,9 +7144,8 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapsho= tPtr snapshot) resultCodeUnion resultCode; rc =3D gVBoxAPI.UIMedium.DeleteStorage(medium, &progress); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to delete medium, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to delete medium")); goto cleanup; } gVBoxAPI.UIProgress.WaitForCompletion(progress, -1); @@ -7235,17 +7200,15 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnaps= hotPtr snapshot) settingsFilePathUtf16, &machine); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to open Machine, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to open Machine")); goto cleanup; } =20 rc =3D gVBoxAPI.UIVirtualBox.RegisterMachine(data->vboxObj, machine); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to register Machine, rc=3D%08x"), - (unsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to register Machine")); goto cleanup; } =20 @@ -7522,8 +7485,8 @@ vboxConnectListAllDomains(virConnectPtr conn, =20 rc =3D gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GE= T_MACHINES); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get list of domains, rc=3D%08x"), (un= signed)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get list of domains")); goto cleanup; } =20 @@ -7722,8 +7685,8 @@ vboxDomainHasManagedSaveImage(virDomainPtr dom, unsig= ned int flags) VBOX_IID_INITIALIZE(&iid); rc =3D gVBoxAPI.UArray.vboxArrayGet(&machines, data->vboxObj, ARRAY_GE= T_MACHINES); if (NS_FAILED(rc)) { - vboxReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get list of machines, rc=3D%08x"), (u= nsigned)rc); + vboxReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get list of machines")); return ret; } =20 --=20 2.39.1