mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
hypervisor api: implement RPC calls for virNodeDeviceDetachFlags
This requires a custom function for remoteNodeDeviceDetachFlags, because it is named *NodeDevice, but it goes through the hypervisor driver rather than nodedevice driver, and so it uses privateData instead of nodeDevicePrivateData. (It has to go through the hypervisor driver, because that is the driver that knows about the backend drivers that will perform the pci device assignment).
This commit is contained in:
parent
353941961a
commit
cc875b8372
@ -2,7 +2,7 @@
|
||||
* remote_driver.c: driver to provide access to libvirtd running
|
||||
* on a remote machine
|
||||
*
|
||||
* Copyright (C) 2007-2012 Red Hat, Inc.
|
||||
* Copyright (C) 2007-2013 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -3404,6 +3404,37 @@ done:
|
||||
return rv;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteNodeDeviceDetachFlags(virNodeDevicePtr dev,
|
||||
const char *driverName,
|
||||
unsigned int flags)
|
||||
{
|
||||
int rv = -1;
|
||||
remote_node_device_detach_flags_args args;
|
||||
/* This method is unusual in that it uses the HV driver, not the
|
||||
* devMon driver hence its use of privateData, instead of
|
||||
* nodeDevicePrivateData
|
||||
*/
|
||||
struct private_data *priv = dev->conn->privateData;
|
||||
|
||||
remoteDriverLock(priv);
|
||||
|
||||
args.name = dev->name;
|
||||
args.driverName = driverName ? (char**)&driverName : NULL;
|
||||
args.flags = flags;
|
||||
|
||||
if (call(dev->conn, priv, 0, REMOTE_PROC_NODE_DEVICE_DETACH_FLAGS,
|
||||
(xdrproc_t) xdr_remote_node_device_detach_flags_args,
|
||||
(char *) &args, (xdrproc_t) xdr_void, (char *) NULL) == -1)
|
||||
goto done;
|
||||
|
||||
rv = 0;
|
||||
|
||||
done:
|
||||
remoteDriverUnlock(priv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteNodeDeviceReAttach(virNodeDevicePtr dev)
|
||||
{
|
||||
@ -6225,6 +6256,7 @@ static virDriver remote_driver = {
|
||||
.domainMigratePrepare2 = remoteDomainMigratePrepare2, /* 0.5.0 */
|
||||
.domainMigrateFinish2 = remoteDomainMigrateFinish2, /* 0.5.0 */
|
||||
.nodeDeviceDettach = remoteNodeDeviceDettach, /* 0.6.1 */
|
||||
.nodeDeviceDetachFlags = remoteNodeDeviceDetachFlags, /* 1.0.5 */
|
||||
.nodeDeviceReAttach = remoteNodeDeviceReAttach, /* 0.6.1 */
|
||||
.nodeDeviceReset = remoteNodeDeviceReset, /* 0.6.1 */
|
||||
.domainMigratePrepareTunnel = remoteDomainMigratePrepareTunnel, /* 0.7.2 */
|
||||
|
@ -3,7 +3,7 @@
|
||||
* remote_internal driver and libvirtd. This protocol is
|
||||
* internal and may change at any time.
|
||||
*
|
||||
* Copyright (C) 2006-2012 Red Hat, Inc.
|
||||
* Copyright (C) 2006-2013 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -1900,6 +1900,12 @@ struct remote_node_device_dettach_args {
|
||||
remote_nonnull_string name;
|
||||
};
|
||||
|
||||
struct remote_node_device_detach_flags_args {
|
||||
remote_nonnull_string name;
|
||||
remote_string driverName;
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
struct remote_node_device_re_attach_args {
|
||||
remote_nonnull_string name;
|
||||
};
|
||||
@ -4423,6 +4429,11 @@ enum remote_procedure {
|
||||
/**
|
||||
* @generate: both
|
||||
*/
|
||||
REMOTE_PROC_DOMAIN_MIGRATE_SET_COMPRESSION_CACHE = 300
|
||||
REMOTE_PROC_DOMAIN_MIGRATE_SET_COMPRESSION_CACHE = 300,
|
||||
|
||||
/**
|
||||
* @generate: server
|
||||
*/
|
||||
REMOTE_PROC_NODE_DEVICE_DETACH_FLAGS = 301
|
||||
|
||||
};
|
||||
|
@ -1440,6 +1440,11 @@ struct remote_node_device_list_caps_ret {
|
||||
struct remote_node_device_dettach_args {
|
||||
remote_nonnull_string name;
|
||||
};
|
||||
struct remote_node_device_detach_flags_args {
|
||||
remote_nonnull_string name;
|
||||
remote_string driverName;
|
||||
u_int flags;
|
||||
};
|
||||
struct remote_node_device_re_attach_args {
|
||||
remote_nonnull_string name;
|
||||
};
|
||||
@ -2488,4 +2493,5 @@ enum remote_procedure {
|
||||
REMOTE_PROC_DOMAIN_GET_JOB_STATS = 298,
|
||||
REMOTE_PROC_DOMAIN_MIGRATE_GET_COMPRESSION_CACHE = 299,
|
||||
REMOTE_PROC_DOMAIN_MIGRATE_SET_COMPRESSION_CACHE = 300,
|
||||
REMOTE_PROC_NODE_DEVICE_DETACH_FLAGS = 301,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user