All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Fehlig <jfehlig@novell.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] Fix blktap2 test in xen-hotplug-cleanup
Date: Sun, 21 Feb 2010 21:29:47 -0700	[thread overview]
Message-ID: <4B82083B.6010506@novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 701 bytes --]

The blktap2 test in xen-hotplug-cleanup was not quite right, causing
orphaned /vm/<uuid>/device node in xenstore.  Attempt to reattach the
device failed:

xen53: # xm block-attach 0 file:/tmp/d0 /dev/xvdp r
xen53: # xm block-detach 0 /dev/xvdp
xen53: # xenstore-ls /vm/00000000-0000-0000-0000-000000000000/device
vbd = ""
 51952 = ""
  frontend = "/local/domain/0/device/vbd/51952"
  frontend-id = "0"
  backend-id = "0"
  backend = "/local/domain/0/backend/vbd/0/51952"
xen53: # xm block-attach 0 file:/tmp/d0 /dev/xvdp r
Error: Device /dev/xvdp (51952, vbd) is already connected.
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode> [BackDomain]

Attached patch fixes the test.

Regards,
Jim

[-- Attachment #2: hotplug-cleanup-fix.patch --]
[-- Type: text/x-patch, Size: 618 bytes --]

Index: xen-4.0.0-testing/tools/hotplug/Linux/xen-hotplug-cleanup
===================================================================
--- xen-4.0.0-testing.orig/tools/hotplug/Linux/xen-hotplug-cleanup
+++ xen-4.0.0-testing/tools/hotplug/Linux/xen-hotplug-cleanup
@@ -21,7 +21,7 @@ if [ "$vm" != "" ]; then
 
   # if the vm path does not exist and the device class is 'vbd' then we may have
   # a tap2 device
-  if [ ! $(xenstore-read "vm_dev" 2>/dev/null) ] \
+  if [ $(xenstore-read "$vm_dev" 2>/dev/null) != "" ] \
        && [ "${path_array[1]}" = "vbd" ]; then
     vm_dev="$vm/device/tap2/${path_array[3]}"
   fi

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2010-02-22  4:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B82083B.6010506@novell.com \
    --to=jfehlig@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.