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 to determine if this interface is currently active.

Returns:

  • (Array)


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

static VALUE libvirt_interface_active_p(VALUE p)
{
    ruby_libvirt_generate_call_truefalse(virInterfaceIsActive,
                                         ruby_libvirt_connect_get(p),
                                         interface_get(p));
}

#create(flags = 0) ⇒ nil

Call virInterfaceCreate to start this interface.

Returns:

  • (nil)


68
69
70
71
72
73
74
75
76
77
78
# File 'ext/libvirt/interface.c', line 68

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

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

    ruby_libvirt_generate_call_nil(virInterfaceCreate,
                                   ruby_libvirt_connect_get(i),
                                   interface_get(i),
                                   ruby_libvirt_value_to_uint(flags));
}

#destroy(flags = 0) ⇒ nil

Call virInterfaceDestroy to shutdown this interface.

Returns:

  • (nil)


87
88
89
90
91
92
93
94
95
96
97
# File 'ext/libvirt/interface.c', line 87

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

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

    ruby_libvirt_generate_call_nil(virInterfaceDestroy,
                                   ruby_libvirt_connect_get(i),
                                   interface_get(i),
                                   ruby_libvirt_value_to_uint(flags));
}

#freenil

Call virInterfaceFree to free this interface. The object will no longer be valid after this call.

Returns:

  • (nil)


169
170
171
172
# File 'ext/libvirt/interface.c', line 169

static VALUE libvirt_interface_free(VALUE i)
{
    ruby_libvirt_generate_call_free(Interface, i);
}

#macString

Call virInterfaceGetMACString to retrieve the MAC address of this interface.

Returns:

  • (String)


136
137
138
139
140
141
# File 'ext/libvirt/interface.c', line 136

static VALUE libvirt_interface_mac(VALUE i)
{
    ruby_libvirt_generate_call_string(virInterfaceGetMACString,
                                      ruby_libvirt_connect_get(i),
                                      0, interface_get(i));
}

#nameString

Call virInterfaceGetName to retrieve the name of this interface.

Returns:

  • (String)


122
123
124
125
126
127
# File 'ext/libvirt/interface.c', line 122

static VALUE libvirt_interface_name(VALUE i)
{
    ruby_libvirt_generate_call_string(virInterfaceGetName,
                                      ruby_libvirt_connect_get(i), 0,
                                      interface_get(i));
}

#undefinenil

Call virInterfaceUndefine to undefine this interface.

Returns:

  • (nil)


54
55
56
57
58
59
# File 'ext/libvirt/interface.c', line 54

static VALUE libvirt_interface_undefine(VALUE i)
{
    ruby_libvirt_generate_call_nil(virInterfaceUndefine,
                                   ruby_libvirt_connect_get(i),
                                   interface_get(i));
}

#xml_descString

Call virInterfaceGetXMLDesc to retrieve the XML of this interface.

Returns:

  • (String)


150
151
152
153
154
155
156
157
158
159
160
# File 'ext/libvirt/interface.c', line 150

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

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

    ruby_libvirt_generate_call_string(virInterfaceGetXMLDesc,
                                      ruby_libvirt_connect_get(i),
                                      1, interface_get(i),
                                      ruby_libvirt_value_to_uint(flags));
}