From 8476439df49a68055b19ec8d79a28be76ea06036b52796186b74134317bd671b Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Thu, 10 Apr 2014 17:21:32 +0000 Subject: [PATCH] - Handle the case when the target file exists correctly in hv_fcopy_daemon - vssdaemon: Ignore VFAT mounts during the Freeze operation OBS-URL: https://build.opensuse.org/package/show/Virtualization/hyper-v?expand=0&rev=91 --- hyper-v.changes | 6 ++++++ hyper-v.include.linux.hyperv.h | 1 + hyper-v.tools.hv.hv_fcopy_daemon.c | 4 +++- hyper-v.tools.hv.hv_vss_daemon.c | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hyper-v.changes b/hyper-v.changes index a38ceb7..9acea3f 100644 --- a/hyper-v.changes +++ b/hyper-v.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 10 19:19:04 CEST 2014 - ohering@suse.de + +- Handle the case when the target file exists correctly in hv_fcopy_daemon +- vssdaemon: Ignore VFAT mounts during the Freeze operation + ------------------------------------------------------------------- Sun Mar 2 18:11:31 CET 2014 - ohering@suse.de diff --git a/hyper-v.include.linux.hyperv.h b/hyper-v.include.linux.hyperv.h index 16ffdca..29f83dd 100644 --- a/hyper-v.include.linux.hyperv.h +++ b/hyper-v.include.linux.hyperv.h @@ -300,6 +300,7 @@ enum hv_kvp_exchg_pool { #define HV_ERROR_DEVICE_NOT_CONNECTED 0x8007048F #define HV_INVALIDARG 0x80070057 #define HV_GUID_NOTFOUND 0x80041002 +#define HV_ERROR_ALREADY_EXISTS 0x80070050 #define ADDR_FAMILY_NONE 0x00 #define ADDR_FAMILY_IPV4 0x01 diff --git a/hyper-v.tools.hv.hv_fcopy_daemon.c b/hyper-v.tools.hv.hv_fcopy_daemon.c index f5db03a..22234b6 100644 --- a/hyper-v.tools.hv.hv_fcopy_daemon.c +++ b/hyper-v.tools.hv.hv_fcopy_daemon.c @@ -82,8 +82,10 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg) if (!access(target_fname, F_OK)) { syslog(LOG_INFO, "File: %s exists", target_fname); - if (!smsg->copy_flags & OVER_WRITE) + if (!(smsg->copy_flags & OVER_WRITE)) { + error = HV_ERROR_ALREADY_EXISTS; goto done; + } } target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC, 0744); diff --git a/hyper-v.tools.hv.hv_vss_daemon.c b/hyper-v.tools.hv.hv_vss_daemon.c index 630f182..ffa3df3 100644 --- a/hyper-v.tools.hv.hv_vss_daemon.c +++ b/hyper-v.tools.hv.hv_vss_daemon.c @@ -88,6 +88,8 @@ static int vss_operate(int operation) continue; if (strcmp(ent->mnt_type, "iso9660") == 0) continue; + if (strcmp(ent->mnt_type, "vfat") == 0) + continue; if (strcmp(ent->mnt_dir, "/") == 0) { root_seen = 1; continue;