Project

General

Profile

Feature #6939

add sysevents to zfs core for commands

Added by Dave Eddy over 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2016-04-28
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Originally created https://smartos.org/bugview/OS-4489

sysevents should be fired in the kernel from ZFS whenever a command is run that is logged in zpool history.

webrev: https://us-east.manta.joyent.com/bahamas10/public/webrev/OS-4489/index.html

Example output

Terminal 1

root - gz sunos ~ # zfs create zones/foobar
root - gz sunos ~ # zfs set quota=10g zones/foobar
root - gz sunos ~ # zfs destroy zones/foobar

Terminal 2

root - gz sunos ~ # sysevent EC_zfs
nvlist version: 0
    date = 2016-04-28T14:50:08.964Z
    vendor = SUNW
    publisher = zfs
    class = EC_zfs
    subclass = ESC_ZFS_history_event
    pid = 0
    data = (embedded nvlist)
    nvlist version: 0
        pool_name = zones
        pool_guid = 0x40c964e8f9a7a694
        history_record = (embedded nvlist)
        nvlist version: 0
            dsname = zones/foobar
            dsid = 0x1525
            history internal str = 
            internal_name = create
            history txg = 0x4c4ef3
            history time = 0x57222320
            history hostname = gz
        (end history_record)

    (end data)

nvlist version: 0
    date = 2016-04-28T14:50:15.421Z
    vendor = SUNW
    publisher = zfs
    class = EC_zfs
    subclass = ESC_ZFS_history_event
    pid = 0
    data = (embedded nvlist)
    nvlist version: 0
        pool_name = zones
        pool_guid = 0x40c964e8f9a7a694
        history_record = (embedded nvlist)
        nvlist version: 0
            dsname = zones/foobar
            dsid = 0x1525
            history internal str = quota=10737418240
            internal_name = set
            history txg = 0x4c4ef5
            history time = 0x57222327
            history hostname = gz
        (end history_record)

    (end data)

nvlist version: 0
    date = 2016-04-28T14:50:18.859Z
    vendor = SUNW
    publisher = zfs
    class = EC_zfs
    subclass = ESC_ZFS_history_event
    pid = 0
    data = (embedded nvlist)
    nvlist version: 0
        pool_name = zones
        pool_guid = 0x40c964e8f9a7a694
        history_record = (embedded nvlist)
        nvlist version: 0
            dsname = zones/foobar
            dsid = 0x1525
            history internal str = 
            internal_name = destroy
            history txg = 0x4c4ef6
            history time = 0x5722232a
            history hostname = gz
        (end history_record)

    (end data)

History

#1

Updated by Electric Monk over 2 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit ce1577b04976f1d8bb5f235b6eaaab15b46a3068

commit  ce1577b04976f1d8bb5f235b6eaaab15b46a3068
Author: Dave Eddy <dave@daveeddy.com>
Date:   2017-06-04T18:35:58.000Z

    6939 add sysevents to zfs core for commands
    Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
    Reviewed by: Joshua M. Clulow <jmc@joyent.com>
    Reviewed by: Josh Wilsdon <jwilsdon@joyent.com>
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: George Wilson <george.wilson@delphix.com>
    Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
    Reviewed by: Alan Somers <asomers@gmail.com>
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Approved by: Matthew Ahrens <mahrens@delphix.com>

Also available in: Atom PDF