Displaying 4 results from an estimated 4 matches for "net_receive".
2016 Jul 31
1
Some question about code of xenapi
Hello, guys! I am doing some experiment to control XenServer with libvirt, when I define a domain, it always fails and gives the following message:
error: Failed to define domain from /root/new.xml
error: internal error: Couldn't get VM information from XML
so I diving into the souce and found it always fails at network creating, and the code in libvirt-1.3.5\src\xenapi\xenapi_utils.c,
2017 Sep 08
5
EOF from net_disconnect(fd)
...n the Go daemon code.
I?m no pro with C but I tried. The snippet from the plugin follows:
alarm(1);?????????????? ???
{
if (net_transmit(fd, str_data(req), str_len(req)) < 0) {
? i_error("write(%s) failed: %m", socket_path);
? ret = -1;
} else {
? char res[1024];
? ret = net_receive(fd, res, sizeof(res)-1);
? if (ret < 0) {
??????????????? i_error("read(%s) failed: %m", socket_path);
? } else {
??????????????? res[ret] = '\0';
??????????????? if (strncmp(res, "OK ", 3) == 0) {
??????????????? ? ret = 0;
??????????????? }
? }
}
}
alarm(...
2017 Sep 08
1
EOF from net_disconnect(fd)
...>>
>> {
>>
>> if (net_transmit(fd, str_data(req), str_len(req)) < 0) {
>>
>> i_error("write(%s) failed: %m", socket_path);
>>
>> ret = -1;
>>
>> } else {
>>
>> char res[1024];
>>
>> ret = net_receive(fd, res, sizeof(res)-1);
>>
>> if (ret < 0) {
>>
>> i_error("read(%s) failed: %m", socket_path);
>>
>> } else {
>>
>> res[ret] = '\0';
>>
>> if (strncmp(res, "OK...
2017 Sep 08
0
EOF from net_disconnect(fd)
...gin follows:
>
>
>
> alarm(1);
>
> {
>
> if (net_transmit(fd, str_data(req), str_len(req)) < 0) {
>
> i_error("write(%s) failed: %m", socket_path);
>
> ret = -1;
>
> } else {
>
> char res[1024];
>
> ret = net_receive(fd, res, sizeof(res)-1);
>
> if (ret < 0) {
>
> i_error("read(%s) failed: %m", socket_path);
>
> } else {
>
> res[ret] = '\0';
>
> if (strncmp(res, "OK ", 3) == 0) {
>
>...