
On Thu, Jan 14, 2010 at 10:42:43AM -0700, Jim Fehlig wrote:
Implementation of Domain{Attach,Detach}DeviceFlags in remote driver. --- src/remote/remote_driver.c | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index d6f5fce..eb16f62 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -3057,6 +3057,32 @@ done: }
static int +remoteDomainAttachDeviceFlags (virDomainPtr domain, const char *xml, + unsigned int flags) +{ + int rv = -1; + remote_domain_attach_device_flags_args args; + struct private_data *priv = domain->conn->privateData; + + remoteDriverLock(priv); + + make_nonnull_domain (&args.dom, domain); + args.xml = (char *) xml; + args.flags = flags; + + if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_ATTACH_DEVICE_FLAGS, + (xdrproc_t) xdr_remote_domain_attach_device_flags_args, (char *) &args, + (xdrproc_t) xdr_void, (char *) NULL) == -1) + goto done; + + rv = 0; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int remoteDomainDetachDevice (virDomainPtr domain, const char *xml) { int rv = -1; @@ -3081,6 +3107,32 @@ done: }
static int +remoteDomainDetachDeviceFlags (virDomainPtr domain, const char *xml, + unsigned int flags) +{ + int rv = -1; + remote_domain_detach_device_flags_args args; + struct private_data *priv = domain->conn->privateData; + + remoteDriverLock(priv); + + make_nonnull_domain (&args.dom, domain); + args.xml = (char *) xml; + args.flags = flags; + + if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_DETACH_DEVICE_FLAGS, + (xdrproc_t) xdr_remote_domain_detach_device_flags_args, (char *) &args, + (xdrproc_t) xdr_void, (char *) NULL) == -1) + goto done; + + rv = 0; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int remoteDomainGetAutostart (virDomainPtr domain, int *autostart) { int rv = -1; @@ -8894,7 +8946,9 @@ static virDriver remote_driver = { remoteDomainDefineXML, /* domainDefineXML */ remoteDomainUndefine, /* domainUndefine */ remoteDomainAttachDevice, /* domainAttachDevice */ + remoteDomainAttachDeviceFlags, /* domainAttachDeviceFlags */ remoteDomainDetachDevice, /* domainDetachDevice */ + remoteDomainDetachDeviceFlags, /* domainDetachDeviceFlags */ remoteDomainGetAutostart, /* domainGetAutostart */ remoteDomainSetAutostart, /* domainSetAutostart */ remoteDomainGetSchedulerType, /* domainGetSchedulerType */
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|