On Wed, Jul 06, 2011 at 05:23:54PM -0600, Eric Blake wrote:
* src/lxc/lxc_driver.c (lxcOpen, lxcDomainSetMemoryParameters)
(lxcDomainGetMemoryParameters): Reject unknown flags.
---
src/lxc/lxc_driver.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 799a5e7..8684ec6 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -110,8 +110,10 @@ static void lxcDomainEventQueue(lxc_driver_t *driver,
static virDrvOpenStatus lxcOpen(virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
- unsigned int flags ATTRIBUTE_UNUSED)
+ unsigned int flags)
{
+ virCheckFlags(0, VIR_DRV_OPEN_ERROR);
+
/* Verify uri was specified */
if (conn->uri == NULL) {
if (lxc_driver == NULL)
@@ -746,7 +748,7 @@ cleanup:
static int lxcDomainSetMemoryParameters(virDomainPtr dom,
virTypedParameterPtr params,
int nparams,
- unsigned int flags ATTRIBUTE_UNUSED)
+ unsigned int flags)
{
lxc_driver_t *driver = dom->conn->privateData;
int i;
@@ -754,6 +756,8 @@ static int lxcDomainSetMemoryParameters(virDomainPtr dom,
virDomainObjPtr vm = NULL;
int ret = -1;
+ virCheckFlags(0, -1);
+
lxcDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
@@ -843,7 +847,7 @@ cleanup:
static int lxcDomainGetMemoryParameters(virDomainPtr dom,
virTypedParameterPtr params,
int *nparams,
- unsigned int flags ATTRIBUTE_UNUSED)
+ unsigned int flags)
{
lxc_driver_t *driver = dom->conn->privateData;
int i;
@@ -853,6 +857,8 @@ static int lxcDomainGetMemoryParameters(virDomainPtr dom,
int ret = -1;
int rc;
+ virCheckFlags(0, -1);
+
lxcDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
ACK
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|