From nobody Mon Feb 9 01:16:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1562694415; cv=none; d=zoho.com; s=zohoarc; b=ZM9JQ0jUfe9VWLGPXdTuxEeA/pgR5AK/0dhVnFhYC1BP0wDK2ENDJOtCeM0k9nofb9+gaZwQBJpei8DuZ34hwlHcX6QV7SfBGomEpzQa++BdCwTJ21njGqpRru/7p6onUVhHIf3ChF1+PLqhVG2H9tswJV8VP/XB/3xecdPSFqU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562694415; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=JMFbq2rupqBQLo9sn5xPbOB1kUPCFXv8smvULn3W9jI=; b=HrgSaBxH54FKtQjoCcgxwlJ67vMFrNjdlrBb+fwSPxYQ2I6uuQB7jK2ChB13aAcQ5u10kx6Z5Fa4maWlxml4g6dgRa72WajHlAAxMe2yOgppUBW99ATDYzsM0CUqZG4ieN8oLwlWwhpmjKVYBoBWjP/cbBEAo4Uajleaw4q20FY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156269441541943.07574554951475; Tue, 9 Jul 2019 10:46:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A105A3086217; Tue, 9 Jul 2019 17:46:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 714585C69C; Tue, 9 Jul 2019 17:46:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 27F671833002; Tue, 9 Jul 2019 17:46:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x69Hkf7W031138 for ; Tue, 9 Jul 2019 13:46:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id BA2811001B1B; Tue, 9 Jul 2019 17:46:41 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-78.phx2.redhat.com [10.3.116.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F2701001B11; Tue, 9 Jul 2019 17:46:41 +0000 (UTC) From: Eric Blake To: libvir-list@redhat.com Date: Tue, 9 Jul 2019 12:46:30 -0500 Message-Id: <20190709174638.17164-2-eblake@redhat.com> In-Reply-To: <20190709174638.17164-1-eblake@redhat.com> References: <20190709174638.17164-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: pkrempa@redhat.com Subject: [libvirt] [PATCH v2 1/9] vbox: Add various vir*Flags API X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 09 Jul 2019 17:46:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Even though we don't accept any flags, it is unfriendly to callers that use the modern API to have to fall back to the flag-free API. Signed-off-by: Eric Blake --- src/vbox/vbox_common.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 54e31bec9d..44c98cadf6 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -553,7 +553,8 @@ static int vboxConnectClose(virConnectPtr conn) } static int -vboxDomainSave(virDomainPtr dom, const char *path ATTRIBUTE_UNUSED) +vboxDomainSaveFlags(virDomainPtr dom, const char *path ATTRIBUTE_UNUSED, + const char *dxml, unsigned int flags) { vboxDriverPtr data =3D dom->conn->privateData; IConsole *console =3D NULL; @@ -564,6 +565,9 @@ vboxDomainSave(virDomainPtr dom, const char *path ATTRI= BUTE_UNUSED) nsresult rc; int ret =3D -1; + virCheckFlags(0, -1); + virCheckNonNullArgReturn(dxml, -1); + if (!data->vboxObj) return ret; @@ -607,6 +611,12 @@ vboxDomainSave(virDomainPtr dom, const char *path ATTR= IBUTE_UNUSED) return ret; } +static int +vboxDomainSave(virDomainPtr dom, const char *path) +{ + return vboxDomainSaveFlags(dom, path, NULL, 0); +} + static int vboxConnectGetVersion(virConnectPtr conn, unsigned long *versio= n) { vboxDriverPtr data =3D conn->privateData; @@ -2717,7 +2727,8 @@ static char *vboxDomainGetOSType(virDomainPtr dom ATT= RIBUTE_UNUSED) { return osType; } -static int vboxDomainSetMemory(virDomainPtr dom, unsigned long memory) +static int vboxDomainSetMemoryFlags(virDomainPtr dom, unsigned long memory, + unsigned int flags) { vboxDriverPtr data =3D dom->conn->privateData; IMachine *machine =3D NULL; @@ -2727,6 +2738,8 @@ static int vboxDomainSetMemory(virDomainPtr dom, unsi= gned long memory) nsresult rc; int ret =3D -1; + virCheckFlags(0, -1); + if (!data->vboxObj) return ret; @@ -2775,6 +2788,11 @@ static int vboxDomainSetMemory(virDomainPtr dom, uns= igned long memory) return ret; } +static int vboxDomainSetMemory(virDomainPtr dom, unsigned long memory) +{ + return vboxDomainSetMemoryFlags(dom, memory, 0); +} + static int vboxDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) { vboxDriverPtr data =3D dom->conn->privateData; @@ -7995,9 +8013,11 @@ static virHypervisorDriver vboxCommonDriver =3D { .domainDestroyFlags =3D vboxDomainDestroyFlags, /* 0.9.4 */ .domainGetOSType =3D vboxDomainGetOSType, /* 0.6.3 */ .domainSetMemory =3D vboxDomainSetMemory, /* 0.6.3 */ + .domainSetMemoryFlags =3D vboxDomainSetMemoryFlags, /* 5.6.0 */ .domainGetInfo =3D vboxDomainGetInfo, /* 0.6.3 */ .domainGetState =3D vboxDomainGetState, /* 0.9.2 */ .domainSave =3D vboxDomainSave, /* 0.6.3 */ + .domainSaveFlags =3D vboxDomainSaveFlags, /* 5.6.0 */ .domainSetVcpus =3D vboxDomainSetVcpus, /* 0.7.1 */ .domainSetVcpusFlags =3D vboxDomainSetVcpusFlags, /* 0.8.5 */ .domainGetVcpusFlags =3D vboxDomainGetVcpusFlags, /* 0.8.5 */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list