From nobody Fri Apr 26 14:39:49 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1565905471; cv=none; d=zoho.com; s=zohoarc; b=ehanchhJOTo56oe6jv+ClRCVS0Vn/vfmOMXGuB56jwDb888EyNzsiP/SdWAivI7M1knGn/0g+KVD5BxVcTZyvZpOWf70Q8gCYgrEdygNqy0rGvV4QApKmrT9irK4dp5CEKSD06DbWQekipTKC7k4WDljUxKhec0bHZKoWVPfZ/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565905471; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=O/kRyZiZs6rBpNsSmZUsHsvs+y2lTEyk+7X1fPLm6As=; b=YTABW5KJhtoaGPA5GO2m6NQIuuVFMIZiKPjyfLATJpNEvJOkISNLV4o/mgt9dRNPf+fK29Dw9w67/bEteAAFlq/6GAyHgbuyO8KMb0Yq675OxCyXr0xkRskWv5ipKRKO348gQRfiFZTo5eNw2AFLFNX7oh5PUTfQMk3i9D3iedg= 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565905470875149.70543584214374; Thu, 15 Aug 2019 14:44:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F2EEA83F3C; Thu, 15 Aug 2019 21:44:28 +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 4C5A291E94; Thu, 15 Aug 2019 21:44:27 +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 51A6A2551C; Thu, 15 Aug 2019 21:44:26 +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 x7FLg1bb022411 for ; Thu, 15 Aug 2019 17:42:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id BA9151001925; Thu, 15 Aug 2019 21:42:01 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5BB410016EB for ; Thu, 15 Aug 2019 21:41:58 +0000 (UTC) Received: from expn.cat.pdx.edu (expn.cat.pdx.edu [131.252.208.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EB7A285545 for ; Thu, 15 Aug 2019 21:41:56 +0000 (UTC) Received: from noko.cat.pdx.edu (postfix@noko.cat.pdx.edu [10.218.212.15]) by expn.cat.pdx.edu (8.15.2/8.15.2/Debian-3) with ESMTP id x7FLfhOF018586; Thu, 15 Aug 2019 14:41:43 -0700 Received: by noko.cat.pdx.edu (Postfix, from userid 3404) id 5EC551A007B; Thu, 15 Aug 2019 14:41:43 -0700 (PDT) From: Sage Imel To: libvir-list@redhat.com Date: Thu, 15 Aug 2019 14:41:40 -0700 Message-Id: <20190815214140.32600-1-sage@cat.pdx.edu> X-Spam-Status: No, score=1.8 required=5.0 tests=AWL, L_RCVDUSER, SPF_HELO_NONE, WCODE_1b,WCODE_1i autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on expn.cat.pdx.edu X-Virus-Scanned: clamav-milter 0.100.3 at expn.cat.pdx.edu X-Virus-Status: Clean X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 15 Aug 2019 21:41:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 15 Aug 2019 21:41:57 +0000 (UTC) for IP:'131.252.208.110' DOMAIN:'expn.cat.pdx.edu' HELO:'expn.cat.pdx.edu' FROM:'sage@cat.pdx.edu' RCPT:'' X-RedHat-Spam-Score: -2.3 (RCVD_IN_DNSWL_MED, SPF_HELO_NONE, SPF_PASS) 131.252.208.110 expn.cat.pdx.edu 131.252.208.110 expn.cat.pdx.edu X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Sage Imel Subject: [libvirt] [PATCH] virDomainGetAutostart takes a pointer that it writes the output value to 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 15 Aug 2019 21:44:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The current version of get_autostart seg faults. This patch correctly passes a pointer to an int to virDomainGetAutostart and returns a result based on the value of that int Signed-off-by: sage Imel --- src/domain.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/domain.rs b/src/domain.rs index 11ecb3c..acb9e6e 100644 --- a/src/domain.rs +++ b/src/domain.rs @@ -136,7 +136,7 @@ extern "C" { fn virDomainGetHostname(ptr: sys::virDomainPtr, flags: libc::c_uint) -= > *mut libc::c_char; fn virDomainGetUUIDString(ptr: sys::virDomainPtr, uuid: *mut libc::c_c= har) -> libc::c_int; fn virDomainGetXMLDesc(ptr: sys::virDomainPtr, flags: libc::c_uint) ->= *mut libc::c_char; - fn virDomainGetAutostart(ptr: sys::virDomainPtr) -> libc::c_int; + fn virDomainGetAutostart(ptr: sys::virDomainPtr, autostart: *mut libc:= :c_int) -> libc::c_int; fn virDomainSetAutostart(ptr: sys::virDomainPtr, autostart: libc::c_ui= nt) -> libc::c_int; fn virDomainGetID(ptr: sys::virDomainPtr) -> libc::c_uint; fn virDomainSetMaxMemory(ptr: sys::virDomainPtr, memory: libc::c_ulong= ) -> libc::c_int; @@ -1036,11 +1036,12 @@ impl Domain { =20 pub fn get_autostart(&self) -> Result { unsafe { - let ret =3D virDomainGetAutostart(self.as_ptr()); + let mut autostart: libc::c_int =3D 0; + let ret =3D virDomainGetAutostart(self.as_ptr(), &mut autostar= t); if ret =3D=3D -1 { return Err(Error::new()); } - return Ok(ret =3D=3D 1); + return Ok(autostart =3D=3D 1); } } =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list