From nobody Wed May 15 07:34:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1621341069; cv=none; d=zohomail.com; s=zohoarc; b=kF2s6q2UpG9c8hx6WS2rZNm6XVvqUTx33IJfgtVN0+gllbRH79eJpdhUbUYT2TcTfs1gv02cL8foiVhN3YjA3WkryVAkYxniRz1uLRV1ivCmgmJJpDao6+0BG4N5sjjuqR2wL74t4JuNWAkYp0aRA6+3uARAT1Jth8gWrkdopwI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621341069; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=jYDf+2KlswSmEt8cCvtN4ZEn48RSSy/FLJl9WXA7rTs=; b=jFES0C3l6wasEpEcxRavIqYsGisZIby68YOmBLYvYyDIAmDrznOr0fj1Sdsm1YEmGn/9+kbvAiOpSpT0rwJMRLnl9HQyXxXNH7dONbd6yFA+PSMUk8i8KpKZz/MIjBHK6Esgawq6ZISfUVHYOIn+YymhOKauozMetf1ZUZiZCLk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 162134106941692.9815826123945; Tue, 18 May 2021 05:31:09 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-249-Hs_M35yhNSuKmfxWwXflTA-1; Tue, 18 May 2021 08:31:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AD1A1801817; Tue, 18 May 2021 12:30:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1A7825D9C0; Tue, 18 May 2021 12:30:50 +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 E8B1A55347; Tue, 18 May 2021 12:30:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14ICUZDM005237 for ; Tue, 18 May 2021 08:30:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2E24F9473; Tue, 18 May 2021 12:30:35 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id A25FF1971B for ; Tue, 18 May 2021 12:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621341067; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jYDf+2KlswSmEt8cCvtN4ZEn48RSSy/FLJl9WXA7rTs=; b=T/0lhmQJAliUor5Esb9tTROajm7Xogo1/GzKaFueb41lk+O3hT4gW1mrRVzHcEvb5UHJpW 7YjxAwnfIDnz2AdGCnmxq8iwhkAPhCxiZZN9hX0SgFJEJMyCo6kQYLCAw6Wm9CqrOCnYrq cmrqd5GEkdit1XjSYQ0tDgkqe4xBgBs= X-MC-Unique: Hs_M35yhNSuKmfxWwXflTA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] virsh: Fix logic wrt to --current flag in cmdSetmem Date: Tue, 18 May 2021 14:30:06 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In my commit of v7.1.0-rc1~376 I've simplified the logic of handling @flags. My assumption back then was that calling virDomainSetMemory() is equivalent to virDomainSetMemoryFlags(flags =3D 0). But that is not the case, because it is equivalent to virDomainSetMemoryFlags(flags =3D VIR_DOMAIN_AFFECT_LIVE). Fix the condition that calls the old API. Fixes: b5e267e8c59a257652f88d034cb1e0ce1ed4b58a Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1961118 Signed-off-by: Michal Privoznik Reviewed-by: Pavel Hrdina --- tools/virsh-domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 0825f82522..bd9325a1d8 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -9025,7 +9025,7 @@ cmdSetmem(vshControl *ctl, const vshCmd *cmd) } kibibytes =3D VIR_DIV_UP(bytes, 1024); =20 - if (flags =3D=3D 0) { + if (flags =3D=3D VIR_DOMAIN_AFFECT_LIVE) { if (virDomainSetMemory(dom, kibibytes) !=3D 0) ret =3D false; } else { --=20 2.26.3