Commit cc0320ed authored by Anael Beutot's avatar Anael Beutot Committed by Sébastien Luttringer
Browse files

Implemented command disablevirtiocache



Set virtio block driver cache to none.

Signed-off-by: default avatarSébastien Luttringer <sebastien.luttringer@smartjog.com>
parent 7edc0a47
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -102,6 +102,25 @@ class Command_resume(TqlCommand):
    def remote_functions(self):
        return set(("resume",))

class Command_disablevirtiocache(TqlCommand):
    '''Set virtio cache to none on VMs disk devices'''

    def __init__(self, cli, argv0):
        TqlCommand.__init__(self, cli, argv0)
        self.tql_filter += "&r=vm&status=stopped"

    def __call__(self, argv):
        # arg parse
        self.parse_args(argv)
        if len(self.args) != 1:
            raise cmdBadArgument()
        # rpc call
        self.rpccall("disablevirtiocache", self.args[0])

    def remote_functions(self):
        return set(("disablevirtiocache",))


class Command_undefine(TqlCommand):
    '''Undefine a stopped vm'''