[PATCHv2 15/27] uml: reject unknown flags

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

 



* src/uml/uml_driver.c (umlOpen, umlDomainGetXMLDesc)
(umlDomainBlockPeek): Reject unknown flags.
---
 src/uml/uml_driver.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 6a396e4..9f66aee 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -946,7 +946,10 @@ static void umlShutdownVMDaemon(virConnectPtr conn ATTRIBUTE_UNUSED,

 static virDrvOpenStatus umlOpen(virConnectPtr conn,
                                 virConnectAuthPtr auth ATTRIBUTE_UNUSED,
-                                unsigned int flags ATTRIBUTE_UNUSED) {
+                                unsigned int flags)
+{
+    virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
+
     if (conn->uri == NULL) {
         if (uml_driver == NULL)
             return VIR_DRV_OPEN_DECLINED;
@@ -1559,11 +1562,14 @@ cleanup:


 static char *umlDomainGetXMLDesc(virDomainPtr dom,
-                                 unsigned int flags ATTRIBUTE_UNUSED) {
+                                 unsigned int flags)
+{
     struct uml_driver *driver = dom->conn->privateData;
     virDomainObjPtr vm;
     char *ret = NULL;

+    virCheckFlags(0, NULL);
+
     umlDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
     umlDriverUnlock(driver);
@@ -2045,12 +2051,14 @@ umlDomainBlockPeek(virDomainPtr dom,
                    const char *path,
                    unsigned long long offset, size_t size,
                    void *buffer,
-                   unsigned int flags ATTRIBUTE_UNUSED)
+                   unsigned int flags)
 {
     struct uml_driver *driver = dom->conn->privateData;
     virDomainObjPtr vm;
     int fd = -1, ret = -1, i;

+    virCheckFlags(0, -1);
+
     umlDriverLock(driver);
     vm = virDomainFindByUUID(&driver->domains, dom->uuid);
     umlDriverUnlock(driver);
-- 
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]