[pve-devel] [PATCH qemu-server 1/2] fix q35 live migration

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Nov 27 13:45:50 CET 2018


On 11/27/18 1:30 PM, Dominik Csapak wrote:
> On 11/27/18 12:05 PM, Thomas Lamprecht wrote:
>> On 11/27/18 11:32 AM, Dominik Csapak wrote:
>>> with live migration the machine type not q35, but something like
>>> pc-q35-2.12
>>> so we missed to include the q35 cfg
>>>
>>> in the future we probably want to have a QemuServer::Tools
>>> to refactor such methods
>>
>> there's machine_type_is_q35 in PVE::QemuServer, why not using that one?
>> That way the error wouldn't have been there in the first place...
>>
> 
> yes, but i wanted to fix this fast, but ofc i can send a v2 with a
> refactored QemuServer::Tools which contains (for now) only
> machine_type_is_q35, or do you have a better suggestion for the
> name/place?

You just could have called QemuServer method for now, while we do not encourage
it package internal cyclic dependencies are not a real issue for us, besides a
slight bad feeling maybe. For the long term, yes, you may want to make a module
with some common independent tools, but I wouldn't rush that.

So applied, with a followup comment marking this as fixme...

> 
>>> >> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
>>> ---
>>>   PVE/QemuServer/USB.pm | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/PVE/QemuServer/USB.pm b/PVE/QemuServer/USB.pm
>>> index 3d65d38..036c16c 100644
>>> --- a/PVE/QemuServer/USB.pm
>>> +++ b/PVE/QemuServer/USB.pm
>>> @@ -42,7 +42,7 @@ sub get_usb_controllers {
>>>       if ($arch eq 'aarch64') {
>>>           $pciaddr = print_pci_addr('ehci', $bridges, $arch, $machine);
>>>           push @$devices, '-device', "usb-ehci,id=ehci$pciaddr";
>>> -    } elsif ($machine eq 'q35') {
>>> +    } elsif ($machine =~ /q35/) {
>>>       # the q35 chipset support native usb2, so we enable usb controller
>>>       # by default for this machine type
>>>           push @$devices, '-readconfig', '/usr/share/qemu-server/pve-q35.cfg';
>>





More information about the pve-devel mailing list