systemtap stapvirt tool
by Stan Cox
I am having a quandary with libvirt and am wondering if someone can shed
some light.
Systemtap converts a probing and instrumentation language into a kernel
module. The module can optionally be run remotely via ssh or libvirt.
The libvirt mechanism is not working (not yet sure of timing of
regression) The systemtap stap command pipes to a stapvirt command that
is the libvirt interface. The remote is running a stapsh tool that
receives the requests. The initial commands are sent and received okay
(strace output on remote) but never receives the stap kernel module:
# local sent option data request
[pid 11959] read(3, "option data\n", 4096) = 12
# remote says OK
[pid 11959] write(3, "OK\n", 3) = 3
[pid 11959] poll([{fd=3, events=POLLIN}, {fd=0, events=0}, {fd=0,
events=0}], 3, -1) = 1 ([{fd=3, revents=POLLIN}])
[pid 11959] --- SIGIO {si_signo=SIGIO, si_code=SI_KERNEL} ---
[pid 11959] poll([{fd=3, events=POLLHUP}], 1, 0) = 0 (Timeout)
[pid 11959] rt_sigreturn({mask=[]}) = 1
# local sent file ... request to download the module
[pid 11959] read(3, "file 926928 stap_1f18b4b54e74602"..., 4096) = 58
# remote opens the module
[pid 11959] openat(AT_FDCWD,
"stap_1f18b4b54e74602a0a1f0685f2f7333e_1006.ko",
O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
# but never receives it
[pid 11959] read(3, "", 4096) = 0
The local sets up callbacks for stdin, stdout, stream:
ctxt.stdin_w = virEventAddHandle(STDIN_FILENO,
VIR_EVENT_HANDLE_READABLE,
stdin_event, &ctxt, NULL);
...
ctxt.stdout_w = virEventAddHandle(STDOUT_FILENO, 0,
stdout_event, &ctxt, NULL);
...
virStreamEventAddCallback(ctxt.st, VIR_STREAM_EVENT_READABLE |
VIR_EVENT_HANDLE_WRITABLE,
stream_event, &ctxt, NULL) < 0)
Then starts an even loop
while (!disconnect) {
if (virEventRunDefaultImpl() != 0)
break;
}
stream_event is notified for the command requests, but is not notified
for the kernel module chunks:
stdin_event excerpt:
bytes_read = read(fd, ctxt->termbuf + ctxt->termbuf_off,
sizeof(ctxt->termbuf) - ctxt->termbuf_off);
...
ctxt->termbuf_off += bytes_read;
...
if (ctxt->termbuf_off) { // we have stuff to write to the stream
virStreamEventUpdateCallback(ctxt->st, VIR_STREAM_EVENT_READABLE
| VIR_STREAM_EVENT_WRITABLE);
}
stream_event excerpt:
if ((events & VIR_STREAM_EVENT_READABLE)
&& (ctxt->stbuf_off < sizeof(ctxt->stbuf))) {
int bytes_recv = virStreamRecv(st, ctxt->stbuf + ctxt->stbuf_off,
sizeof(ctxt->stbuf) -
ctxt->stbuf_off);
I notice
https://libvirt.org/html/libvirt-libvirt-stream.html
has an example using virStreamSend. Is that the preferred way to do the
above?
2 years, 4 months
Incomplete information in the website Wiki for libvirt.org
by Uriel Emmanuel Pelaez Hernández
Dear Web Marster from wiki.libvirt.org,
I tried to look for the libvirtd, the demon that is suppose to run under
Linux/Unix environment,
but your site didn't show any information. Only a statement appeared:
"Create the page libvirtd "
Please, update your site or suggest any other weblink with the information.
In theory CygWin use your package, but the information is incomplete too,
about this issue.
I send this mail to these both Email address by the information displayed
in your wiki, about the contact address to solve this kind of problems.
By now, Google Service in my region is deprecated, so the information that
the WebBrowser display is not the best.
I send this request from my Email of Graduated Student form the University
domain.
Best Regards,
Mr. Peláez Uriel.
Mexico City
2 years, 4 months
Storage Pool - NFS v4.1
by Charles Koprowski
Hello,
In order to use pNFS which is only available in NFS version 4.1, I'm trying
to create a netfs storage pool specifying the protocol version to be used :
<pool type="netfs">
<name>vms</name>
<source>
...
<format type="nfs"/>
<protocol ver='4.1'/>
</source>
<target>
...
</pool>
But the storage pool XML documentation [1] states that :
protocol
For a netfs Storage Pool provide a mechanism to define which NFS protocol
version number will be used to contact the server's NFS service. The
attribute ver accepts an unsigned *integer* as the version number to use.
And indeed, when I try to virsh pool-define I get :
error: Failed to define pool from pool.xml
error: XML error: storage pool protocol ver '4.1' is malformed
How can I specify the desired NFS minor version to libvirt ?
I could mount the NFS share myself and build a dir storage pool on top of
it but that's not very pretty.
Thank you,
[1] https://libvirt.org/formatstorage.html
--
Charles
2 years, 4 months