qemu device model question
Hi,
while trying to build a pvusb backend in qemu I think I've found a general issue in xl: qemu for pv-domains is started only at domain creation and only if there is at least one backend in qemu required.
If there is no qemu process started for the domain at creation time it will be impossible to successfully add such a device later while the domain is running.
Are there any plans to remove that restriction? Or have I missed some mechanism in xl to start qemu at a later time?
Related to this problem is the question whether it would be desirable to have e.g. qdisk and pvusb backends in the same process possibly influencing each others throughput.
Any thoughts?
Juergen
Quoted 6 lines · Juergen Gross
Hi,
while trying to build a pvusb backend in qemu I think I've found a general issue in xl: qemu for pv-domains is started only at domain creation and only if there is at least one backend in qemu required.
Quoted 6 lines
If there is no qemu process started for the domain at creation time it will be impossible to successfully add such a device later while the domain is running.
Are there any plans to remove that restriction? Or have I missed some mechanism in xl to start qemu at a later time?
I think it would be reasonable to have some way to indicate that pvusb support is desired even if there are no such devices on boot, and for libxl to start the necessary backend in that case.
s/pvusb/whatever/
Quoted 3 lines
Related to this problem is the question whether it would be desirable to have e.g. qdisk and pvusb backends in the same process possibly influencing each others throughput.
Dissagregation of qemu's PV functionality would be nice, but I'm not sure how easy/hard it would be.
Ian.
Quoted 11 lines · Ian Campbell
Quoted 10 lines · Juergen Gross
Hi,
while trying to build a pvusb backend in qemu I think I've found a general issue in xl: qemu for pv-domains is started only at domain creation and only if there is at least one backend in qemu required.
If there is no qemu process started for the domain at creation time it will be impossible to successfully add such a device later while the domain is running.
Quoted 8 lines
Quoted 2 lines
Are there any plans to remove that restriction? Or have I missed some mechanism in xl to start qemu at a later time?
I think it would be reasonable to have some way to indicate that pvusb support is desired even if there are no such devices on boot, and for libxl to start the necessary backend in that case.
s/pvusb/whatever/
libxl__need_xenpv_qemu comes to mind.
Also QEMU has a mode called attach mode. Never use it personally though.
Quoted 8 lines
Quoted 4 lines
Related to this problem is the question whether it would be desirable to have e.g. qdisk and pvusb backends in the same process possibly influencing each others throughput.
Dissagregation of qemu's PV functionality would be nice, but I'm not sure how easy/hard it would be.
At least we would need to invent a new xenstore protocol to support multiple emulator.
Wei.
Quoted 7 lines
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 31 lines · Wei Liu
Quoted 11 lines · Ian Campbell
Quoted 10 lines · Juergen Gross
Hi,
while trying to build a pvusb backend in qemu I think I've found a general issue in xl: qemu for pv-domains is started only at domain creation and only if there is at least one backend in qemu required.
If there is no qemu process started for the domain at creation time it will be impossible to successfully add such a device later while the domain is running.
Quoted 8 lines
Quoted 2 lines
Are there any plans to remove that restriction? Or have I missed some mechanism in xl to start qemu at a later time?
I think it would be reasonable to have some way to indicate that pvusb support is desired even if there are no such devices on boot, and for libxl to start the necessary backend in that case.
s/pvusb/whatever/
libxl__need_xenpv_qemucomes to mind.Also QEMU has a mode called attach mode. Never use it personally though.
Quoted 5 lines
Quoted 4 lines
Related to this problem is the question whether it would be desirable to have e.g. qdisk and pvusb backends in the same process possibly influencing each others throughput.
Quoted 6 lines
Quoted 3 lines
Dissagregation of qemu's PV functionality would be nice, but I'm not sure how easy/hard it would be.
At least we would need to invent a new xenstore protocol to support multiple emulator.
I didn't think we were talking about emulators, just pv backend (so qdisk, qpvusb etc), those all have existing xenstore protocols based on the backend dirs, all which would be needed would be a way to tell qemu which backends a given process should take care of.
Ian.
Quoted 36 lines · Ian Campbell
Quoted 35 lines · Wei Liu
Quoted 11 lines · Ian Campbell
Quoted 10 lines · Juergen Gross
Hi,
while trying to build a pvusb backend in qemu I think I've found a general issue in xl: qemu for pv-domains is started only at domain creation and only if there is at least one backend in qemu required.
If there is no qemu process started for the domain at creation time it will be impossible to successfully add such a device later while the domain is running.
Quoted 8 lines
Quoted 2 lines
Are there any plans to remove that restriction? Or have I missed some mechanism in xl to start qemu at a later time?
I think it would be reasonable to have some way to indicate that pvusb support is desired even if there are no such devices on boot, and for libxl to start the necessary backend in that case.
s/pvusb/whatever/
libxl__need_xenpv_qemucomes to mind.Also QEMU has a mode called attach mode. Never use it personally though.
Quoted 8 lines
Quoted 4 lines
Related to this problem is the question whether it would be desirable to have e.g. qdisk and pvusb backends in the same process possibly influencing each others throughput.
Dissagregation of qemu's PV functionality would be nice, but I'm not sure how easy/hard it would be.
Quoted 8 lines
Quoted 2 lines
At least we would need to invent a new xenstore protocol to support multiple emulator.
I didn't think we were talking about emulators, just pv backend (so qdisk, qpvusb etc), those all have existing xenstore protocols based on the backend dirs, all which would be needed would be a way to tell qemu which backends a given process should take care of.
Yes, you're right.
Wei.
Quoted 2 lines
Ian.
Quoted 15 lines · Wei Liu
Quoted 14 lines · Ian Campbell
Quoted 12 lines · Juergen Gross
Hi,
while trying to build a pvusb backend in qemu I think I've found a general issue in xl: qemu for pv-domains is started only at domain creation and only if there is at least one backend in qemu required.
If there is no qemu process started for the domain at creation time it will be impossible to successfully add such a device later while the domain is running.
Are there any plans to remove that restriction? Or have I missed some mechanism in xl to start qemu at a later time?
Quoted 7 lines
Quoted 5 lines
I think it would be reasonable to have some way to indicate that pvusb support is desired even if there are no such devices on boot, and for libxl to start the necessary backend in that case.
s/pvusb/whatever/
libxl__need_xenpv_qemucomes to mind.
Indeed.
I think it would be easy to add a configuration item in the domain's config file to start qemu unconditionally. Another add-on could be an item in xl.conf to configure the default behaviour.
Quoted 2 lines
Also QEMU has a mode called attach mode. Never use it personally though.
A quick search of the qemu docs didn't show anything. What is it and how could it help?
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Related to this problem is the question whether it would be desirable to have e.g. qdisk and pvusb backends in the same process possibly influencing each others throughput.
Quoted 6 lines
Quoted 3 lines
Dissagregation of qemu's PV functionality would be nice, but I'm not sure how easy/hard it would be.
At least we would need to invent a new xenstore protocol to support multiple emulator.
We could either specify the qemu pid for each backend in xenstore or we could start qemu with a parameter indicating which backend it should provide.
In case we are doing something like this we should construct an interface capable of splitting up even per device, in case we need more than one process e.g. for the qdisks of one domain.
Juergen
Quoted 30 lines · Juergen Gross
Quoted 15 lines · Wei Liu
Quoted 14 lines · Ian Campbell
Quoted 12 lines · Juergen Gross
Hi,
while trying to build a pvusb backend in qemu I think I've found a general issue in xl: qemu for pv-domains is started only at domain creation and only if there is at least one backend in qemu required.
If there is no qemu process started for the domain at creation time it will be impossible to successfully add such a device later while the domain is running.
Are there any plans to remove that restriction? Or have I missed some mechanism in xl to start qemu at a later time?
Quoted 7 lines
Quoted 5 lines
I think it would be reasonable to have some way to indicate that pvusb support is desired even if there are no such devices on boot, and for libxl to start the necessary backend in that case.
s/pvusb/whatever/
libxl__need_xenpv_qemucomes to mind.Indeed.
I think it would be easy to add a configuration item in the domain's config file to start qemu unconditionally. Another add-on could be an item in xl.conf to configure the default behaviour.
Quoted 6 lines
Quoted 2 lines
Also QEMU has a mode called attach mode. Never use it personally though.
A quick search of the qemu docs didn't show anything. What is it and how could it help?
All I know is there is a QEMU option called -xen-attach. QEMU will attach to an existing domain. Again, I never use that personally so I'm not sure if it does what you need or the appropriate infrastructure to start QEMU in that mode is in place. I just mentioned it for completeness.
Wei.
Quoted 23 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Related to this problem is the question whether it would be desirable to have e.g. qdisk and pvusb backends in the same process possibly influencing each others throughput.
Quoted 6 lines
Quoted 3 lines
Dissagregation of qemu's PV functionality would be nice, but I'm not sure how easy/hard it would be.
At least we would need to invent a new xenstore protocol to support multiple emulator.
We could either specify the qemu pid for each backend in xenstore or we could start qemu with a parameter indicating which backend it should provide.
In case we are doing something like this we should construct an interface capable of splitting up even per device, in case we need more than one process e.g. for the qdisks of one domain.
Juergen
Quoted 11 lines · Ian Campbell
Quoted 10 lines · Juergen Gross
Hi,
while trying to build a pvusb backend in qemu I think I've found a general issue in xl: qemu for pv-domains is started only at domain creation and only if there is at least one backend in qemu required.
If there is no qemu process started for the domain at creation time it will be impossible to successfully add such a device later while the domain is running.
Quoted 8 lines
Quoted 2 lines
Are there any plans to remove that restriction? Or have I missed some mechanism in xl to start qemu at a later time?
I think it would be reasonable to have some way to indicate that pvusb support is desired even if there are no such devices on boot, and for libxl to start the necessary backend in that case.
s/pvusb/whatever/
In the pvusb case, I think it's the plan to have an option to specify a pvusb *bus*, even with no devices attached.
But we should probably solve the more general problem. :-) We should have a way to plug in disks / other devices supplied by qemu after the VM is already running.
Specifying an "I might want something later" option is suboptimal from a UI point of view: if the admin forgets to add it when it's needed, she'll have to reboot the VM; if she forgets to remove it when it's not needed, she'll have a useless process lying around, potentially increasing the surface of attack unnecessarily. Starting a qdisk (qemu-pv?) process on-demand would automatically give you the most efficient option without additional UI baggage.
Is there really no way to start up a qdisk process after the domain is created? The qdisk process doesn't actually need to do any emulation, after all -- it's just acting as a backend, right?
-George
Quoted 3 lines · George Dunlap
Is there really no way to start up a qdisk process after the domain is created? The qdisk process doesn't actually need to do any emulation, after all -- it's just acting as a backend, right?
FWIW xencommons starts a qemu for dom0 using:
$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \
-monitor /dev/null -serial /dev/null -parallel /dev/null \
-pidfile $QEMU_PIDFILEI'd be surprised if this didn't also work for an arbitrary PV domain and I assume it wouldn't be needed for an HVM one.
Ian.
Quoted 5 lines · Ian Campbell
Quoted 3 lines · George Dunlap
Is there really no way to start up a qdisk process after the domain is created? The qdisk process doesn't actually need to do any emulation, after all -- it's just acting as a backend, right?
Quoted 7 lines
FWIW xencommons starts a qemu for dom0 using:
$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \ -monitor /dev/null -serial /dev/null -parallel /dev/null \ -pidfile $QEMU_PIDFILEI'd be surprised if this didn't also work for an arbitrary PV domain and I assume it wouldn't be needed for an HVM one.
It doesn't work for HVM guests because the QEMU device model also runs a qdisk backend instance. However it could work for PV/PVH guests.
FYI I am working on a set of patches to remove the handling of PV backends from QEMU device model. it requires both QEMU and libxl changes. Once they are in, you'll be able to do this for HVM guests too.
Quoted 11 lines · Stefano Stabellini
Quoted 10 lines · Ian Campbell
Quoted 3 lines · George Dunlap
Is there really no way to start up a qdisk process after the domain is created? The qdisk process doesn't actually need to do any emulation, after all -- it's just acting as a backend, right?
FWIW xencommons starts a qemu for dom0 using:
$QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize \ -monitor /dev/null -serial /dev/null -parallel /dev/null \ -pidfile $QEMU_PIDFILE
Quoted 5 lines
Quoted 2 lines
I'd be surprised if this didn't also work for an arbitrary PV domain and I assume it wouldn't be needed for an HVM one.
It doesn't work for HVM guests because the QEMU device model also runs a qdisk backend instance. However it could work for PV/PVH guests.
...but it wouldn't be needed because the toolstack can talk to the existing DM and tell it to start providing new PV block devices or pvusb busses.
The discussion here is between starting a "dummy" qemu at start of day if there are no qdisk or pvusb, or starting a qemu on-demand as it's needed. There's obviously no such choice for an HVM domain at the moment, as it always needs qemu for a device model.
Quoted 3 lines
FYI I am working on a set of patches to remove the handling of PV backends from QEMU device model. it requires both QEMU and libxl changes. Once they are in, you'll be able to do this for HVM guests too.
If you do this, then we'll need to solve the same problem for HVM domains as Juergen is trying to solve for PV domains. :-)
But it sounds like it shouldn't be too hard.
-George