diff --git a/.fence-virt.metadata b/.fence-virt.metadata index 3f18d62..8e67cdb 100644 --- a/.fence-virt.metadata +++ b/.fence-virt.metadata @@ -1 +1 @@ -f48f5e40ad9a3474f5aa9194b868ab1e2bdcc94d SOURCES/fence-virt-0.3.0.tar.gz +f2aba75fd5e3fbbbcacaec5397aae634d3574693 SOURCES/fence-virt-0.3.2.tar.bz2 diff --git a/.gitignore b/.gitignore index a301740..8557c2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/fence-virt-0.3.0.tar.gz +SOURCES/fence-virt-0.3.2.tar.bz2 diff --git a/SOURCES/Explicitly-set-delay-to-0.patch b/SOURCES/Explicitly-set-delay-to-0.patch deleted file mode 100644 index 6818dea..0000000 --- a/SOURCES/Explicitly-set-delay-to-0.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0c502aad7743ade8a6c2eeec780f36f61d312f4c Mon Sep 17 00:00:00 2001 -From: Ryan McCabe -Date: Wed, 17 Oct 2012 12:54:55 -0400 -Subject: [PATCH] fence-virt: Explicitly set delay to 0 - -Explicitly set the delay argument to 0 when initializing the args -struct. - -Signed-off-by: Ryan McCabe ---- - client/options.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/client/options.c b/client/options.c -index cd975ae..40c6587 100644 ---- a/client/options.c -+++ b/client/options.c -@@ -590,6 +590,7 @@ args_init(fence_virt_args_t *args) - args->retr_time = 20; - args->flags = 0; - args->debug = 0; -+ args->delay = 0; - } - - --- -1.7.11.7 - diff --git a/SOURCES/Fix-typo-in-fence_virt-8-man-page.patch b/SOURCES/Fix-typo-in-fence_virt-8-man-page.patch deleted file mode 100644 index 1545547..0000000 --- a/SOURCES/Fix-typo-in-fence_virt-8-man-page.patch +++ /dev/null @@ -1,30 +0,0 @@ -From b35ac70bf29b4137ca30d5cb4a33ad6f7ba00059 Mon Sep 17 00:00:00 2001 -From: Ryan McCabe -Date: Mon, 8 Oct 2012 10:54:25 -0400 -Subject: [PATCH] fence_virt: Fix typo in fence_virt(8) man page - -Fix the description of when serial/vmchannel parameters are accepted. - -Signed-off-by: Ryan McCabe ---- - man/fence_virt.8 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/man/fence_virt.8 b/man/fence_virt.8 -index 57869da..14406ce 100644 ---- a/man/fence_virt.8 -+++ b/man/fence_virt.8 -@@ -100,8 +100,8 @@ Specify if using fence_virt with older fence_xvmd installations - which are using UUIDs. Fence_virtd ignores this parameter. - - .SH SERIAL/VMCHANNEL PARAMETERS --These parameters are used only when using fence_virt in multicast mode --(e.g. by running fence_xvm). -+These parameters are used only when using fence_virt in serial mode -+(e.g. by running fence_virt). - - .TP - .B -D --- -1.7.11.7 - diff --git a/SOURCES/Improve-fence_virt.conf-man-page-description-of-hash.patch b/SOURCES/Improve-fence_virt.conf-man-page-description-of-hash.patch deleted file mode 100644 index fd00207..0000000 --- a/SOURCES/Improve-fence_virt.conf-man-page-description-of-hash.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 96ff88d44f69869528d24ad4d37c41fc6ca95057 Mon Sep 17 00:00:00 2001 -From: Lon Hohberger -Date: Wed, 25 Jul 2012 11:10:54 -0400 -Subject: [PATCH] Improve fence_virt.conf man page description of 'hash' - -Signed-off-by: Lon Hohberger -Acked-by: Ryan McCabe -Acked-by: Jaroslav Kortus ---- - man/fence_virt.conf.5 | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/man/fence_virt.conf.5 b/man/fence_virt.conf.5 -index c9e8243..364233c 100644 ---- a/man/fence_virt.conf.5 -+++ b/man/fence_virt.conf.5 -@@ -83,7 +83,7 @@ the shared key file to use (default: /etc/cluster/fence_xvm.key). - .TP - .B hash - . --the hashing algorithm to use for packet signing (default: sha256, but could -+the weakest hashing algorithm allowed for client requests. Clients may send packets with stronger hashes than the one specified, but not weaker ones. (default: sha256, but could - be sha1, sha512, or none) - - .TP --- -1.7.11.7 - diff --git a/SOURCES/Return-failure-for-nonexistent-domains.patch b/SOURCES/Return-failure-for-nonexistent-domains.patch deleted file mode 100644 index 95057aa..0000000 --- a/SOURCES/Return-failure-for-nonexistent-domains.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 98e332e2432c9cf559cd55e3ff8489f658328021 Mon Sep 17 00:00:00 2001 -From: Ryan McCabe -Date: Mon, 8 Oct 2012 10:53:13 -0400 -Subject: [PATCH] fence_virt: Return failure for nonexistent domains - -Return failure instead of success if a user attempts an operation -on a domain that does not exist. - -Signed-off-by: Ryan McCabe ---- - server/checkpoint.c | 4 ++-- - server/libvirt.c | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/server/checkpoint.c b/server/checkpoint.c -index 408003f..3ac7e6b 100644 ---- a/server/checkpoint.c -+++ b/server/checkpoint.c -@@ -393,7 +393,7 @@ do_off(const char *vm_name) - - if (vdp) - virDomainFree(vdp); -- return 0; -+ return 1; - } - - syslog(LOG_NOTICE, "Destroying domain %s\n", vm_name); -@@ -452,7 +452,7 @@ do_reboot(const char *vm_name) - "do - domain does not exist\n"); - if (vdp) - virDomainFree(vdp); -- return 0; -+ return 1; - } - - syslog(LOG_NOTICE, "Rebooting domain %s\n", vm_name); -diff --git a/server/libvirt.c b/server/libvirt.c -index ac93f18..12bb8ad 100644 ---- a/server/libvirt.c -+++ b/server/libvirt.c -@@ -178,7 +178,7 @@ libvirt_off(const char *vm_name, const char *src, - - if (vdp) - virDomainFree(vdp); -- return 0; -+ return 1; - } - - syslog(LOG_NOTICE, "Destroying domain %s\n", vm_name); -@@ -320,7 +320,7 @@ libvirt_reboot(const char *vm_name, const char *src, - "do - domain does not exist\n"); - if (vdp) - virDomainFree(vdp); -- return 0; -+ return 1; - } - - syslog(LOG_NOTICE, "Rebooting domain %s\n", vm_name); --- -1.7.11.7 - diff --git a/SOURCES/Return-success-if-a-domain-exists-but-is-off.patch b/SOURCES/Return-success-if-a-domain-exists-but-is-off.patch deleted file mode 100644 index 6665089..0000000 --- a/SOURCES/Return-success-if-a-domain-exists-but-is-off.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 0de5dd3ac988386085c2cb600e8d122974ab3981 Mon Sep 17 00:00:00 2001 -From: Ryan McCabe -Date: Fri, 26 Oct 2012 18:14:45 -0400 -Subject: [PATCH] fence_virtd: Return success if a domain exists but is - already off. - -Return success if a domain exists but is already off. - -Signed-off-by: Ryan McCabe ---- - server/checkpoint.c | 27 +++++++++++++++++---------- - server/libvirt.c | 28 ++++++++++++++++++---------- - 2 files changed, 35 insertions(+), 20 deletions(-) - -diff --git a/server/checkpoint.c b/server/checkpoint.c -index 3ac7e6b..edf7728 100644 ---- a/server/checkpoint.c -+++ b/server/checkpoint.c -@@ -386,16 +386,18 @@ do_off(const char *vm_name) - vdp = virDomainLookupByName(vp, vm_name); - } - -- if (!vdp || -- ((virDomainGetInfo(vdp, &vdi) == 0) && -- (vdi.state == VIR_DOMAIN_SHUTOFF))) { -+ if (!vdp) { - dbg_printf(2, "Nothing to do - domain does not exist\n"); -- -- if (vdp) -- virDomainFree(vdp); - return 1; - } - -+ if (((virDomainGetInfo(vdp, &vdi) == 0) && -+ (vdi.state == VIR_DOMAIN_SHUTOFF))) { -+ dbg_printf(2, "Nothing to do - domain is off\n"); -+ virDomainFree(vdp); -+ return 0; -+ } -+ - syslog(LOG_NOTICE, "Destroying domain %s\n", vm_name); - dbg_printf(2, "[OFF] Calling virDomainDestroy\n"); - ret = virDomainDestroy(vdp); -@@ -446,15 +448,20 @@ do_reboot(const char *vm_name) - vdp = virDomainLookupByName(vp, vm_name); - } - -- if (!vdp || ((virDomainGetInfo(vdp, &vdi) == 0) && -- (vdi.state == VIR_DOMAIN_SHUTOFF))) { -+ if (!vdp) { - dbg_printf(2, "[libvirt:REBOOT] Nothing to " - "do - domain does not exist\n"); -- if (vdp) -- virDomainFree(vdp); - return 1; - } - -+ if (((virDomainGetInfo(vdp, &vdi) == 0) && -+ (vdi.state == VIR_DOMAIN_SHUTOFF))) { -+ dbg_printf(2, "[libvirt:REBOOT] Nothing to " -+ "do - domain is off\n"); -+ virDomainFree(vdp); -+ return 0; -+ } -+ - syslog(LOG_NOTICE, "Rebooting domain %s\n", vm_name); - printf("Rebooting domain %s...\n", vm_name); - domain_desc = virDomainGetXMLDesc(vdp, 0); -diff --git a/server/libvirt.c b/server/libvirt.c -index 12bb8ad..1d1473b 100644 ---- a/server/libvirt.c -+++ b/server/libvirt.c -@@ -171,16 +171,18 @@ libvirt_off(const char *vm_name, const char *src, - vdp = virDomainLookupByName(info->vp, vm_name); - } - -- if (!vdp || -- ((virDomainGetInfo(vdp, &vdi) == 0) && -- (vdi.state == VIR_DOMAIN_SHUTOFF))) { -+ if (!vdp) { - dbg_printf(2, "Nothing to do - domain does not exist\n"); -- -- if (vdp) -- virDomainFree(vdp); - return 1; - } - -+ if (((virDomainGetInfo(vdp, &vdi) == 0) && -+ (vdi.state == VIR_DOMAIN_SHUTOFF))) { -+ dbg_printf(2, "Nothing to do - domain is off\n"); -+ virDomainFree(vdp); -+ return 0; -+ } -+ - syslog(LOG_NOTICE, "Destroying domain %s\n", vm_name); - dbg_printf(2, "[OFF] Calling virDomainDestroy\n"); - ret = virDomainDestroy(vdp); -@@ -314,15 +316,21 @@ libvirt_reboot(const char *vm_name, const char *src, - vdp = virDomainLookupByName(info->vp, vm_name); - } - -- if (!vdp || ((virDomainGetInfo(vdp, &vdi) == 0) && -- (vdi.state == VIR_DOMAIN_SHUTOFF))) { -+ if (!vdp) { - dbg_printf(2, "[libvirt:REBOOT] Nothing to " - "do - domain does not exist\n"); -- if (vdp) -- virDomainFree(vdp); - return 1; - } - -+ if (((virDomainGetInfo(vdp, &vdi) == 0) && -+ (vdi.state == VIR_DOMAIN_SHUTOFF))) { -+ dbg_printf(2, "[libvirt:REBOOT] Nothing to " -+ "do - domain is off\n"); -+ virDomainFree(vdp); -+ return 0; -+ } -+ -+ - syslog(LOG_NOTICE, "Rebooting domain %s\n", vm_name); - printf("Rebooting domain %s...\n", vm_name); - domain_desc = virDomainGetXMLDesc(vdp, 0); --- -1.7.11.7 - diff --git a/SOURCES/add-a-delay-w-option.patch b/SOURCES/add-a-delay-w-option.patch deleted file mode 100644 index 73b127f..0000000 --- a/SOURCES/add-a-delay-w-option.patch +++ /dev/null @@ -1,86 +0,0 @@ -diff -ur a/client/main.c b/client/main.c ---- a/client/main.c 2010-01-15 08:03:56.000000000 -0500 -+++ b/client/main.c 2012-10-15 14:28:43.430961223 -0400 -@@ -56,10 +56,10 @@ - - args_init(&args); - if (!strcmp(basename(argv[0]), "fence_xvm")) { -- my_options = "di:a:p:r:C:c:k:M:H:uo:t:?hV"; -+ my_options = "di:a:p:r:C:c:k:M:H:uo:t:?hVw:"; - args.mode = MODE_MULTICAST; - } else { -- my_options = "dD:P:A:p:M:H:o:t:?hV"; -+ my_options = "dD:P:A:p:M:H:o:t:?hVw:"; - args.mode = MODE_SERIAL; - } - -@@ -115,6 +115,9 @@ - return 0; - } - -+ if (args.delay > 0) -+ sleep(args.delay); -+ - switch(args.mode) { - case MODE_MULTICAST: - ret = mcast_fence_virt(&args); -diff -ur a/client/options.c b/client/options.c ---- a/client/options.c 2011-09-20 11:19:56.000000000 -0400 -+++ b/client/options.c 2012-10-15 14:27:00.034407993 -0400 -@@ -318,6 +318,18 @@ - } - } - -+static inline void -+assign_delay(fence_virt_args_t *args, struct arg_info *arg, char *value) -+{ -+ if (!value) -+ return; -+ -+ args->delay = atoi(value); -+ if (args->timeout <= 0) { -+ printf("Invalid delay: '%s'\n", value); -+ args->flags |= F_ERR; -+ } -+} - - static inline void - assign_help(fence_virt_args_t *args, struct arg_info *arg, char *value) -@@ -489,6 +501,11 @@ - "URI for Hypervisor (default: auto detect)", - assign_uri }, - -+ { 'w', "-w ", "delay", -+ 0, "string", "0", -+ "Fencing delay (in seconds; default=0)", -+ assign_delay }, -+ - { 'V', "-V", NULL, - 0, "boolean", "0", - "Display version and exit", -diff -ur a/include/options.h b/include/options.h ---- a/include/options.h 2010-01-14 16:38:19.000000000 -0500 -+++ b/include/options.h 2012-10-15 14:27:00.034407993 -0400 -@@ -44,6 +44,7 @@ - client_mode_t mode; - int debug; - int timeout; -+ int delay; - int retr_time; - arg_flags_t flags; - -diff -ur a/man/fence_virt.8 b/man/fence_virt.8 ---- a/man/fence_virt.8 2012-10-15 14:27:51.869181554 -0400 -+++ b/man/fence_virt.8 2012-10-15 14:27:00.034407993 -0400 -@@ -44,6 +44,11 @@ - . - Fencing timeout (in seconds) (Default Value: 30) - -+.TP -+.B -w -+. -+Fencing delay (in seconds). The fence agent will wait the specified number of seconds before attempting a fencing operation. (Default Value: 0) -+ - .SH MULTICAST PARAMETERS - These parameters are used only when using fence_virt in multicast mode - (e.g. by running fence_xvm). diff --git a/SOURCES/bz1052449.patch b/SOURCES/bz1052449.patch deleted file mode 100644 index 464f27d..0000000 --- a/SOURCES/bz1052449.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -ur a/fence_virtd.service.in b/fence_virtd.service.in ---- a/fence_virtd.service.in 2012-02-07 14:56:22.000000000 -0500 -+++ b/fence_virtd.service.in 2014-02-18 09:19:19.119074520 -0500 -@@ -1,7 +1,7 @@ - [Unit] - Description=Fence-Virt system host daemon --After=syslog.target network.target libvirt-qmf.service libvirtd.service corosync.service --Requires=syslog.target network.target -+After=network.target libvirt-qmf.service libvirtd.service corosync.service -+Requires=network.target - - [Install] - WantedBy=multi-user.target diff --git a/SOURCES/bz1057258.patch b/SOURCES/bz1057258.patch deleted file mode 100644 index 38ec32f..0000000 --- a/SOURCES/bz1057258.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit 04710b40794fb31e9cd70c4a205decf6b40206fd -Author: Ryan McCabe -Date: Wed Jul 10 17:31:21 2013 -0400 - - fence-virt: Fail properly if unable to bind the listener socket - - Bail out properly in multicast mode if we're unable to bind the TCP - listener socket. - - Signed-off-by: Ryan McCabe - -diff --git a/client/mcast.c b/client/mcast.c -index ddc1a9c..9ad48ae 100644 ---- a/client/mcast.c -+++ b/client/mcast.c -@@ -313,11 +313,14 @@ mcast_fence_virt(fence_virt_args_t *args) - if (lfd < 0) { - printf("Failed to listen: %s\n", strerror(errno)); - usleep(args->retr_time * 100000); -- --attempts; -- continue; -+ if (--attempts > 0) -+ continue; - } - } while (0); - -+ if (lfd < 0) -+ return -1; -+ - gettimeofday(&tv, NULL); - seqno = (uint32_t)tv.tv_usec; - diff --git a/SOURCES/qpid-build.patch b/SOURCES/qpid-build.patch deleted file mode 100644 index 76d9d26..0000000 --- a/SOURCES/qpid-build.patch +++ /dev/null @@ -1,22 +0,0 @@ -commit 2f87331c1aff9e7e7a2757fce6487c47789ec209 -Author: Lon Hohberger -Date: Mon Mar 26 17:12:49 2012 -0400 - - Stop linking against unnecessary QPid libs. - - Signed-off-by: Lon Hohberger - -diff --git a/server/Makefile.in b/server/Makefile.in -index 2c989ed..2bd55ca 100644 ---- a/server/Makefile.in -+++ b/server/Makefile.in -@@ -27,7 +27,8 @@ PACEMAKER_LIBS=-lcib -lcrmcommon -lpe_status -lplumb \ - PACEMAKER_INCLUDES=`pkg-config --cflags glib-2.0` -I/usr/include/pacemaker -I/usr/include/heartbeat - CMAN_LIBS=-lcman - VIRT_LIBS=-lvirt --VIRT_QPID=-lqmf2 -lqpidclient -lqpidtypes -lqpidcommon -lqpidmessaging -+VIRT_QPID=-lqmf2 -+# No longer needed: -lqpidclient -lqpidtypes -lqpidcommon -lqpidmessaging - NSS_LIBS=-lnss3 - XML_LIBS=`xml2-config --libs` - INCLUDES=-I../include `nss-config --cflags` `nspr-config --cflags` `xml2-config --cflags` diff --git a/SOURCES/use-bswap_X-instead-of-b_swapX.patch b/SOURCES/use-bswap_X-instead-of-b_swapX.patch deleted file mode 100644 index 5e02fa9..0000000 --- a/SOURCES/use-bswap_X-instead-of-b_swapX.patch +++ /dev/null @@ -1,50 +0,0 @@ -From c3d398645dc9edb51573654f97558e493859584b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Dan=20Hor=C3=A1k?= -Date: Mon, 5 Nov 2012 09:37:11 +0100 -Subject: [PATCH] use bswap_X() instead of b_swapX() - -byteswap.h defined interface is bswap_X() not b_swapX() ---- - include/xvm.h | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/include/xvm.h b/include/xvm.h -index 5b4cfe6..b02c414 100644 ---- a/include/xvm.h -+++ b/include/xvm.h -@@ -90,9 +90,9 @@ typedef struct __attribute__ ((packed)) _fence_req { - #if __BYTE_ORDER == __BIG_ENDIAN - #define swab_fence_req_t(req) \ - do { \ -- (req)->seqno = b_swap32((req)->seqno); \ -- (req)->family = b_swap32((req)->family); \ -- (req)->port = b_swap32((req)->port); \ -+ (req)->seqno = bswap_32((req)->seqno); \ -+ (req)->family = bswap_32((req)->family); \ -+ (req)->port = bswap_32((req)->port); \ - } while(0) - #else - #define swab_fence_req_t(req) -@@ -124,8 +124,8 @@ typedef struct __attribute__((packed)) _serial_fence_req { - #if __BYTE_ORDER == __BIG_ENDIAN - #define swab_serial_req_t(req) \ - do { \ -- (req)->magic = b_swap32((req)->magic); \ -- (req)->seqno = b_swap32((req)->seqno); \ -+ (req)->magic = bswap_32((req)->magic); \ -+ (req)->seqno = bswap_32((req)->seqno); \ - } while(0) - #else - #define swab_serial_req_t(req) -@@ -140,7 +140,7 @@ typedef struct __attribute__((packed)) _serial_fense_resp { - #if __BYTE_ORDER == __BIG_ENDIAN - #define swab_serial_resp_t(req) \ - do { \ -- (req)->magic = b_swap32((req)->magic); \ -+ (req)->magic = bswap_32((req)->magic); \ - } while(0) - #else - #define swab_serial_resp_t(req) --- -1.7.11.7 - diff --git a/SPECS/fence-virt.spec b/SPECS/fence-virt.spec index c790f3f..5e3a08b 100644 --- a/SPECS/fence-virt.spec +++ b/SPECS/fence-virt.spec @@ -1,6 +1,6 @@ Name: fence-virt -Version: 0.3.0 -Release: 16%{?dist} +Version: 0.3.2 +Release: 1%{?dist} Summary: A pluggable fencing framework for virtual machines Group: System Environment/Base License: GPLv2+ @@ -10,17 +10,7 @@ ExclusiveArch: i686 x86_64 %endif URL: http://fence-virt.sourceforge.net -Source0: http://voxel.dl.sourceforge.net/project/fence-virt/%{name}-%{version}.tar.gz -Patch0: qpid-build.patch -Patch1: add-a-delay-w-option.patch -Patch2: Improve-fence_virt.conf-man-page-description-of-hash.patch -Patch3: Return-failure-for-nonexistent-domains.patch -Patch4: Fix-typo-in-fence_virt-8-man-page.patch -Patch5: Explicitly-set-delay-to-0.patch -Patch6: Return-success-if-a-domain-exists-but-is-off.patch -Patch7: use-bswap_X-instead-of-b_swapX.patch -Patch8: bz1052449.patch -Patch9: bz1057258.patch +Source0: http://people.redhat.com/rmccabe/fence-virt/%{name}-%{version}.tar.bz2 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) @@ -84,17 +74,6 @@ machines on a desktop. %prep %setup -q -%patch0 -p1 -b .qpid-build -%patch1 -p1 -b .add-a-delay-w-option -%patch2 -p1 -b .Improve-fence_virt.conf-man-page-description-of-hash -%patch3 -p1 -b .Return-failure-for-nonexistent-domains -%patch4 -p1 -b .Fix-typo-in-fence_virt-8-man-page -%patch5 -p1 -b .Explicitly-set-delay-to-0 -%patch6 -p1 -b .Return-success-if-a-domain-exists-but-is-off -%patch7 -p1 -b .use-bswap_X-instead-of-b_swapX -%patch8 -p1 -b .bz1052449 -%patch9 -p1 -b .bz1057258 - %build ./autogen.sh @@ -178,6 +157,10 @@ fi %{_libdir}/%{name}/libvirt.so %changelog +* Mon Sep 08 2014 Ryan McCabe - 0.3.2-1 +- Rebase to the 0.3.2 release. + Resolves: rhbz#1111384 + * Wed Feb 19 2014 Ryan McCabe - 0.3.0-16 - Fail cleanly when unable to bind the TCP listener socket