WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xend: Fix check for request to detach non

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Fix check for request to detach non-existent device
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 30 May 2009 02:30:25 -0700
Delivery-date: Sat, 30 May 2009 02:32:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1243585960 -3600
# Node ID 401a793c4b424569c66c906a80a913b1a0ea8d5b
# Parent  ec2bc4b9fa326048fefa81e3399e519e3902e15d
xend: Fix check for request to detach non-existent device

This fixes the check for a request to detatch a non-existent device
in pci_device_configure. The previous check was bogus because the
format of AUTO_PHP_SLOT_STR is not the same as that of x['vslot'].

However, it works in a slightly non-obvious way, checking that vslot
hasn't been altered from its initial value AUTO_PHP_SLOT_STR. To
make this shceme a little clearer, use an empty string as the inital
value.

Formting issues asside, neither AUTO_PHP_SLOT_STR nor the empty
string are valid values for x['vslot']. In the event
of invalid data (indicating a bug), it should be caught by
self.hvm_destroyPCIDevice.

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -r ec2bc4b9fa32 -r 401a793c4b42 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri May 29 09:32:02 2009 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri May 29 09:32:40 2009 +0100
@@ -854,7 +854,7 @@ class XendDomainInfo:
                 existing_dev_uuid = sxp.child_value(existing_dev_info, 'uuid')
                 existing_pci_conf = self.info['devices'][existing_dev_uuid][1]
                 existing_pci_devs = existing_pci_conf['devs']
-                vslot = AUTO_PHP_SLOT_STR
+                vslot = ""
                 for x in existing_pci_devs:
                     if ( int(x['domain'], 16) == int(dev['domain'], 16) and
                          int(x['bus'], 16) == int(dev['bus'], 16) and
@@ -862,7 +862,7 @@ class XendDomainInfo:
                          int(x['func'], 16) == int(dev['func'], 16) ):
                         vslot = assigned_or_requested_vslot(x)
                         break
-                if vslot == AUTO_PHP_SLOT_STR:
+                if vslot == "":
                     raise VmError("Device %04x:%02x:%02x.%01x is not connected"
                                   % (int(dev['domain'],16), int(dev['bus'],16),
                                      int(dev['slot'],16), int(dev['func'],16)))

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: Fix check for request to detach non-existent device, Xen patchbot-unstable <=