chore: update to zbus 5

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2024-10-08 12:05:24 +04:00
parent 7740f2ffc6
commit dd7a0d3f60
11 changed files with 287 additions and 286 deletions

543
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@ resolver = "2"
[workspace.dependencies] [workspace.dependencies]
tracing = "0.1" tracing = "0.1"
zbus = { version = "4.4", features = ["p2p"] } zbus = { version = "5.0", features = ["p2p", "serde_bytes"] }
pixman-sys = "0.1" pixman-sys = "0.1"
qemu-display = { path = "qemu-display", version = "0.1" } qemu-display = { path = "qemu-display", version = "0.1" }
keycodemap = { path = "keycodemap", version = "0.1" } keycodemap = { path = "keycodemap", version = "0.1" }

View File

@ -14,7 +14,6 @@ tracing.workspace = true
zbus.workspace = true zbus.workspace = true
cfg-if = "1.0" cfg-if = "1.0"
derivative = "2.2" derivative = "2.2"
zvariant = { version = "4", features = ["serde_bytes"] }
libc = "0.2" libc = "0.2"
enumflags2 = { version = "0.7", features = ["serde"] } enumflags2 = { version = "0.7", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }

View File

@ -57,7 +57,7 @@ pub struct Volume {
default_path = "/org/qemu/Display1/Audio", default_path = "/org/qemu/Display1/Audio",
interface = "org.qemu.Display1.Audio" interface = "org.qemu.Display1.Audio"
)] )]
trait Audio { pub trait Audio {
/// RegisterOutListener method /// RegisterOutListener method
fn register_out_listener(&self, listener: Fd<'_>) -> zbus::Result<()>; fn register_out_listener(&self, listener: Fd<'_>) -> zbus::Result<()>;
@ -269,7 +269,7 @@ impl Audio {
&p0, &p0,
)?; )?;
self.proxy.register_out_listener(p0).await?; self.proxy.register_out_listener(p0).await?;
let c = zbus::ConnectionBuilder::unix_stream(p1) let c = zbus::connection::Builder::unix_stream(p1)
.p2p() .p2p()
.serve_at( .serve_at(
"/org/qemu/Display1/AudioOutListener", "/org/qemu/Display1/AudioOutListener",
@ -289,7 +289,7 @@ impl Audio {
&p0, &p0,
)?; )?;
self.proxy.register_in_listener(p0).await?; self.proxy.register_in_listener(p0).await?;
let c = zbus::ConnectionBuilder::unix_stream(p1) let c = zbus::connection::Builder::unix_stream(p1)
.p2p() .p2p()
.serve_at( .serve_at(
"/org/qemu/Display1/AudioInListener", "/org/qemu/Display1/AudioInListener",

View File

@ -110,7 +110,7 @@ impl Console {
&p0, &p0,
)?; )?;
self.proxy.register_listener(p0).await?; self.proxy.register_listener(p0).await?;
let c = zbus::ConnectionBuilder::unix_stream(p1) let c = zbus::connection::Builder::unix_stream(p1)
.p2p() .p2p()
.serve_at("/org/qemu/Display1/Listener", ConsoleListener::new(handler))? .serve_at("/org/qemu/Display1/Listener", ConsoleListener::new(handler))?
.build() .build()

View File

@ -9,7 +9,7 @@ use zbus::{
fdo::ManagedObjects, fdo::ManagedObjects,
names::{BusName, OwnedUniqueName, UniqueName, WellKnownName}, names::{BusName, OwnedUniqueName, UniqueName, WellKnownName},
zvariant::OwnedObjectPath, zvariant::OwnedObjectPath,
Connection, OwnerChangedStream, Connection, proxy::OwnerChangedStream,
}; };
#[cfg(unix)] #[cfg(unix)]

View File

@ -1,7 +1,7 @@
#![allow(clippy::too_many_arguments)] #![allow(clippy::too_many_arguments)]
pub use zbus;
pub use memmap2; pub use memmap2;
pub use zbus;
pub mod util; pub mod util;
#[cfg(windows)] #[cfg(windows)]

View File

@ -17,6 +17,6 @@ pub enum TouchEventKind {
pub trait MultiTouch { pub trait MultiTouch {
fn send_event(&self, kind: TouchEventKind, num_slot: u64, x: f64, y: f64) -> zbus::Result<()>; fn send_event(&self, kind: TouchEventKind, num_slot: u64, x: f64, y: f64) -> zbus::Result<()>;
#[dbus_proxy(property)] #[zbus(property)]
fn max_slots(&self) -> zbus::Result<i32>; fn max_slots(&self) -> zbus::Result<i32>;
} }

View File

@ -1,7 +1,10 @@
[package] [package]
name = "qemu-rdp" name = "qemu-rdp"
version = "0.1.0" version = "0.1.0"
authors = ["Mihnea Buzatu <mihneabuzatu88@gmail.com>"] authors = [
"Mihnea Buzatu <mihneabuzatu88@gmail.com>",
"Marc-André Lureau <marcandre.lureau@redhat.com>",
]
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -23,6 +26,6 @@ ironrdp = { git = "https://github.com/Devolutions/IronRDP", features = [
"svc", "svc",
"cliprdr", "cliprdr",
"displaycontrol", "displaycontrol",
"rdpsnd" "rdpsnd",
] } ] }
futures-util = "0.3" futures-util = "0.3"

View File

@ -14,7 +14,7 @@ async fn main() -> Result<(), anyhow::Error> {
let dbus = match args.dbus_address.take() { let dbus = match args.dbus_address.take() {
None => zbus::Connection::session().await, None => zbus::Connection::session().await,
Some(addr) => { Some(addr) => {
zbus::ConnectionBuilder::address(addr.as_str())? zbus::connection::Builder::address(addr.as_str())?
.build() .build()
.await .await
} }

View File

@ -42,9 +42,9 @@ async fn display_from_opt(opt: Rc<RefCell<AppOptions>>) -> Option<Display<'stati
return Some(Display::new_qmp(qmp_addr).await.unwrap()); return Some(Display::new_qmp(qmp_addr).await.unwrap());
} }
let builder = if let Some(addr) = &opt.borrow().address { let builder = if let Some(addr) = &opt.borrow().address {
zbus::ConnectionBuilder::address(addr.as_str()) zbus::connection::Builder::address(addr.as_str())
} else { } else {
zbus::ConnectionBuilder::session() zbus::connection::Builder::session()
}; };
let conn = builder let conn = builder
.unwrap() .unwrap()