Update zbus: use the new server builder API

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2021-10-12 00:33:55 +04:00
parent eeb1063ab4
commit ab44cda4b9
6 changed files with 13 additions and 31 deletions

View File

@ -9,7 +9,7 @@ edition = "2018"
[dependencies]
log = "0.4"
derivative = "2.2.0"
zbus = { version = "2.0.0-beta", features = ["xml"] }
zbus = { version = "2.0.0-beta.7", features = ["xml"] }
zvariant = { version = "2.4.0", features = ["serde_bytes"] }
libc = "0.2.86"
enumflags2 = { version = "0.6.4", features = ["serde"] }

View File

@ -241,18 +241,12 @@ impl Audio {
.await?;
let c = zbus::ConnectionBuilder::unix_stream(p1)
.p2p()
.serve_at(
"/org/qemu/Display1/AudioOutListener",
AudioOutListener { handler },
)?
.build()
.await?;
{
let mut server = c.object_server_mut().await;
server
.at(
"/org/qemu/Display1/AudioOutListener",
AudioOutListener { handler },
)
.unwrap();
server.start_dispatch();
}
self.out_listener.replace(c);
Ok(())
}
@ -264,18 +258,12 @@ impl Audio {
.await?;
let c = zbus::ConnectionBuilder::unix_stream(p1)
.p2p()
.serve_at(
"/org/qemu/Display1/AudioInListener",
AudioInListener { handler },
)?
.build()
.await?;
{
let mut server = c.object_server_mut().await;
server
.at(
"/org/qemu/Display1/AudioInListener",
AudioInListener { handler },
)
.unwrap();
server.start_dispatch();
}
self.in_listener.replace(c);
Ok(())
}

View File

@ -90,15 +90,9 @@ impl Console {
self.proxy.register_listener(p0.as_raw_fd().into()).await?;
let c = zbus::ConnectionBuilder::unix_stream(p1)
.p2p()
.serve_at("/org/qemu/Display1/Listener", ConsoleListener::new(handler))?
.build()
.await?;
{
let mut server = c.object_server_mut().await;
server
.at("/org/qemu/Display1/Listener", ConsoleListener::new(handler))
.unwrap();
server.start_dispatch();
}
self.listener.replace(Some(c));
Ok(())
}

View File

@ -10,7 +10,7 @@ edition = "2018"
log = "0.4"
pretty_env_logger = "0.4"
once_cell = "1.5"
zbus = { version = "2.0.0-beta" }
zbus = { version = "2.0.0-beta.7" }
qemu-display = { path = "../qemu-display" }
keycodemap = { path = "../keycodemap" }
rdw = { package = "rdw4", version = "0.1.0" }

View File

@ -11,7 +11,7 @@ qemu-display = { path = "../qemu-display" }
keycodemap = { path ="../keycodemap" }
vnc = "0.4.0"
clap = "3.0.0-beta.2"
zbus = { version = "2.0.0-beta" }
zbus = { version = "2.0.0-beta.7" }
libc = "0.2.86"
image = "0.23.14"
derivative = "2.2.0"

View File

@ -7,7 +7,7 @@ edition = "2018"
log = "0.4"
pretty_env_logger = "0.4"
once_cell = "1.5"
zbus = { version = "2.0.0-beta" }
zbus = { version = "2.0.0-beta.7" }
qemu-display = { path = "../qemu-display" }
futures = "0.3.13"