From nobody Wed Feb 11 10:03:08 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.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; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1490360699012316.14617471931206; Fri, 24 Mar 2017 06:04:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC45680488; Fri, 24 Mar 2017 13:04:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B16F97D642; Fri, 24 Mar 2017 13:04:57 +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 609594E9B4; Fri, 24 Mar 2017 13:04:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2OD4s6A032514 for ; Fri, 24 Mar 2017 09:04:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 48DAB8440A; Fri, 24 Mar 2017 13:04:54 +0000 (UTC) Received: from angien.brq.redhat.com (dhcp129-47.brq.redhat.com [10.34.129.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EB2A84401; Fri, 24 Mar 2017 13:04:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EC45680488 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com EC45680488 From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 24 Mar 2017 14:05:40 +0100 Message-Id: <00e979a7ae91f0180c5ab017bebf4f02cbc9d4c0.1490360622.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH v3 1/3] virerror: Introduce VIR_ERR_OPERATION_UNSAFE 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: , MIME-Version: 1.0 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 24 Mar 2017 13:04:58 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Similarly to VIR_ERR_MIGRATION_UNSAFE add a error code which will be reported when an operation is possible with the hypervisor but may lead to data loss or other problems in certain cases. This error code notifies the user that the operation can be forced using a specific flag. --- include/libvirt/virterror.h | 1 + src/util/virerror.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h index 2efee8f0c..04fea2e34 100644 --- a/include/libvirt/virterror.h +++ b/include/libvirt/virterror.h @@ -319,6 +319,7 @@ typedef enum { VIR_ERR_AGENT_UNSYNCED =3D 97, /* guest agent replies with wron= g id to guest-sync command */ VIR_ERR_LIBSSH =3D 98, /* error in libssh transport dri= ver */ + VIR_ERR_OPERATION_UNSAFE =3D 99, /* unsafe operation requiring ov= erride */ } virErrorNumber; /** diff --git a/src/util/virerror.c b/src/util/virerror.c index ef17fb5e6..1437cf02b 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -1407,6 +1407,11 @@ virErrorMsg(virErrorNumber error, const char *info) else errmsg =3D _("libssh transport error: %s"); break; + case VIR_ERR_OPERATION_UNSAFE: + if (info =3D=3D NULL) + errmsg =3D _("operation unsafe"); + else + errmsg =3D _("operation unsafe: %s"); } return errmsg; } --=20 2.12.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list