vbox: Rewrite vboxDomainAttachDeviceFlags

This commit is contained in:
Taowei 2014-08-11 18:06:48 +08:00 committed by Michal Privoznik
parent 2b5e727413
commit 5877687765
3 changed files with 10 additions and 15 deletions

View File

@ -4155,3 +4155,11 @@ int vboxDomainAttachDevice(virDomainPtr dom, const char *xml)
{
return vboxDomainAttachDeviceImpl(dom, xml, 0);
}
int vboxDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
unsigned int flags)
{
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE, -1);
return vboxDomainAttachDeviceImpl(dom, xml, 0);
}

View File

@ -1650,21 +1650,6 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr dom,
return ret;
}
static int
vboxDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
unsigned int flags)
{
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1);
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot modify the persistent configuration of a domain"));
return -1;
}
return vboxDomainAttachDeviceImpl(dom, xml, 0);
}
static int vboxDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
unsigned int flags)
{

View File

@ -525,6 +525,8 @@ int vboxConnectListDefinedDomains(virConnectPtr conn,
char ** const names, int maxnames);
int vboxConnectNumOfDefinedDomains(virConnectPtr conn);
int vboxDomainAttachDevice(virDomainPtr dom, const char *xml);
int vboxDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
unsigned int flags);
/* Version specified functions for installing uniformed API */
void vbox22InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);