Class: Libvirt::Interface

Inherits:
Object
  • Object
show all
Defined in:
ext/libvirt/interface.c

Constant Summary collapse

XML_INACTIVE =
INT2NUM(VIR_INTERFACE_XML_INACTIVE)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connectionObject (readonly)

Instance Method Details

#active?Array

Call virInterfaceIsActive[http://www.libvirt.org/html/libvirt-libvirt.html#virInterfaceIsActive] to determine if this interface is currently active.

Returns:

  • (Array)


98
99
100
# File 'ext/libvirt/interface.c', line 98

static VALUE libvirt_interface_active_p(VALUE p) {
    gen_call_truefalse(virInterfaceIsActive, conn(p), interface_get(p));
}

#create(flags = 0) ⇒ nil

Call virInterfaceCreate[http://www.libvirt.org/html/libvirt-libvirt.html#virInterfaceCreate] to start this interface.

Returns:

  • (nil)


61
62
63
64
65
66
67
68
69
70
# File 'ext/libvirt/interface.c', line 61

static VALUE libvirt_interface_create(int argc, VALUE *argv, VALUE s) {
    VALUE flags;

    rb_scan_args(argc, argv, "01", &flags);
    if (NIL_P(flags))
        flags = INT2NUM(0);

    gen_call_void(virInterfaceCreate, conn(s), interface_get(s),
                  NUM2UINT(flags));
}

#destroy(flags = 0) ⇒ nil

Call virInterfaceDestroy[http://www.libvirt.org/html/libvirt-libvirt.html#virInterfaceDestroy] to shutdown this interface.

Returns:

  • (nil)


79
80
81
82
83
84
85
86
87
88
# File 'ext/libvirt/interface.c', line 79

static VALUE libvirt_interface_destroy(int argc, VALUE *argv, VALUE s) {
    VALUE flags;

    rb_scan_args(argc, argv, "01", &flags);
    if (NIL_P(flags))
        flags = INT2NUM(0);

    gen_call_void(virInterfaceDestroy, conn(s), interface_get(s),
                  NUM2UINT(flags));
}

#freenil

Call virInterfaceFree[http://www.libvirt.org/html/libvirt-libvirt.html#virInterfaceFree] to free this interface. The object will no longer be valid after this call.

Returns:

  • (nil)


151
152
153
# File 'ext/libvirt/interface.c', line 151

static VALUE libvirt_interface_free(VALUE s) {
    gen_call_free(Interface, s);
}

#macString

Call virInterfaceGetMACString[http://www.libvirt.org/html/libvirt-libvirt.html#virInterfaceGetMACString] to retrieve the MAC address of this interface.

Returns:

  • (String)


121
122
123
# File 'ext/libvirt/interface.c', line 121

static VALUE libvirt_interface_mac(VALUE s) {
    gen_call_string(virInterfaceGetMACString, conn(s), 0, interface_get(s));
}

#nameString

Call virInterfaceGetName[http://www.libvirt.org/html/libvirt-libvirt.html#virInterfaceGetName] to retrieve the name of this interface.

Returns:

  • (String)


110
111
112
# File 'ext/libvirt/interface.c', line 110

static VALUE libvirt_interface_name(VALUE s) {
    gen_call_string(virInterfaceGetName, conn(s), 0, interface_get(s));
}

#undefinenil

Call virInterfaceUndefine[http://www.libvirt.org/html/libvirt-libvirt.html#virInterfaceUndefine] to undefine this interface.

Returns:

  • (nil)


50
51
52
# File 'ext/libvirt/interface.c', line 50

static VALUE libvirt_interface_undefine(VALUE s) {
    gen_call_void(virInterfaceUndefine, conn(s), interface_get(s));
}

#xml_descString

Call virInterfaceGetXMLDesc[http://www.libvirt.org/html/libvirt-libvirt.html#virInterfaceGetXMLDesc] to retrieve the XML of this interface.

Returns:

  • (String)


132
133
134
135
136
137
138
139
140
141
142
# File 'ext/libvirt/interface.c', line 132

static VALUE libvirt_interface_xml_desc(int argc, VALUE *argv, VALUE s) {
    VALUE flags;

    rb_scan_args(argc, argv, "01", &flags);

    if (NIL_P(flags))
        flags = INT2NUM(0);

    gen_call_string(virInterfaceGetXMLDesc, conn(s), 1, interface_get(s),
                    NUM2UINT(flags));
}