Accepting request 265533 from Virtualization
- Start hv_kvp_daemon after network-online.target (bnc#910353) - ignore ENOBUFS and ENOMEM in the KVP daemon - vssdaemon: skip all filesystems mounted readonly (bnc#909864) - vssdaemon: report freeze errors OBS-URL: https://build.opensuse.org/request/show/265533 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/hyper-v?expand=0&rev=28
This commit is contained in:
commit
5ea24ccc95
@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 17 09:06:33 UTC 2014 - ohering@suse.de
|
||||
|
||||
- Start hv_kvp_daemon after network-online.target (bnc#910353)
|
||||
- ignore ENOBUFS and ENOMEM in the KVP daemon
|
||||
- vssdaemon: skip all filesystems mounted readonly (bnc#909864)
|
||||
- vssdaemon: report freeze errors
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 25 17:46:30 UTC 2014 - ohering@suse.de
|
||||
|
||||
|
12
hyper-v.spec
12
hyper-v.spec
@ -129,15 +129,17 @@ cat > ${d}/%{hv_kvp_daemon}.service <<EOF
|
||||
# started via %{_udevrulesdir}/%{hv_kvp_daemon}.rules
|
||||
[Unit]
|
||||
Description=Hyper-V KVP Daemon
|
||||
# During startup the current hostname is cached, so start very late
|
||||
Requires=network-online.target
|
||||
After=network-online.target
|
||||
ConditionVirtualization=microsoft
|
||||
|
||||
[Service]
|
||||
Environment="PATH=%{helper_dir}/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
Type=forking
|
||||
# Restart appears to work, but its unsupported
|
||||
# Reboot required until kernel-user protocol is fixed
|
||||
ExecStartPre=/usr/bin/mkdir /run/%{hv_kvp_daemon}
|
||||
ExecStart=${bindir}/%{hv_kvp_daemon}
|
||||
ExecStart=${bindir}/%{hv_kvp_daemon} --no-daemon
|
||||
ExecReload=/usr/bin/false
|
||||
Restart=no
|
||||
|
||||
@ -152,11 +154,10 @@ Description=Hyper-V VSS Daemon
|
||||
ConditionVirtualization=microsoft
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
# Restart appears to work, but its unsupported
|
||||
# Reboot required until kernel-user protocol is fixed
|
||||
ExecStartPre=/usr/bin/mkdir /run/%{hv_vss_daemon}
|
||||
ExecStart=${bindir}/%{hv_vss_daemon}
|
||||
ExecStart=${bindir}/%{hv_vss_daemon} --no-daemon
|
||||
ExecReload=/usr/bin/false
|
||||
Restart=no
|
||||
|
||||
@ -171,8 +172,7 @@ Description=Hyper-V host to guest file copy daemon
|
||||
ConditionVirtualization=microsoft
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=${bindir}/%{hv_fcopy_daemon}
|
||||
ExecStart=${bindir}/%{hv_fcopy_daemon} --no-daemon
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
@ -1561,8 +1561,15 @@ int main(int argc, char *argv[])
|
||||
addr_p, &addr_l);
|
||||
|
||||
if (len < 0) {
|
||||
int saved_errno = errno;
|
||||
syslog(LOG_ERR, "recvfrom failed; pid:%u error:%d %s",
|
||||
addr.nl_pid, errno, strerror(errno));
|
||||
|
||||
if (saved_errno == ENOBUFS) {
|
||||
syslog(LOG_ERR, "receive error: ignored");
|
||||
continue;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
@ -1765,8 +1772,15 @@ kvp_done:
|
||||
|
||||
len = netlink_send(fd, incoming_cn_msg);
|
||||
if (len < 0) {
|
||||
int saved_errno = errno;
|
||||
syslog(LOG_ERR, "net_link send failed; error: %d %s", errno,
|
||||
strerror(errno));
|
||||
|
||||
if (saved_errno == ENOMEM || saved_errno == ENOBUFS) {
|
||||
syslog(LOG_ERR, "send error: ignored");
|
||||
continue;
|
||||
}
|
||||
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ static int vss_operate(int operation)
|
||||
FILE *mounts;
|
||||
struct mntent *ent;
|
||||
unsigned int cmd;
|
||||
int error = 0, root_seen = 0;
|
||||
int error = 0, root_seen = 0, save_errno = 0;
|
||||
|
||||
switch (operation) {
|
||||
case VSS_OP_FREEZE:
|
||||
@ -103,7 +103,7 @@ static int vss_operate(int operation)
|
||||
while ((ent = getmntent(mounts))) {
|
||||
if (strncmp(ent->mnt_fsname, match, strlen(match)))
|
||||
continue;
|
||||
if (strcmp(ent->mnt_type, "iso9660") == 0)
|
||||
if (hasmntopt(ent, MNTOPT_RO) != NULL)
|
||||
continue;
|
||||
if (strcmp(ent->mnt_type, "vfat") == 0)
|
||||
continue;
|
||||
@ -115,7 +115,6 @@ static int vss_operate(int operation)
|
||||
if (error && operation == VSS_OP_FREEZE)
|
||||
goto err;
|
||||
}
|
||||
endmntent(mounts);
|
||||
|
||||
if (root_seen) {
|
||||
error |= vss_do_freeze("/", cmd);
|
||||
@ -123,10 +122,19 @@ static int vss_operate(int operation)
|
||||
goto err;
|
||||
}
|
||||
|
||||
return error;
|
||||
goto out;
|
||||
err:
|
||||
endmntent(mounts);
|
||||
save_errno = errno;
|
||||
vss_operate(VSS_OP_THAW);
|
||||
/* Call syslog after we thaw all filesystems */
|
||||
if (ent)
|
||||
syslog(LOG_ERR, "FREEZE of %s failed; error:%d %s",
|
||||
ent->mnt_dir, save_errno, strerror(save_errno));
|
||||
else
|
||||
syslog(LOG_ERR, "FREEZE of / failed; error:%d %s", save_errno,
|
||||
strerror(save_errno));
|
||||
out:
|
||||
endmntent(mounts);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user