search for: vir_domain_affect_config

Displaying 8 results from an estimated 8 matches for "vir_domain_affect_config".

2020 Apr 13
2
what a correct use for virConnectDomainEventRegisterAny API, how to Obtain a stable expected result
...VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED , my process as follow: cb_para->call_id=virConnectDomainEventRegisterAny(cb_para->conn,cb_para->dom,VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free); flags |= VIR_DOMAIN_AFFECT_CONFIG; if (virDomainIsActive(dom) == 1) { flags |= VIR_DOMAIN_AFFECT_LIVE; } ret = virDomainDetachDeviceFlags(dom, xml, flags); above code write in thread loop ,then in the same loop : while (1) { mission = vnf_mission_queue_get(task); if...
2019 Aug 02
2
Re: Detach disk from VM - virsh (working) vs. PHP (not working)
Thank you for your help! 1, i used vda as install disk and vdb as target disk, because i boot from the first. After setup boot order flag i was able change install disk to vdb and target disk to vda. With this configuration when i boot from vdb i can install OS with grub and after it redefine XML without vdb without problem. Thanks a lot. 2, maybe i have something wrong, but still not working:
2019 Aug 03
0
Re: Detach disk from VM - virsh (working) vs. PHP (not working)
...grub and after it redefine XML without vdb without problem. Thanks a lot. > > 2, maybe i have something wrong, but still not working: > > Now in libvirt log i got error: device not found: no target device vdb Ah, of coure. I overlooked that virDomainDetachDeviceFlags() is called with VIR_DOMAIN_AFFECT_CONFIG, which means that live configuration is not affected and if the disk you're trying to detach exists only in live XML then the API fails. The same problem was found in libvirt_domain_disk_add, libvirt_domain_nic_add and libvirt_domain_nic_remove. I've pushed the fixes to the master. Thanks...
2020 Apr 07
0
why virConnectDomainEventRegisterAny can't alway trigger the callback ,how can i get a stable callback ?
...ead , every nic delete has the following process: int vnf_control_del_network(void *arg) { 。。。。。 call_id = virConnectDomainEventRegisterAny(conn, dom, VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free); flags |= VIR_DOMAIN_AFFECT_CONFIG; if (virDomainIsActive(dom) == 1) { flags |= VIR_DOMAIN_AFFECT_LIVE; } ret = virDomainDetachDeviceFlags(dom, xml, flags); // detach a nic from vm guest os 。。。。 } void vnf_control_del_network_cb(virConnectPtr conn, virDomainPtr dom, const char *dev,void * opaque) //th...
2020 Apr 14
0
Re: what a correct use for virConnectDomainEventRegisterAny API, how to Obtain a stable expected result
...t; > my process as follow: > > cb_para->call_id=virConnectDomainEventRegisterAny(cb_para->conn,cb_para->dom,VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free); > > > > flags |= VIR_DOMAIN_AFFECT_CONFIG; > if (virDomainIsActive(dom) == 1) { > flags |= VIR_DOMAIN_AFFECT_LIVE; > } > > ret = virDomainDetachDeviceFlags(dom, xml, flags); > > > > > above code write in thread loop ,then in the same loop : > > > > while (1) { &...
2012 Nov 21
1
add disk problems for domain
hi,all I use Java api `domain.attachDeviceFlags(xml, 0);` to add a disk for domain. the xml file like this: <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/dev/sp1353486595267/v1353488096262'/> <target dev='vdb' bus='virtio'/> </disk> then I use command
2020 Apr 07
0
when virEventAddTimeout trigger timeout ,should in the callback call virConnectDomainEventDeregisterAny ?
...->vnf_id; cb_para->conn = conn; cb_para->time_out = 20*1000;//20s cb_para->call_id = virConnectDomainEventRegisterAny(conn, dom, VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED, VIR_DOMAIN_EVENT_CALLBACK(vnf_control_del_network_cb), cb_para, vnf_control_del_network_cb_free); flags |= VIR_DOMAIN_AFFECT_CONFIG; if (virDomainIsActive(dom) == 1) { flags |= VIR_DOMAIN_AFFECT_LIVE; } cb_para->timer_id = virEventAddTimeout(cb_para->time_out, vnf_control_del_network_timeout_cb, cb_para, vnf_control_del_network_cb_free); ret = virDomainDetachDeviceFlags(dom, xml, flags); //above r...
2012 Jan 24
2
how to change existing domain xml?
Hi. I'm trying to change network settings for a domain via libvirt (the driver is xenapi) with no success. According to its sources, 'virsh edit' uses virDomainGetXMLDesc(), allows to edit the received xml and then use virDomainDefineXML(). In case of xenapi driver it leads to a new vm creation (with the same name and edited settings). Looking through the list of API functions I