Fix xm block/network-detach command
PATCH 1/1 Fix xm block/network-detach command
Hi,
This patch fixes a few problem of xm block/network-detach command.
At first, when I tested xm block/network-detach command to a inactive managed domain, I saw the following error messages.
# xm new /xen/vm1.conf
Using config file "/xen/vm1.conf".
# xm list --long vm1
(domain
<snip>
(device
(vif
(mac 00:16:3e:75:96:d8)
(uuid ebd29601-41ac-75de-87cd-2ae051fa8719)
)
)
(device
(vbd
(uuid 7572ae87-5706-217a-3fa5-f68496e147c1)
(bootable 1)
(driver paravirtualised)
(dev hda1)
(uname file:/xen/rhel4u2.root.img-vm1)
(mode w)
)
)
)
# xm block-detach vm1 hda1
Error: Device hda1 not connected
Usage: xm block-detach <Domain> <DevId> [-f|--force]Destroy a domain's virtual block device.
# xm network-detach vm1 0 Error: (22, 'Invalid argument, while reading None/device/vif/0/backend') Usage: xm network-detach <Domain> <DevId> [-f|--force]
Destroy a domain's virtual network device.
I was able to fix the problem of inactive managed domains by writing a small patch. However, I found a other problem in xm block/network- detach command when I tested xm block/network-detach command more. The other problem is the same as the problem that Mats reported in the following.
http://lists.xensource.com/archives/html/xen-devel/2007-08/msg00040.html
This patch fixes the other problem as follows.
- To remove device info, it waits for the backend path of the device to be removed.
- It removes device info from domain info.
- It saves domain info to the config.sxp of the managed domain.
Best regards,
Kan
tools/python/xen/xend/XendDomainInfo.py +97 -13
@@ -36,6 +36,7 @@ import xen.lowlevel.xc import xen.lowlevel.xc from xen.util import asserts from xen.util.blkif import blkdev_uname_to_file, blkdev_uname_to_taptype +from xen.util.blkif import blkdev_name_to_number from xen.util import security from xen.xend import balloon, sxp, uuid, image, arch, osdep
@@ -558,19 +559,65 @@ class XendDomainInfo: for devclass in XendDevices.valid_devices(): self.getDeviceController(devclass).waitForDevices() - def destroyDevice(self, deviceClass, devid, force = False): - try: - dev = int(devid) - except ValueError: - # devid is not a number but a string containing either device - # name (e.g. xvda) or device_type/device_id (e.g. vbd/51728) - dev = type(devid) is str and devid.split('/')[-1] or None - if dev == None: - log.debug("Could not find the device %s", devid) - return None - - log.debug("dev = %s", dev) - return self.getDeviceController(deviceClass).destroyDevice(dev, force) + def destroyDevice(self, deviceClass, devid, force = False, rm_cfg = False): + dev = self.convertToDeviceNumber(devid) + if dev == None: + log.debug("Could not find the device %s", devid) + return None + + log.debug("XendDomainInfo.destroyDevice: deviceClass = %s, device = %s(%d)", + deviceClass, devid, dev) + + if rm_cfg: + # Save current sxprs. A device number and a backend + # path are needed to remove its configuration but sxprs + # do not have those after calling destroyDevice. + sxprs = self.getDeviceSxprs(deviceClass) + + rc = None + if self.domid is not None: + rc = self.getDeviceController(deviceClass).destroyDevice(dev, force) + if not force and rm_cfg: + # The backend path, other than the device itself, + # has to be passed because its accompanied frontend + # path may be void until its removal is actually + # issued. It is probable because destroyDevice is + # issued first. + for dev_num, dev_info in sxprs: + dev_num = int(dev_num) + if dev_num == dev: + for x in dev_info: + if x[0] == 'backend': + backend = x[1] + break + break + self._waitForDevice_destroy(deviceClass, dev, backend) + + if rm_cfg: + if deviceClass == 'vif': + if self.domid is not None: + for dev_num, dev_info in sxprs: + dev_num = int(dev_num) + if dev_num == dev: + for x in dev_info: + if x[0] == 'mac': + mac = x[1] + break + break + dev_info = self.getDeviceInfo_vif(mac) + else: + _, dev_info = sxprs[dev] + else: # 'vbd' or 'tap' + dev_info = self.getDeviceInfo_vbd(dev) + if dev_info is None: + return rc + + dev_uuid = sxp.child_value(dev_info, 'uuid') + del self.info['devices'][dev_uuid] + self.info['%s_refs' % deviceClass].remove(dev_uuid) + xen.xend.XendDomain.instance().managed_config_save(self) + + return rc def getDeviceSxprs(self, deviceClass): if self._stateGet() in (DOM_STATE_RUNNING, DOM_STATE_PAUSED):
@@ -1331,6 +1378,10 @@ class XendDomainInfo: deviceClass, config = self.info['devices'].get(dev_uuid) self._waitForDevice(deviceClass, config['devid']) + def _waitForDevice_destroy(self, deviceClass, devid, backpath): + return self.getDeviceController(deviceClass).waitForDevice_destroy( + devid, backpath) + def _reconfigureDevice(self, deviceClass, devid, devconfig): return self.getDeviceController(deviceClass).reconfigureDevice( devid, devconfig)
@@ -1390,6 +1441,39 @@ class XendDomainInfo: self._deviceControllers[name] = devController return self._deviceControllers[name] + + def convertToDeviceNumber(self, devid): + try: + dev = int(devid) + except ValueError: + # devid is not a number but a string containing either + # device name (e.g. xvda or xvda:disk) or + # device_type/device_id (e.g. vbd/51728) + dev = type(devid) is str and devid.split('/')[-1] or None + if dev == None: + return None + try: + dev = int(dev) + except ValueError: + dev = dev.split(':')[0] + dev = blkdev_name_to_number(dev) + return dev + + def getDeviceInfo_vif(self, mac): + for dev_type, dev_info in self.info.all_devices_sxpr(): + if dev_type != 'vif': + continue + if mac == sxp.child_value(dev_info, 'mac'): + return dev_info + + def getDeviceInfo_vbd(self, devid): + for dev_type, dev_info in self.info.all_devices_sxpr(): + if dev_type != 'vbd' and dev_type != 'tap': + continue + dev = sxp.child_value(dev_info, 'dev') + dev = self.convertToDeviceNumber(dev) + if devid == dev: + return dev_info # # Migration functions (public)
tools/python/xen/xend/server/DevController.py +49 -6
81 lines not on this page · raw message
tools/python/xen/xm/main.py +2 -1
@@ -2185,6 +2185,7 @@ def xm_network_attach(args): def detach(args, deviceClass): + rm_cfg = True dom = args[0] dev = args[1] try:
@@ -2195,7 +2196,7 @@ def detach(args, deviceClass): except IndexError: force = None - server.xend.domain.destroyDevice(dom, deviceClass, dev, force) + server.xend.domain.destroyDevice(dom, deviceClass, dev, force, rm_cfg) def xm_block_detach(args):
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 38 lines · Masaki Kanno
Hi,
This patch fixes a few problem of xm
block/network-detachcommand.At first, when I tested xm
block/network-detachcommand to a inactive managed domain, I saw the following error messages.# xm new /xen/vm1.conf Using config file "/xen/vm1.conf". # xm list --long vm1 (domain <snip> (device (vif (mac 00:16:3e:75:96:d8) (uuid ebd29601-41ac-75de-87cd-2ae051fa8719) ) ) (device (vbd (uuid 7572ae87-5706-217a-3fa5-f68496e147c1) (bootable 1) (driver paravirtualised) (dev hda1) (uname file:/xen/rhel4u2.root.img-vm1) (mode w) ) ) ) # xm block-detach vm1 hda1 Error: Device hda1 not connected Usage: xm block-detach <Domain> <DevId> [-f|--force]Destroy a domain's virtual block device.
# xm network-detach vm1 0 Error: (22, 'Invalid argument, while reading None/device/vif/0/backend') Usage: xm network-detach <Domain> <DevId> [-f|--force]
Quoted 5 lines
Destroy a domain's virtual network device.
I was able to fix the problem of inactive managed domains by writing a small patch.
This brings up a broader question concerning managed domains. What is the behavior when changing config of a managed domain?
a)
- persist change to store and modify domain if live
b)
- explicitly change live config
- explicitly change stored config
Some of the xm commands support a). That would be behavior of block-detach with this patch.
It appears Xen API supports b) given the *_live, plug, and unplug operations defined in the spec. I have noticed this to be the case for some resource types, but doubt it is consistent across all resource types - let alone both Xen API and legacy sxpr interfaces.
IMO, since xen itself now supports managed domains it should be possible to independently change live and stored config. I should be able to feed a starving domain but have it revert to default (define by me) settings when reset. That said I think it will be considerable work, particularly testing, to ensure this behavior across all resource types and xend interfaces.
Quoted 7 lines
However, I found a other problem in xm
block/network-
detach command when I tested xmblock/network-detachcommand more. The other problem is the same as the problem that Mats reported in the following.http://lists.xensource.com/archives/html/xen-devel/2007-08/msg00040.html
That patch did not cause any problems with save.
Quoted 6 lines
This patch fixes the other problem as follows.
- To remove device info, it waits for the backend path of the device to be removed.
- It removes device info from domain info.
- It saves domain info to the config.sxp of the managed domain.
This changes behavior between block-attach and block-detach. In block-detach, the device is removed from store and unplugged from domain if live. For block-attach, the operation fails if domain is inactive. If domain is active, device is plugged but not persisted to store.
We need to agree on behavior when changing config of managed domains and then set out on the (perhaps time consuming) path of realizing that behavior.
Thoughts?
Jim
Hi Jim,
Quoted 63 lines · Jim Fehlig
Quoted 38 lines · Masaki Kanno
Hi,
This patch fixes a few problem of xm
block/network-detachcommand.At first, when I tested xm
block/network-detachcommand to a inactive managed domain, I saw the following error messages.# xm new /xen/vm1.conf Using config file "/xen/vm1.conf". # xm list --long vm1 (domain <snip> (device (vif (mac 00:16:3e:75:96:d8) (uuid ebd29601-41ac-75de-87cd-2ae051fa8719) ) ) (device (vbd (uuid 7572ae87-5706-217a-3fa5-f68496e147c1) (bootable 1) (driver paravirtualised) (dev hda1) (uname file:/xen/rhel4u2.root.img-vm1) (mode w) ) ) ) # xm block-detach vm1 hda1 Error: Device hda1 not connected Usage: xm block-detach <Domain> <DevId> [-f|--force]Destroy a domain's virtual block device.
# xm network-detach vm1 0 Error: (22, 'Invalid argument, while reading None/device/vif/0/backend') Usage: xm network-detach <Domain> <DevId> [-f|--force]Quoted 5 lines
Destroy a domain's virtual network device.
I was able to fix the problem of inactive managed domains by writing a small patch.
This brings up a broader question concerning managed domains. What is the behavior when changing config of a managed domain?
a)
- persist change to store and modify domain if liveb)
- explicitly change live config
- explicitly change stored configSome of the xm commands support a). That would be behavior of block-detach with this patch.
It appears Xen API supports b) given the
*_live, plug, and unplug operations defined in the spec. I have noticed this to be the case for some resource types, but doubt it is consistent across all resource types - let alone both Xen API and legacy sxpr interfaces.
Quoted 7 lines
IMO, since xen itself now supports managed domains it should be possible to independently change live and stored config. I should be able to feed a starving domain but have it revert to default (define by me) settings when reset. That said I think it will be considerable work, particularly testing, to ensure this behavior across all resource types and xend interfaces.
I also think the work to need an effort.
When we changed the resources configuration of domain by xm commands, most resources configuration of domain is given to the reset domain without change. AFAIK, only CPU affinity revert to default.
Quoted 17 lines
Quoted 7 lines
However, I found a other problem in xm
block/network-
detach command when I tested xmblock/network-detachcommand more. The other problem is the same as the problem that Mats reported in the following.http://lists.xensource.com/archives/html/xen-devel/2007-08/msg00040.html
That patch did not cause any problems with save.
Quoted 6 lines
This patch fixes the other problem as follows.
- To remove device info, it waits for the backend path of the device to be removed.
- It removes device info from domain info.
- It saves domain info to the config.sxp of the managed domain.
Quoted 5 lines
This changes behavior between block-attach and block-detach. In block-detach, the device is removed from store and unplugged from domain if live. For block-attach, the operation fails if domain is inactive. If domain is active, device is plugged but not persisted to store.
I tried xm block/network-attach command with xen-unstable CS:15672. Could you see the attached file "xm_attach.log" ?
If the domain is inactive, xm block/network-attach command succeed. And the device info is saved into config.sxp.
If the domain is active, the device is plugged to the domain. And the device info is saved into config.sxp.
My patch rolls back the proceeding of xm block/network-attach command.
Best regard,
Kan
Quoted 4 lines
We need to agree on behavior when changing config of managed domains and then set out on the (perhaps time consuming) path of realizing that behavior.
Quoted 8 lines
Thoughts?
Jim_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
# xm new /xen/vm1.conf
Using config file "/xen/vm1.conf".
# xm list --long vm1
(domain
(on_crash restart)
(uuid d9773b30-09fe-9e77-d43c-1c310064fde8)
(bootloader_args )
(vcpus 1)
(name vm1)
(on_poweroff destroy)
(on_reboot restart)
(bootloader )
(maxmem 256)
(memory 256)
(shadow_memory 0)
(cpu_weight 512)
(cpu_cap 100)
(features )
(on_xend_start ignore)
(on_xend_stop ignore)
(image
(linux
(kernel /boot/vmlinuz-2.6.18-xen)
(ramdisk /boot/initrd-2.6.18-xen.img.domU.1)
(args 'root=/dev/hda1 ro 3 consoel=tty1')
)
)
(status 0)
)
# cat /var/lib/xend/domains/d9773b30-09fe-9e77-d43c-1c310064fde8/config.sxp
(domain
(vcpus_params ())
(PV_args 'root=/dev/hda1 ro 3 consoel=tty1')
(PV_bootloader )
(VCPUs_live 1)
(actions_after_crash restart)
(uuid d9773b30-09fe-9e77-d43c-1c310064fde8)
(PV_ramdisk /boot/initrd-2.6.18-xen.img.domU.1)
(name_label vm1)
(VCPUs_at_startup 1)
(HVM_boot_params ())
(platform ())
(PV_kernel /boot/vmlinuz-2.6.18-xen)
(memory_static_min 0)
(HVM_boot_policy )
(VCPUs_max 1)
(memory_static_max 268435456)
(actions_after_shutdown destroy)
(memory_dynamic_max 268435456)
(is_a_template False)
(memory_dynamic_min 268435456)
(PV_bootloader_args )
(other_config ())
(actions_after_reboot restart)
(on_crash restart)
(uuid d9773b30-09fe-9e77-d43c-1c310064fde8)
(bootloader_args )
(vcpus 1)
(name vm1)
(on_poweroff destroy)
(on_reboot restart)
(bootloader )
(maxmem 256)
(memory 256)
(shadow_memory 0)
(vcpu_avail 1)
(cpu_weight 512)
(cpu_cap 100)
(features )
(on_xend_start ignore)
(on_xend_stop ignore)
(image
(linux
(kernel /boot/vmlinuz-2.6.18-xen)
(ramdisk /boot/initrd-2.6.18-xen.img.domU.1)
(args 'root=/dev/hda1 ro 3 consoel=tty1')
)
)
(status 0)
)
# xm block-attach vm1 file:/xen/root.img-vm1 hda1 w
# xm network-attach vm1
# xm list --long vm1
(domain
(on_crash restart)
(uuid d9773b30-09fe-9e77-d43c-1c310064fde8)
(bootloader_args )
(vcpus 1)
(name vm1)
(on_poweroff destroy)
(on_reboot restart)
(bootloader )
(maxmem 256)
(memory 256)
(shadow_memory 0)
(cpu_weight 512)
(cpu_cap 100)
(features )
(on_xend_start ignore)
(on_xend_stop ignore)
(image
(linux
(kernel /boot/vmlinuz-2.6.18-xen)
(ramdisk /boot/initrd-2.6.18-xen.img.domU.1)
(args 'root=/dev/hda1 ro 3 consoel=tty1')
)
)
(status 0)
(device
(vif
(mac 00:16:3e:75:1e:fe)
(uuid a8ab3150-59c2-7326-2f10-9d84c9368149)
)
)
(device
(vbd
(uuid b6017fa1-5688-117b-5b16-ff30226fd869)
(bootable 1)
(driver paravirtualised)
(dev hda1)
(uname file:/xen/root.img-vm1)
(mode w)
)
)
)
# cat /var/lib/xend/domains/d9773b30-09fe-9e77-d43c-1c310064fde8/config.sxp
(domain
(vcpus_params ())
(PV_args 'root=/dev/hda1 ro 3 consoel=tty1')
(PV_bootloader )
(VCPUs_live 1)
(actions_after_crash restart)
(uuid d9773b30-09fe-9e77-d43c-1c310064fde8)
(PV_ramdisk /boot/initrd-2.6.18-xen.img.domU.1)
(name_label vm1)
(VCPUs_at_startup 1)
(HVM_boot_params ())
(platform ())
(PV_kernel /boot/vmlinuz-2.6.18-xen)
(memory_static_min 0)
(HVM_boot_policy )
(VCPUs_max 1)
(memory_static_max 268435456)
(actions_after_shutdown destroy)
(memory_dynamic_max 268435456)
(is_a_template False)
(memory_dynamic_min 268435456)
(PV_bootloader_args )
(other_config ())
(actions_after_reboot restart)
(on_crash restart)
(uuid d9773b30-09fe-9e77-d43c-1c310064fde8)
(bootloader_args )
(vcpus 1)
(name vm1)
(on_poweroff destroy)
(on_reboot restart)
(bootloader )
(maxmem 256)
(memory 256)
(shadow_memory 0)
(vcpu_avail 1)
(cpu_weight 512)
(cpu_cap 100)
(features )
(on_xend_start ignore)
(on_xend_stop ignore)
(image
(linux
(kernel /boot/vmlinuz-2.6.18-xen)
(ramdisk /boot/initrd-2.6.18-xen.img.domU.1)
(args 'root=/dev/hda1 ro 3 consoel=tty1')
)
)
(status 0)
(device
(vif
(mac 00:16:3e:75:1e:fe)
(uuid a8ab3150-59c2-7326-2f10-9d84c9368149)
)
)
(device
(vbd
(uuid b6017fa1-5688-117b-5b16-ff30226fd869)
(bootable 1)
(driver paravirtualised)
(dev hda1)
(uname file:/xen/root.img-vm1)
(mode w)
)
)
)
# xm start vm1
# xm block-attach vm1 file:/xen/second.img hdb1 w
# xm network-attach vm1
# xm list --long vm1
(domain
(domid 1)
(on_crash restart)
(uuid d9773b30-09fe-9e77-d43c-1c310064fde8)
(bootloader_args )
(vcpus 1)
(name vm1)
(on_poweroff destroy)
(on_reboot restart)
(bootloader )
(maxmem 256)
(memory 256)
(shadow_memory 0)
(cpu_weight 512)
(cpu_cap 100)
(features )
(on_xend_start ignore)
(on_xend_stop ignore)
(start_time 1186399403.1)
(cpu_time 70.681147403)
(online_vcpus 1)
(image
(linux
(kernel /boot/vmlinuz-2.6.18-xen)
(ramdisk /boot/initrd-2.6.18-xen.img.domU.1)
(args 'root=/dev/hda1 ro 3 consoel=tty1')
(rtc_timeoffset 0)
(notes
(HV_START_LOW 4118806528)
(FEATURES
'writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel'
)
(VIRT_BASE 3221225472)
(GUEST_VERSION 2.6)
(PADDR_OFFSET 3221225472)
(GUEST_OS linux)
(HYPERCALL_PAGE 3222278144)
(LOADER generic)
(SUSPEND_CANCEL 1)
(PAE_MODE yes)
(ENTRY 3222274048)
(XEN_VERSION xen-3.0)
)
)
)
(status 2)
(state r-----)
(store_mfn 120005)
(console_mfn 120004)
(device
(vif
(mac 00:16:3e:75:1e:fe)
(script vif-bridge)
(type netfront)
(uuid a8ab3150-59c2-7326-2f10-9d84c9368149)
(backend 0)
)
)
(device
(vif
(mac 00:16:3e:7e:b8:35)
(script vif-bridge)
(type netfront)
(uuid a3157965-92f2-dec2-17a5-c6e84b45b3a8)
(backend 0)
)
)
(device
(vbd
(uname file:/xen/root.img-vm1)
(uuid b6017fa1-5688-117b-5b16-ff30226fd869)
(mode w)
(dev hda1:disk)
(backend 0)
(bootable 1)
)
)
(device
(vbd
(uname file:/xen/second.img)
(uuid bd2a234c-53e6-e9e5-f7e2-29b1815cee76)
(mode w)
(dev hdb1:disk)
(backend 0)
(bootable 0)
)
)
(device
(console
(protocol vt100)
(location 2)
(uuid b616112f-af93-9ab4-0d34-a4574105bf65)
)
)
)
# cat /var/lib/xend/domains/d9773b30-09fe-9e77-d43c-1c310064fde8/config.sxp
(domain
(domid 1)
(vcpus_params ())
(PV_args 'root=/dev/hda1 ro 3 consoel=tty1')
(PV_bootloader )
(VCPUs_live 1)
(actions_after_crash restart)
(uuid d9773b30-09fe-9e77-d43c-1c310064fde8)
(PV_ramdisk /boot/initrd-2.6.18-xen.img.domU.1)
(name_label vm1)
(VCPUs_at_startup 1)
(HVM_boot_params ())
(platform ((rtc_timeoffset 0)))
(PV_kernel /boot/vmlinuz-2.6.18-xen)
(memory_static_min 0)
(HVM_boot_policy )
(VCPUs_max 1)
(memory_static_max 268435456)
(actions_after_shutdown destroy)
(memory_dynamic_max 268435456)
(is_a_template False)
(memory_dynamic_min 268435456)
(PV_bootloader_args )
(other_config ())
(actions_after_reboot restart)
(on_crash restart)
(uuid d9773b30-09fe-9e77-d43c-1c310064fde8)
(bootloader_args )
(vcpus 1)
(name vm1)
(on_poweroff destroy)
(on_reboot restart)
(bootloader )
(maxmem 256)
(memory 256)
(shadow_memory 0)
(vcpu_avail 1)
(cpu_weight 512)
(cpu_cap 100)
(features )
(on_xend_start ignore)
(on_xend_stop ignore)
(start_time 1186399403.1)
(cpu_time 63.616123205)
(online_vcpus 1)
(image
(linux
(kernel /boot/vmlinuz-2.6.18-xen)
(ramdisk /boot/initrd-2.6.18-xen.img.domU.1)
(args 'root=/dev/hda1 ro 3 consoel=tty1')
(rtc_timeoffset 0)
(notes
(HV_START_LOW 4118806528)
(FEATURES
'writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel'
)
(VIRT_BASE 3221225472)
(GUEST_VERSION 2.6)
(PADDR_OFFSET 3221225472)
(GUEST_OS linux)
(HYPERCALL_PAGE 3222278144)
(LOADER generic)
(SUSPEND_CANCEL 1)
(PAE_MODE yes)
(ENTRY 3222274048)
(XEN_VERSION xen-3.0)
)
)
)
(status 2)
(state r-----)
(store_mfn 120005)
(console_mfn 120004)
(device
(vif
(mac 00:16:3e:75:1e:fe)
(script vif-bridge)
(type netfront)
(uuid a8ab3150-59c2-7326-2f10-9d84c9368149)
(backend 0)
)
)
(device
(vif
(mac 00:16:3e:7e:b8:35)
(script vif-bridge)
(type netfront)
(uuid a3157965-92f2-dec2-17a5-c6e84b45b3a8)
(backend 0)
)
)
(device
(vbd
(uname file:/xen/root.img-vm1)
(uuid b6017fa1-5688-117b-5b16-ff30226fd869)
(mode w)
(dev hda1:disk)
(backend 0)
(bootable 1)
)
)
(device
(vbd
(uname file:/xen/second.img)
(uuid bd2a234c-53e6-e9e5-f7e2-29b1815cee76)
(mode w)
(dev hdb1:disk)
(backend 0)
(bootable 0)
)
)
(device
(console
(protocol vt100)
(location 2)
(uuid b616112f-af93-9ab4-0d34-a4574105bf65)
)
)
)_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Masaki Kanno wrote:
<snip>
Quoted 9 lines
Quoted 8 lines
IMO, since xen itself now supports managed domains it should be possible to independently change live and stored config. I should be able to feed a starving domain but have it revert to default (define by me) settings when reset. That said I think it will be considerable work, particularly testing, to ensure this behavior across all resource types and xend interfaces.
Quoted 5 lines
I also think the work to need an effort.
When we changed the resources configuration of domain by xm commands, most resources configuration of domain is given to the reset domain without change. AFAIK, only CPU affinity revert to default.
Right.
Quoted 9 lines
Quoted 6 lines
This changes behavior between block-attach and block-detach. In block-detach, the device is removed from store and unplugged from domain if live. For block-attach, the operation fails if domain is inactive. If domain is active, device is plugged but not persisted to store.
I tried xm
block/network-attachcommand with xen-unstable CS:15672.
Yep, sorry. I tested this patch on a 3.1.0-based system missing your earlier patch
http://xenbits2.xensource.com/xen-unstable.hg?rev/3196b63a7301
With both patches, block-[attach|detach] behave symmetrically. I found no problems testing your patch on c/s 15672.
A comment about the patch:
+
+ def convertToDeviceNumber(self, devid):
+ try:
+ dev = int(devid)
+ except ValueError:
+ # devid is not a number but a string containing either
+ # device name (e.g. xvda or xvda:disk) or
+ # device_type/device_id (e.g. vbd/51728)
+ dev = type(devid) is str and devid.split('/')[-1] or None
+ if dev == None:+ return None
+ try:
+ dev = int(dev)
+ except ValueError:
+ dev = dev.split(':')[0]
+ dev = blkdev_name_to_number(dev)
+ return dev
Can this be pushed into the DevController? Seems like the individual device controllers would be best equipped to determine validity of a deviceid. That's what I was trying to do with this patch
http://lists.xensource.com/archives/html/xen-devel/2007-08/msg00038.html
which I see is now in the staging tree as c/s 15689. BTW, there a two xml files included in that c/s that were not part of the patch I submitted :-).
Regards,
Jim
Hi Jim,
Tue Aug. 07 2007, Jim Fehlig wrote:
<snip>
Quoted 20 lines
A comment about the patch:
tools/python/xen/xend/XendDomainInfo.py +17
-0+ + def convertToDeviceNumber(self, devid): + try: + dev = int(devid) + except ValueError: + # devid is not a number but a string containing either + # device name (e.g. xvda or xvda:disk) or + # device_type/device_id (e.g. vbd/51728) + dev = type(devid) is str and devid.split('/')[-1] or None + if dev == None: + return None + try: + dev = int(dev) + except ValueError: + dev = dev.split(':')[0] + dev = blkdev_name_to_number(dev) + return dev
Quoted 3 lines
Can this be pushed into the DevController? Seems like the individual device controllers would be best equipped to determine validity of a deviceid. That's what I was trying to do with this patch
I believe that I can do it.
Quoted 5 lines
http://lists.xensource.com/archives/html/xen-devel/2007-08/msg00038.html
which I see is now in the staging tree as c/s 15689. BTW, there a two xml files included in that c/s that were not part of the patch I submitted :-).
Maybe they are patches for CS:15688.
Best regards,
Kan
Quoted 7 lines · Masaki Kanno
Quoted 5 lines
http://lists.xensource.com/archives/html/xen-devel/2007-08/msg00038.html
which I see is now in the staging tree as c/s 15689. BTW, there a two xml files included in that c/s that were not part of the patch I submitted :-).
Maybe they are patches for CS:15688.
Looks like I forgot to hg addremove on 15688, yes.
-- Keir