qemu-display: allow to connect p2p, without destination

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2022-10-17 17:28:34 +04:00
parent 2ed1174df6
commit 0728a62a58

View File

@ -82,16 +82,14 @@ impl<'d> Display<'d> {
D: TryInto<BusName<'d>>, D: TryInto<BusName<'d>>,
D::Error: Into<Error>, D::Error: Into<Error>,
{ {
let dest: BusName = if let Some(dest) = dest { let builder = fdo::ObjectManagerProxy::builder(conn);
dest.try_into().map_err(Into::into)? let builder = if let Some(dest) = dest {
let dest = dest.try_into().map_err(Into::into)?;
builder.destination(dest)?
} else { } else {
"org.qemu".try_into().unwrap() builder
}; };
let proxy = fdo::ObjectManagerProxy::builder(conn) let proxy = builder.path("/org/qemu/Display1")?.build().await?;
.destination(dest)?
.path("/org/qemu/Display1")?
.build()
.await?;
let objects = proxy.get_managed_objects().await?; let objects = proxy.get_managed_objects().await?;
// TODO: listen for changes // TODO: listen for changes
let inner = Inner { let inner = Inner {