From nobody Wed Feb 11 11:34:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; envelope-from=libvir-list-bounces@redhat.com; helo=mx3-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by mx.zohomail.com with SMTPS id 1487923605690940.1774638016881; Fri, 24 Feb 2017 00:06:45 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1O83WbT012172; Fri, 24 Feb 2017 03:03:32 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1O83UsR028206 for ; Fri, 24 Feb 2017 03:03:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id 092502D654; Fri, 24 Feb 2017 08:03:30 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 020712D653 for ; Fri, 24 Feb 2017 08:03:29 +0000 (UTC) Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 54AEF4E4D0 for ; Fri, 24 Feb 2017 08:03:29 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id o64so726808pfb.1 for ; Fri, 24 Feb 2017 00:03:28 -0800 (PST) Received: from localhost.net ([2601:647:4501:a0d1::9f97]) by smtp.googlemail.com with ESMTPSA id s5sm13610285pgc.57.2017.02.24.00.03.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Feb 2017 00:03:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=IT2BnC3K83a1pPKSCKRV02I0Gr16KYUA18ktL1FwgKE=; b=I6FhWDozVN/zAx7I7iwwe33NLAIN65Ht7Eb2FLY7mtTkHTvVDVE3I1GkDHr6kFtrc0 pY+TWQdwFwamC8bQ6RepihF+QCe0ve2eTw7sbdkM+DoH98G/FFef2KDWni7q4W5KVLQo Qbda/rqD6hwaJ+x3tSNFE69qvEf5ho/2kRhVSHlzZ4SNLaI0LGKClhvYFiGcK/hnOApB qA/jAYKo6HJOgFmrpZvvUzJry8nONZW3RT9Gw/u714lGbEjh1OwFMzLLovGy4IlKtD4T zkanxWQehnajYqVVfjtuA7tx2fUaXE1l+r5N73/Y8ZJ/juVjwarP6HkWdjC3la9q7IMV c1bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=IT2BnC3K83a1pPKSCKRV02I0Gr16KYUA18ktL1FwgKE=; b=BBk+GO7Qgq9WIGVLgiQIC2lVL2uKFTFbNsposcWrIIwbH/gurqpYraZ6ar0w+vf2tn QE61gVeG1vmF9KxN5kYkob0AL5gHu+NJxh7wOPEujmH7FUi8rYV/wAfiBuaxFOmnIw+h IL0tQzq1BSAfAt7YVE9KHW3JEsZ0gX+KmK4MhK5Y2ZchLZJvOgKCaSyvSeKhxfphe/kQ fqMtUM00QKmUjuU+E0sCnyXEuQFjq4lWM3brkN/e1UjaiqAuqRSdkjR3kgE5SMP9f8Z4 mGGEyWCMk0X7jQwojHHttGqAHkI/xcMXYB5y3ujc1ztENQczjUPzOz1XIm9DFC/B3LYR AbWw== X-Gm-Message-State: AMke39myrZ6BXTd+dcNGDMXmM0YnzrO2QmxWK5iRv6ELjJBP//acPN3YePhqV2KShA7GRg== X-Received: by 10.98.31.17 with SMTP id f17mr1894100pff.78.1487923407558; Fri, 24 Feb 2017 00:03:27 -0800 (PST) From: Sagar Ghuge To: libvir-list@redhat.com Date: Fri, 24 Feb 2017 00:03:12 -0800 Message-Id: <20170224080314.23074-2-ghugesss@gmail.com> In-Reply-To: <20170224080314.23074-1-ghugesss@gmail.com> References: <20170224080314.23074-1-ghugesss@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 24 Feb 2017 08:03:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 24 Feb 2017 08:03:29 +0000 (UTC) for IP:'209.85.192.193' DOMAIN:'mail-pf0-f193.google.com' HELO:'mail-pf0-f193.google.com' FROM:'ghugesss@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.482 (BAYES_50, DCC_REPUT_13_19, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.192.193 mail-pf0-f193.google.com 209.85.192.193 mail-pf0-f193.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] libxl: Implement virDomainObjCheckIsActive 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add function which raises error if domain is not active Signed-off-by: Sagar Ghuge --- src/conf/domain_conf.c | 15 +++++++++++++++ src/conf/domain_conf.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 97d42fe..a44454c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2997,6 +2997,21 @@ virDomainObjWait(virDomainObjPtr vm) } =20 =20 +int +virDomainObjCheckIsActive(virDomainObjPtr vm) +{ + if (!virDomainObjIsActive(vm)) { + virReportError(VIR_ERR_OPERATION_FAILED, "%s", + _("domain is not running")); + return -1; + } + + return 0; +} + + + + /** * Waits for domain condition to be triggered for a specific period of tim= e. * diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 1e53cc3..cfeb1ba 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2559,6 +2559,7 @@ bool virDomainObjTaint(virDomainObjPtr obj, =20 void virDomainObjBroadcast(virDomainObjPtr vm); int virDomainObjWait(virDomainObjPtr vm); +int virDomainObjCheckIsActive(virDomainObjPtr vm); int virDomainObjWaitUntil(virDomainObjPtr vm, unsigned long long whenms); =20 --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list