From 0728a62a58e40a032dd4035ba090e1a8bfcd014a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 17 Oct 2022 17:28:34 +0400 Subject: [PATCH] qemu-display: allow to connect p2p, without destination MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau --- qemu-display/src/display.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/qemu-display/src/display.rs b/qemu-display/src/display.rs index 3682255..4a4101a 100644 --- a/qemu-display/src/display.rs +++ b/qemu-display/src/display.rs @@ -82,16 +82,14 @@ impl<'d> Display<'d> { D: TryInto>, D::Error: Into, { - let dest: BusName = if let Some(dest) = dest { - dest.try_into().map_err(Into::into)? + let builder = fdo::ObjectManagerProxy::builder(conn); + let builder = if let Some(dest) = dest { + let dest = dest.try_into().map_err(Into::into)?; + builder.destination(dest)? } else { - "org.qemu".try_into().unwrap() + builder }; - let proxy = fdo::ObjectManagerProxy::builder(conn) - .destination(dest)? - .path("/org/qemu/Display1")? - .build() - .await?; + let proxy = builder.path("/org/qemu/Display1")?.build().await?; let objects = proxy.get_managed_objects().await?; // TODO: listen for changes let inner = Inner {