[PATCH] Fix VSMS.RemoveResources()

# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1201028159 28800 # Node ID 47438edf32be70e65bdb814ab609a70304fad2f4 # Parent c92db5f8d2b108163d75b32f906c7b55fa4f2854 Fix VSMS.RemoveResources() My previous work on the xmlgen code caused us to stop skipping VIRT_DEV_UNKNOWN devices in the full-system XML generation case. Since a delete operation just marks devices as such, we should skip them. Signed-off-by: Dan Smith <danms@us.ibm.com> diff -r c92db5f8d2b1 -r 47438edf32be libxkutil/xmlgen.c --- a/libxkutil/xmlgen.c Tue Jan 22 10:20:51 2008 -0800 +++ b/libxkutil/xmlgen.c Tue Jan 22 10:55:59 2008 -0800 @@ -322,7 +322,11 @@ static bool concat_devxml(char **xml, int i; for (i = 0; i < count; i++) { - func(&_xml, &list[i]); + /* Deleted devices are marked as VIRT_DEV_UNKNOWN + * and should be skipped + */ + if (list[i].type != VIRT_DEV_UNKNOWN) + func(&_xml, &list[i]); } astrcat(xml, _xml);

Dan Smith wrote:
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1201028159 28800 # Node ID 47438edf32be70e65bdb814ab609a70304fad2f4 # Parent c92db5f8d2b108163d75b32f906c7b55fa4f2854 Fix VSMS.RemoveResources()
My previous work on the xmlgen code caused us to stop skipping VIRT_DEV_UNKNOWN devices in the full-system XML generation case. Since a delete operation just marks devices as such, we should skip them.
FMI - Who is doing the real delete ?
Signed-off-by: Dan Smith <danms@us.ibm.com>
makes sense and applies fine ... +1 -- Regards Heidi Eckhart Software Engineer IBM Linux Technology Center - Open Hypervisor

HE> FMI - Who is doing the real delete ? The device is actually decoupled during the process, but the in-memory version of the domain information still has a device struct, but it's marked as UNKNOWN. This bit of information is transient, we just need to make sure that we don't include the device in the new XML. The chain looks like this: Del Req --> Load XML --> Mark Unknown --> Save XML Make sense? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

Dan Smith wrote:
HE> FMI - Who is doing the real delete ?
The device is actually decoupled during the process, but the in-memory version of the domain information still has a device struct, but it's marked as UNKNOWN. This bit of information is transient, we just need to make sure that we don't include the device in the new XML. The chain looks like this:
Del Req --> Load XML --> Mark Unknown --> Save XML
Make sense?
Yes, makes sense. Thank you for the explanation. -- Regards Heidi Eckhart Software Engineer IBM Linux Technology Center - Open Hypervisor
participants (2)
-
Dan Smith
-
Heidi Eckhart