* [patch] Fix xm pci-detach for inactive devices
@ 2009-05-26 4:38 Simon Horman
2009-05-26 5:03 ` Masaki Kanno
2009-05-26 5:15 ` Zhai, Edwin
0 siblings, 2 replies; 5+ messages in thread
From: Simon Horman @ 2009-05-26 4:38 UTC (permalink / raw)
To: xen-devel; +Cc: Masaki Kanno, Zhai Edwin
In the case where a device is attached to an inactive domain
and then removed before the domain is activated it won't have
a vslot assigned, but it should still be valid to remove it.
I don't think that there are any other cases where vslot can
be invalid.
Lightly tested
Cc: Zhai Edwin <edwin.zhai@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Index: xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py
===================================================================
--- xen-unstable.hg.orig/tools/python/xen/xend/XendDomainInfo.py 2009-05-26 14:37:15.000000000 +1000
+++ xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py 2009-05-26 14:37:18.000000000 +1000
@@ -1130,9 +1130,6 @@ class XendDomainInfo:
if devnum >= pci_len:
raise VmError("Device @ vslot 0x%x doesn't exist." % (vslot))
- if vslot == AUTO_PHP_SLOT:
- raise VmError("Device @ vslot 0x%x doesn't support hotplug." % (vslot))
-
# Check the co-assignment.
# To pci-detach a device D from domN, we should ensure: for each DD in the
# list of D's co-assignment devices, DD is not assigned (to domN).
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [patch] Fix xm pci-detach for inactive devices
2009-05-26 4:38 [patch] Fix xm pci-detach for inactive devices Simon Horman
@ 2009-05-26 5:03 ` Masaki Kanno
2009-05-26 5:15 ` Zhai, Edwin
1 sibling, 0 replies; 5+ messages in thread
From: Masaki Kanno @ 2009-05-26 5:03 UTC (permalink / raw)
To: Simon Horman, xen-devel; +Cc: Zhai Edwin
Hi Simon,
I agree to your thought.
Acked-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Best regards,
Kan
Tue, 26 May 2009 14:38:24 +1000, Simon Horman wrote:
>In the case where a device is attached to an inactive domain
>and then removed before the domain is activated it won't have
>a vslot assigned, but it should still be valid to remove it.
>
>I don't think that there are any other cases where vslot can
>be invalid.
>
>Lightly tested
>
>Cc: Zhai Edwin <edwin.zhai@intel.com>
>Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
>Signed-off-by: Simon Horman <horms@verge.net.au>
>
>Index: xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py
>===================================================================
>--- xen-unstable.hg.orig/tools/python/xen/xend/XendDomainInfo.py 2009-05
-26
> 14:37:15.000000000 +1000
>+++ xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py 2009-05-26 14:
>37:18.000000000 +1000
>@@ -1130,9 +1130,6 @@ class XendDomainInfo:
> if devnum >= pci_len:
> raise VmError("Device @ vslot 0x%x doesn't exist." % (vslot))
>
>- if vslot == AUTO_PHP_SLOT:
>- raise VmError("Device @ vslot 0x%x doesn't support hotplug." %
> (vslot))
>-
> # Check the co-assignment.
> # To pci-detach a device D from domN, we should ensure: for each
>DD in the
> # list of D's co-assignment devices, DD is not assigned (to domN).
>
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@lists.xensource.com
>http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [patch] Fix xm pci-detach for inactive devices
2009-05-26 4:38 [patch] Fix xm pci-detach for inactive devices Simon Horman
2009-05-26 5:03 ` Masaki Kanno
@ 2009-05-26 5:15 ` Zhai, Edwin
2009-05-26 6:25 ` Simon Horman
1 sibling, 1 reply; 5+ messages in thread
From: Zhai, Edwin @ 2009-05-26 5:15 UTC (permalink / raw)
To: Simon Horman; +Cc: xen-devel@lists.xensource.com, Masaki Kanno
Simon,
What does inactive domain means?
How does it lead an invalid vslot?
Simon Horman wrote:
> In the case where a device is attached to an inactive domain
> and then removed before the domain is activated it won't have
> a vslot assigned, but it should still be valid to remove it.
>
> I don't think that there are any other cases where vslot can
> be invalid.
>
> Lightly tested
>
> Cc: Zhai Edwin <edwin.zhai@intel.com>
> Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
> Signed-off-by: Simon Horman <horms@verge.net.au>
>
> Index: xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py
> ===================================================================
> --- xen-unstable.hg.orig/tools/python/xen/xend/XendDomainInfo.py 2009-05-26 14:37:15.000000000 +1000
> +++ xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py 2009-05-26 14:37:18.000000000 +1000
> @@ -1130,9 +1130,6 @@ class XendDomainInfo:
> if devnum >= pci_len:
> raise VmError("Device @ vslot 0x%x doesn't exist." % (vslot))
>
> - if vslot == AUTO_PHP_SLOT:
> - raise VmError("Device @ vslot 0x%x doesn't support hotplug." % (vslot))
> -
> # Check the co-assignment.
> # To pci-detach a device D from domN, we should ensure: for each DD in the
> # list of D's co-assignment devices, DD is not assigned (to domN).
>
>
--
best rgds,
edwin
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [patch] Fix xm pci-detach for inactive devices
2009-05-26 5:15 ` Zhai, Edwin
@ 2009-05-26 6:25 ` Simon Horman
2009-05-26 6:28 ` Zhai, Edwin
0 siblings, 1 reply; 5+ messages in thread
From: Simon Horman @ 2009-05-26 6:25 UTC (permalink / raw)
To: Edwin Zhai; +Cc: xen-devel, Masaki Kanno
On Tue, May 26, 2009 at 01:15:51PM +0800, Zhai, Edwin wrote:
> Simon,
> What does inactive domain means?
> How does it lead an invalid vslot?
Hi Edwin,
An inactive domain means one that has been created
but is stopped. An invalid vslot can occur in this case
if the vslot is to be automatically assigned by qemu-dm.
This is because the request will not be sent to qemu-dm
until the domain is started.
e.g.:
$ xm new hvm.conf
$ xm pci-attach hvm 00:1d.0
$ xm pci-list hvm
- 0x0 0x00 0x1d 0x0 <- '-' means the vslot has not been determined
$ xm pci-detach hvm 00:1d.0 <- will fail without this change
Or alternatively:
$ xm new hvm.conf
$ xm pci-attach hvm 00:1d.0
$ xm pci-list hvm
- 0x0 0x00 0x1d 0x0 <- '-' means the vslot has not been determined
$ xm start hvm
$ xm pci-list hvm
0x7 0x0 0x00 0x1d 0x0 <- vslot 0x7 was allocated after the
domain started
$ xm pci-detach hvm 00:1d.0 <- will work with or without this patch
Attaching devices to inactive domains was recently
fixed (added?) by Kanno-san.
> Simon Horman wrote:
>> In the case where a device is attached to an inactive domain
>> and then removed before the domain is activated it won't have
>> a vslot assigned, but it should still be valid to remove it.
>>
>> I don't think that there are any other cases where vslot can
>> be invalid.
>>
>> Lightly tested
>>
>> Cc: Zhai Edwin <edwin.zhai@intel.com>
>> Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
>> Signed-off-by: Simon Horman <horms@verge.net.au>
>>
>> Index: xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py
>> ===================================================================
>> --- xen-unstable.hg.orig/tools/python/xen/xend/XendDomainInfo.py 2009-05-26 14:37:15.000000000 +1000
>> +++ xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py 2009-05-26 14:37:18.000000000 +1000
>> @@ -1130,9 +1130,6 @@ class XendDomainInfo:
>> if devnum >= pci_len:
>> raise VmError("Device @ vslot 0x%x doesn't exist." % (vslot))
>> - if vslot == AUTO_PHP_SLOT:
>> - raise VmError("Device @ vslot 0x%x doesn't support hotplug." % (vslot))
>> -
>> # Check the co-assignment.
>> # To pci-detach a device D from domN, we should ensure: for each DD in the
>> # list of D's co-assignment devices, DD is not assigned (to domN).
>>
>>
>
> --
> best rgds,
> edwin
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [patch] Fix xm pci-detach for inactive devices
2009-05-26 6:25 ` Simon Horman
@ 2009-05-26 6:28 ` Zhai, Edwin
0 siblings, 0 replies; 5+ messages in thread
From: Zhai, Edwin @ 2009-05-26 6:28 UTC (permalink / raw)
To: Simon Horman; +Cc: xen-devel@lists.xensource.com, Masaki Kanno
I see.
Looks fine for me.
Thanks,
Simon Horman wrote:
> On Tue, May 26, 2009 at 01:15:51PM +0800, Zhai, Edwin wrote:
>
>> Simon,
>> What does inactive domain means?
>> How does it lead an invalid vslot?
>>
>
> Hi Edwin,
>
> An inactive domain means one that has been created
> but is stopped. An invalid vslot can occur in this case
> if the vslot is to be automatically assigned by qemu-dm.
> This is because the request will not be sent to qemu-dm
> until the domain is started.
>
> e.g.:
>
> $ xm new hvm.conf
> $ xm pci-attach hvm 00:1d.0
> $ xm pci-list hvm
> - 0x0 0x00 0x1d 0x0 <- '-' means the vslot has not been determined
> $ xm pci-detach hvm 00:1d.0 <- will fail without this change
>
> Or alternatively:
>
> $ xm new hvm.conf
> $ xm pci-attach hvm 00:1d.0
> $ xm pci-list hvm
> - 0x0 0x00 0x1d 0x0 <- '-' means the vslot has not been determined
> $ xm start hvm
> $ xm pci-list hvm
> 0x7 0x0 0x00 0x1d 0x0 <- vslot 0x7 was allocated after the
> domain started
> $ xm pci-detach hvm 00:1d.0 <- will work with or without this patch
>
> Attaching devices to inactive domains was recently
> fixed (added?) by Kanno-san.
>
>
>> Simon Horman wrote:
>>
>>> In the case where a device is attached to an inactive domain
>>> and then removed before the domain is activated it won't have
>>> a vslot assigned, but it should still be valid to remove it.
>>>
>>> I don't think that there are any other cases where vslot can
>>> be invalid.
>>>
>>> Lightly tested
>>>
>>> Cc: Zhai Edwin <edwin.zhai@intel.com>
>>> Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
>>> Signed-off-by: Simon Horman <horms@verge.net.au>
>>>
>>> Index: xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py
>>> ===================================================================
>>> --- xen-unstable.hg.orig/tools/python/xen/xend/XendDomainInfo.py 2009-05-26 14:37:15.000000000 +1000
>>> +++ xen-unstable.hg/tools/python/xen/xend/XendDomainInfo.py 2009-05-26 14:37:18.000000000 +1000
>>> @@ -1130,9 +1130,6 @@ class XendDomainInfo:
>>> if devnum >= pci_len:
>>> raise VmError("Device @ vslot 0x%x doesn't exist." % (vslot))
>>> - if vslot == AUTO_PHP_SLOT:
>>> - raise VmError("Device @ vslot 0x%x doesn't support hotplug." % (vslot))
>>> -
>>> # Check the co-assignment.
>>> # To pci-detach a device D from domN, we should ensure: for each DD in the
>>> # list of D's co-assignment devices, DD is not assigned (to domN).
>>>
>>>
>>>
>> --
>> best rgds,
>> edwin
>>
>
>
--
best rgds,
edwin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-05-26 6:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-26 4:38 [patch] Fix xm pci-detach for inactive devices Simon Horman
2009-05-26 5:03 ` Masaki Kanno
2009-05-26 5:15 ` Zhai, Edwin
2009-05-26 6:25 ` Simon Horman
2009-05-26 6:28 ` Zhai, Edwin
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.