[libvirt] [PATCH] virDomainGetAutostart takes a pointer that it writes the output value to
Daniel P. Berrangé
berrange at redhat.com
Wed Aug 21 10:01:41 UTC 2019
On Thu, Aug 15, 2019 at 02:22:52PM -0700, Sage Imel wrote:
> ---
> src/domain.rs | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
The change looks good, however, we need contributors to assert compliance
with the Developer Certificate of Origin:
https://developercertificate.org/
Assuming you're ok with what's described there, you simply need to
add 'Signed-off-by: Your Name <your at email>' in the commit message
of the change. This can be done with 'git commit -s' (--amend for
existing commits)
If you can resend with that done, i'll merge this.
> 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_char) -> 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_uint) -> 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 {
>
> pub fn get_autostart(&self) -> Result<bool, Error> {
> unsafe {
> - let ret = virDomainGetAutostart(self.as_ptr());
> + let mut autostart: libc::c_int = 0;
> + let ret = virDomainGetAutostart(self.as_ptr(), &mut autostart);
> if ret == -1 {
> return Err(Error::new());
> }
> - return Ok(ret == 1);
> + return Ok(autostart == 1);
> }
> }
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
More information about the libvir-list
mailing list