[PATCH 13/20] phyp: reject unknown flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* src/phyp/phyp_driver.c (phypOpen, phypDomainReboot)
(phypVIOSDriverOpen): Reject unknown flags.
---
 src/phyp/phyp_driver.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index d1ab5b4..93f22eb 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -1128,7 +1128,7 @@ exit:

 static virDrvOpenStatus
 phypOpen(virConnectPtr conn,
-         virConnectAuthPtr auth, unsigned int flags ATTRIBUTE_UNUSED)
+         virConnectAuthPtr auth, unsigned int flags)
 {
     LIBSSH2_SESSION *session = NULL;
     ConnectionData *connection_data = NULL;
@@ -1138,6 +1138,8 @@ phypOpen(virConnectPtr conn,
     char *char_ptr;
     char *managed_system = NULL;

+    virCheckFlags(0, VIR_DRV_OPEN_ERROR);
+
     if (!conn || !conn->uri)
         return VIR_DRV_OPEN_DECLINED;

@@ -3389,7 +3391,7 @@ cleanup:
 }

 static int
-phypDomainReboot(virDomainPtr dom, unsigned int flags ATTRIBUTE_UNUSED)
+phypDomainReboot(virDomainPtr dom, unsigned int flags)
 {
     int result = -1;
     ConnectionData *connection_data = dom->conn->networkPrivateData;
@@ -3402,6 +3404,8 @@ phypDomainReboot(virDomainPtr dom, unsigned int flags ATTRIBUTE_UNUSED)
     char *ret = NULL;
     virBuffer buf = VIR_BUFFER_INITIALIZER;

+    virCheckFlags(0, -1);
+
     virBufferAddLit(&buf, "chsysstate");
     if (system_type == HMC)
         virBufferAsprintf(&buf, " -m %s", managed_system);
@@ -3725,8 +3729,10 @@ phypDomainSetCPU(virDomainPtr dom, unsigned int nvcpus)
 static virDrvOpenStatus
 phypVIOSDriverOpen(virConnectPtr conn,
                    virConnectAuthPtr auth ATTRIBUTE_UNUSED,
-                   unsigned int flags ATTRIBUTE_UNUSED)
+                   unsigned int flags)
 {
+    virCheckFlags(0, VIR_DRV_OPEN_ERROR);
+
     if (conn->driver->no != VIR_DRV_PHYP)
         return VIR_DRV_OPEN_DECLINED;

-- 
1.7.4.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]