mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-03 11:25:20 +00:00
vmm: ch-remote: replace deprecated zbus macros with new equivalents
Fixes deprecation related warnings introduced in #6400. Signed-off-by: Omer Faruk Bayram <omer.faruk@sartura.hr>
This commit is contained in:
parent
5a811af099
commit
036e7e3797
@ -15,7 +15,7 @@ use std::marker::PhantomData;
|
|||||||
use std::os::unix::net::UnixStream;
|
use std::os::unix::net::UnixStream;
|
||||||
use std::process;
|
use std::process;
|
||||||
#[cfg(feature = "dbus_api")]
|
#[cfg(feature = "dbus_api")]
|
||||||
use zbus::{dbus_proxy, zvariant::Optional};
|
use zbus::{proxy, zvariant::Optional};
|
||||||
|
|
||||||
type ApiResult = Result<(), Error>;
|
type ApiResult = Result<(), Error>;
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ enum TargetApi<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "dbus_api")]
|
#[cfg(feature = "dbus_api")]
|
||||||
#[dbus_proxy(name = "org.cloudhypervisor.DBusApi1", assume_defaults = false)]
|
#[proxy(name = "org.cloudhypervisor.DBusApi1", assume_defaults = false)]
|
||||||
trait DBusApi1 {
|
trait DBusApi1 {
|
||||||
fn vmm_ping(&self) -> zbus::Result<String>;
|
fn vmm_ping(&self) -> zbus::Result<String>;
|
||||||
fn vmm_shutdown(&self) -> zbus::Result<()>;
|
fn vmm_shutdown(&self) -> zbus::Result<()>;
|
||||||
|
@ -25,7 +25,7 @@ use std::thread;
|
|||||||
use vmm_sys_util::eventfd::EventFd;
|
use vmm_sys_util::eventfd::EventFd;
|
||||||
use zbus::fdo::{self, Result};
|
use zbus::fdo::{self, Result};
|
||||||
use zbus::zvariant::Optional;
|
use zbus::zvariant::Optional;
|
||||||
use zbus::{dbus_interface, ConnectionBuilder};
|
use zbus::{interface, ConnectionBuilder};
|
||||||
|
|
||||||
pub type DBusApiShutdownChannels = (oneshot::Sender<()>, oneshot::Receiver<()>);
|
pub type DBusApiShutdownChannels = (oneshot::Sender<()>, oneshot::Receiver<()>);
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ impl DBusApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[dbus_interface(name = "org.cloudhypervisor.DBusApi1")]
|
#[interface(name = "org.cloudhypervisor.DBusApi1")]
|
||||||
impl DBusApi {
|
impl DBusApi {
|
||||||
async fn vmm_ping(&self) -> Result<String> {
|
async fn vmm_ping(&self) -> Result<String> {
|
||||||
let api_sender = self.clone_api_sender().await;
|
let api_sender = self.clone_api_sender().await;
|
||||||
@ -301,8 +301,8 @@ impl DBusApi {
|
|||||||
.map(|_| ())
|
.map(|_| ())
|
||||||
}
|
}
|
||||||
|
|
||||||
// implementation of this function is provided by the `dbus_interface` macro
|
// implementation of this function is provided by the `#[zbus(signal)]` macro call
|
||||||
#[dbus_interface(signal)]
|
#[zbus(signal)]
|
||||||
async fn event(ctxt: &zbus::SignalContext<'_>, event: Arc<String>) -> zbus::Result<()>;
|
async fn event(ctxt: &zbus::SignalContext<'_>, event: Arc<String>) -> zbus::Result<()>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user