On Thu, Jun 05, 2025 at 12:15:35PM +0200, Paolo Bonzini wrote:
> Date: Thu, 5 Jun 2025 12:15:35 +0200
> From: Paolo Bonzini
> Subject: [PATCH 06/14] rust: qemu-api: add bindings to Error
> X-Mailer: git-send-email 2.49.0
>
> Provide an implementation of std::error::Error tha
Paolo Bonzini writes:
> Provide an implementation of std::error::Error that bridges the Rust
> anyhow::Error and std::panic::Location types with QEMU's Error*.
>
> It also has several utility methods, analogous to error_propagate(),
> that convert a Result into a return value + Error** pair. One
Provide an implementation of std::error::Error that bridges the Rust
anyhow::Error and std::panic::Location types with QEMU's Error*.
It also has several utility methods, analogous to error_propagate(),
that convert a Result into a return value + Error** pair. One important
difference is that the
Paolo Bonzini writes:
> On 6/4/25 07:01, Markus Armbruster wrote:
>> This is what your FOO_or_propagate() functions are for.
>>
>> The rule glosses over a subtle detail: the difference between
>> error_setg() and error_propagate() isn't just create a new error vs. use
>> an existing one, namely
On 6/4/25 07:01, Markus Armbruster wrote:
This is what your FOO_or_propagate() functions are for.
The rule glosses over a subtle detail: the difference between
error_setg() and error_propagate() isn't just create a new error vs. use
an existing one, namely error_setg() makes the precondition vio
Paolo Bonzini writes:
> On 6/3/25 12:32, Markus Armbruster wrote:
>>> Then Rust's propagate has the same behavior as C (Of course, here Rust
>>> is actually using C's error_propagate, so the two are equivalent.)
>>
>> *If* we want propagate semantics. I'm not sure we do.
>
> Yes, we do. This f
On 6/2/25 15:18, Markus Armbruster wrote:
Paolo Bonzini writes:
Provide an implementation of std::error::Error that bridges the Rust
anyhow::Error and std::panic::Location types with QEMU's Error*.
It also has several utility methods, analogous to error_propagate(),
that convert a Result into
On 6/3/25 12:32, Markus Armbruster wrote:
Then Rust's propagate has the same behavior as C (Of course, here Rust
is actually using C's error_propagate, so the two are equivalent.)
*If* we want propagate semantics. I'm not sure we do.
Yes, we do. This function is used at the Rust-to-C bounda
Zhao Liu writes:
> Markus Armbruster writes:
[...]
>> Let's examine the other aspect: how exactly "storing" behaves.
>>
>> error_setg() according to its contract:
>>
>> If @errp is NULL, the error is ignored. [...]
>>
>> If @errp is &error_abort, print a suitable message and abort()
> > +/// Equivalent of the C function `error_propagate`. Fill `*errp`
>
> Uh, is it? Let's see...
>
> > +/// with the information container in `self` if `errp` is not NULL;
> > +/// then consume it.
> > +///
> > +/// # Safety
> > +///
> > +/// `errp` must be a valid
Paolo Bonzini writes:
> Provide an implementation of std::error::Error that bridges the Rust
> anyhow::Error and std::panic::Location types with QEMU's Error*.
> It also has several utility methods, analogous to error_propagate(),
> that convert a Result into a return value + Error** pair.
>
> Si
Provide an implementation of std::error::Error that bridges the Rust
anyhow::Error and std::panic::Location types with QEMU's Error*.
It also has several utility methods, analogous to error_propagate(),
that convert a Result into a return value + Error** pair.
Signed-off-by: Paolo Bonzini
---
ru
12 matches
Mail list logo